mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-20 18:44:20 +01:00
* adjust tokenv2 and make it backwards compatible * fix dict to list * use pydantic object and not the dtoken * make format * fix typo in _meltrequest_include_fields * reorder functions * fixes and tests working * bump version to 0.8.3
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.