Skip to content

feat: NUT-CTF conditional tokens for prediction markets#1666

Draft
joemphilips wants to merge 4 commits intocashubtc:mainfrom
joemphilips:ctf
Draft

feat: NUT-CTF conditional tokens for prediction markets#1666
joemphilips wants to merge 4 commits intocashubtc:mainfrom
joemphilips:ctf

Conversation

@joemphilips
Copy link

Summary

Reference implementation of NUT-CTF: Conditional Tokens for Prediction Markets.

This is a work-in-progress draft. More details to follow as the spec stabilizes.

Add NUT-CTF conditional token support including:
- Condition creation, attestation, and partition management
- Split/merge and numeric conditional tokens
- Pagination, status filtering, and incremental sync
- Database storage types and SQL migrations
- Wallet API and HTTP client integration
- Security hardening for conditional token flows
…cation

- Fix record_attestation type mismatch: use MintDatabase<database::Error>
  and map_err(Error::Database) for DB calls
- Extract shared oracle verification into reusable helpers:
  parse_announcements_with_index, verify_enum_threshold,
  verify_numeric_threshold, record_attestation
- Deduplicate swap saga: merge setup_swap and setup_swap_unbalanced into
  setup_swap_inner with BalanceCheck enum
- Replace magic strings with STATUS_PENDING/STATUS_ATTESTED constants
- Remove unused import (STATUS_PENDING in redeem_outcome)
- Minor cleanups: hoist keyset timestamp, avoid unnecessary clone
The /v1/conditions endpoint for NUT-CTF is only available with the
conditional-tokens cargo feature flag enabled.
The `record_attestation` free function took `&dyn MintDatabase<Error>`
without Send+Sync bounds, causing the `post_redeem_outcome` axum
handler's future to not be Send.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant