Skip to content

deterministic P2PK secrets#630

Open
gudnuf wants to merge 2 commits intointroduce-spending-conditionsfrom
deterministic-p2pk
Open

deterministic P2PK secrets#630
gudnuf wants to merge 2 commits intointroduce-spending-conditionsfrom
deterministic-p2pk

Conversation

@gudnuf
Copy link
Contributor

@gudnuf gudnuf commented Sep 13, 2025

This is an extension to #627

Before now there has not been any definition of deterministic P2PK secrets and the cashu-ts OutputData.createP2pkData method does not allow us to create P2PK output data deterministically.

The way that I implemented this is by deriving a deterministic nonce for each P2PK secret. This nonce is derived using the same derivation path as the secret's defined by NUT-13.

We should confirm that we don't want a new derivation path for the nonce.

NOTE: i had to copy some dependencies from cashu-ts because they are not exported, but they should be in V3

Warning

This will not allow for p2pk proofs to be recovered from just a seed because without our wallet state we have no way of knowing the public key that the proofs were locked to. This is only useful for creating idempotent send-swaps. This means if a user ever tried to recover from seed, then all of the counters used to create P2PK secrets will not return any signatures

@vercel
Copy link

vercel bot commented Sep 13, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
agicash Ready Ready Preview Comment Sep 13, 2025 9:48pm

@supabase
Copy link

supabase bot commented Sep 13, 2025

This pull request has been ignored for the connected project hrebgkfhjpkbxpztqqke because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@gudnuf gudnuf requested a review from jbojcic1 October 9, 2025 22:49
@gudnuf gudnuf added the P3 nice to have eventually label Oct 9, 2025
@gudnuf gudnuf self-assigned this Oct 9, 2025
@gudnuf gudnuf removed the request for review from jbojcic1 October 9, 2025 22:57
@gudnuf gudnuf mentioned this pull request Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 nice to have eventually

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant