Skip to content

feat: ohttp mint#286

Draft
thesimplekid wants to merge 4 commits intocashubtc:mainfrom
thesimplekid:ohttp
Draft

feat: ohttp mint#286
thesimplekid wants to merge 4 commits intocashubtc:mainfrom
thesimplekid:ohttp

Conversation

@thesimplekid
Copy link
Collaborator

@thesimplekid thesimplekid commented Sep 11, 2025

image

26.md Outdated

## Client Behavior

- Key fetch: Wallets fetch the OHTTP key configuration from `gateway_url + "/ohttp-keys"`. If `gateway_url` is not provided, wallets SHOULD fetch from the mint origin at `"/ohttp-keys"`.

Choose a reason for hiding this comment

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

RFC 9458 cites https://datatracker.ietf.org/doc/html/draft-ietf-privacypass-key-consistency-01 as general reccomendations for key consistency, probably worth linking here.

A mechanism analogous to certificate transparency logs probably makes sense as a future extension, both for OHTTP keys and for the token public keys, I'm happy to share some ideas, and i'm also curious what strategies existing cashu clients use for token key consistency

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We use the keyset id. The wallet verified the keyset id is verified by the wallet before being used https://github.com/cashubtc/nuts/blob/main/02.md#deriving-the-keyset-id

26.md Outdated
## Client Behavior

- Key fetch: Wallets fetch the OHTTP key configuration from `gateway_url + "/ohttp-keys"`. If `gateway_url` is not provided, wallets SHOULD fetch from the mint origin at `"/ohttp-keys"`.
- Encapsulation: Wallets construct a BHTTP request that mirrors a normal Cashu API call (method, scheme, authority, path, headers, and body), encapsulate it with the fetched key config, and send it to the OHTTP gateway endpoint at `"/.well-known/ohttp-gateway"` through a relay.

Choose a reason for hiding this comment

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

in BIP 77 we require padding the encapsulated BHTTP ciphertext to 8192 bytes to resist traffic analysis. Perhaps it makes sense to make a similar recommendation for cashu. If the two user bases share the same set of OHTTP relays and the OHTTP gateway does not reveal which protocol the client is using, it would be beneficial if this value was shared by both protocols.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a nice idea.

@ye0man ye0man added this to nuts Jan 13, 2026
@github-project-automation github-project-automation bot moved this to Backlog in nuts Jan 13, 2026
@ye0man ye0man moved this from Backlog to In progress in nuts Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

3 participants