Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not return proofs when minting ehash #24

Open
vnprc opened this issue Feb 24, 2025 · 2 comments
Open

Do not return proofs when minting ehash #24

vnprc opened this issue Feb 24, 2025 · 2 comments

Comments

@vnprc
Copy link
Owner

vnprc commented Feb 24, 2025

Minting ehash should not return proofs directly. Instead we should use this flow combining NUT-04 and NUT-20:

  1. Proxy submits blinded secrets, mining share, and a unique pubkey upstream to the pool
  2. Pool/mint creates a quote
    A. Create a new payment method, perhaps called mining
    B. Use the block header hash output as the quote request
    C. When the mining share is guaranteed to not be invalidated (for example if the the user provided block template rejected) update the quote state to paid
  3. Once quote state is paid the mint will provide proofs locked to the users pubkey with NUT-20
  4. User periodically checks the quote state with the mint service over http. For any quote that is paid they can sweep the ehash tokens
    A. User must provide a signature over the quote using the privkey associated with the pubkey provided in step 1 as described in NUT-20

cashubtc/cdk#605

@EthnTuttle
Copy link
Collaborator

How is the mint aware of what is valid block template?

@vnprc
Copy link
Owner Author

vnprc commented Feb 24, 2025

The pool will update the mint when shares are finalized through some new message flow. If users are not submitting block templates I believe this can happen immediately upon share validation so the quote can be set to paid right away.

For async validation the mint can hold back the blind signatures until the backing shares are fully validated. This is necessary because once a proof is issued it cannot be invalidated. If mining shares are invalidated after the ehash token has been issued this would be inflationary. In other words, ecash is no take backs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants