mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-20 10:34:20 +01:00
* fix PostMeltRequest and /checkfees to GET * POST /check -> GET /check * fix GetCheckSpendableResponse * rename models * make format * revert GET * bump version to 0.9 * skip nostr test
Notation
Sending user: Alice
Receiving user: Carol
Mint: Bob
Bob (mint)
kprivate key of mint (one for each supported amount)Kpublic key of mintQpromise (blinded signature)
Alice (user)
xrandom string (secret message), corresponds to pointYon curverprivate key (blinding factor)Tblinded messageZproof (unblinded signature)
Blind Diffie-Hellman key exchange (BDH)
- Mint
BobpublishesK = kG Alicepicks secretxand computesY = hash_to_curve(x)Alicesends toBob:T = Y + rGwithrbeing a random nonceBobsends back toAliceblinded key:Q = kT(these two steps are the DH key exchange)Alicecan calculate the unblinded key asQ - rK = kY + krG - krG = kY = Z- Alice can take the pair
(x, Z)as a token and can send it toCarol. Carolcan send(x, Z)toBobwho then checks thatk*hash_to_curve(x) == Z, and if so treats it as a valid spend of a token, addingxto the list of spent secrets.