Skip to content

NUTs for prediction markets#337

Open
joemphilips wants to merge 2 commits intocashubtc:mainfrom
joemphilips:nuts_for_prediction_markets
Open

NUTs for prediction markets#337
joemphilips wants to merge 2 commits intocashubtc:mainfrom
joemphilips:nuts_for_prediction_markets

Conversation

@joemphilips
Copy link
Copy Markdown

@joemphilips joemphilips commented Feb 7, 2026

This is my ongoing attempt to support encoding Prediction Market Token with cashu.
My primary motivation is to

There have been previous attempts to support DLCs on Cashu, for example:
#128

The purpose of those attempts was essentially to emulate a two-party DLC transaction using eCash tokens.

This approach is completely different. Each outcome is encoded as a separate token, and the mint is agnostic to the oracles. I believe this is a more natural representation of a prediction-market security token and enables a more liquid market.

This PR contains three NUTs

  • NUT-CTF: Conditional token redemption via oracle-attested outcome keysets
  • NUT-CTF-split-merge: Conditional token split and merge for trading positions
  • NUT-CTF-numeric: Numeric outcome conditions with digit decomposition

Done self-reviewing, it is now ready for review from others. I will try to have a reference implementation ready when I have time. I may update the spec based on what I've learn during implementation.

It is possible to split CTF.md (Conditional Token Framework) into an independent PR if the maintainer wishes. Since this is quite a huge PR.

Reference implementation: cashubtc/cdk#1666

@github-project-automation github-project-automation bot moved this to Backlog in nuts Feb 7, 2026
@joemphilips joemphilips force-pushed the nuts_for_prediction_markets branch from 2657a60 to 3f6850a Compare February 15, 2026 14:10
@joemphilips joemphilips marked this pull request as ready for review February 15, 2026 14:11
@joemphilips joemphilips changed the title WIP: NUTs for prediction markets NUTs for prediction markets Feb 15, 2026
@joemphilips
Copy link
Copy Markdown
Author

Reference implementation (WIP): cashubtc/cdk#1648

@joemphilips joemphilips force-pushed the nuts_for_prediction_markets branch 2 times, most recently from ee15247 to 63af400 Compare February 18, 2026 01:18
@lescuer97
Copy link
Copy Markdown
Contributor

@joemphilips have you taken a look at this PR: #128? its a previous standard for DLCs in cashu. you might want to take a look

@joemphilips
Copy link
Copy Markdown
Author

Hi @lescuer97, thanks for pointing it out. Yes, I've read it.

I didn't go into detail because the approach is quite different from mine. IIUC, PR #128 proposes an
ecash-native DLC framework, using the mint as a blind intermediary for two-party conditional
contracts.

My concern with that approach is that it's primarily suited for bilateral contracts (two parties
locking funds against a predefined outcome tree), whereas CTF is designed for prediction markets
where you need liquidity, composable positions, and the ability to enter/exit freely before
settlement. The two have different scopes:

  • DLC is for "Contract" - enforce a pre-agreed bilateral payout when an oracle attests to an
    outcome.
  • CTF (this PR) is for "Market" - represent outcome exposure as tradeable tokens, enabling open market
    participation.

They're not in conflict. In fact, both can share the same oracle infrastructure (DLC oracle
announcements/attestations), which could benefit the broader ecosystem. But I believe CTF is the
more appropriate primitive for prediction markets within Cashu's trust model.

@joemphilips
Copy link
Copy Markdown
Author

In case anyone's interested, I've been building a PoC application based on this protocol.

[22]: 22.md
[CTF-split-merge]: CTF-split-merge.md
[CTF-numeric]: CTF-numeric.md
[NIP-88]: https://github.com/nostr-protocol/nips/pull/1681
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link should be replaced with an actual NIP after nostr-protocol/nips#1681 gets merged.

Add NUT-CTF (Conditional Token Framework), NUT-CTF-split-merge (split/merge operations), and NUT-CTF-numeric (numeric outcome conditions) specs with test vectors, supplementary material, error codes, and README entries.

Squashed from 9 commits after rebasing onto upstream/main to resolve NUT-28/29 filename conflicts (upstream now uses those numbers for P2BK and Batched Mint).
@joemphilips joemphilips force-pushed the nuts_for_prediction_markets branch from f94f19e to 618bf78 Compare April 6, 2026 09:20
@joemphilips
Copy link
Copy Markdown
Author

squashed and rebased

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.

2 participants