Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abdelstark/cashu-zk-engine
Cashu Protocol ZK engine. Blind Diffie-Hellmann Key Exchange (BDHKE) implementation in Cairo.
https://github.com/abdelstark/cashu-zk-engine
bitcoin cairo cashu lightning-network starknet zero-knowledge-proofs
Last synced: about 1 month ago
JSON representation
Cashu Protocol ZK engine. Blind Diffie-Hellmann Key Exchange (BDHKE) implementation in Cairo.
- Host: GitHub
- URL: https://github.com/abdelstark/cashu-zk-engine
- Owner: AbdelStark
- License: mit
- Created: 2024-08-02T08:26:18.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-09-18T07:04:28.000Z (about 2 months ago)
- Last Synced: 2024-10-05T16:32:55.135Z (about 1 month ago)
- Topics: bitcoin, cairo, cashu, lightning-network, starknet, zero-knowledge-proofs
- Language: Cairo
- Homepage:
- Size: 203 KB
- Stars: 7
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# About
Blind Diffie-Hellmann Key Exchange (BDHKE) implementation in Cairo.
## Usage
### Running
```bash
scarb cairo-run --available-gas=200000000
```This will run the provided Bitcoin Script in Cairo.
### Building
```bash
scarb build
```This will compile all the components.
### Testing
```bash
scarb test
```## Scheme description
Taken from [RubenSomsen blind ecash Gist](https://gist.github.com/RubenSomsen/be7a4760dd4596d06963d67baf140406).
The goal of this protocol is for Bob to get Alice to perform a Diffie-Hellman key exchange blindly, such that when the unblinded value is returned, Alice recognizes it as her own, but can’t distinguish it from others (i.e. similar to a blind signature).
```text
Alice:
A = a*G
return ABob:
Y = hash_to_curve(secret_message)
r = random blinding factor
B'= Y + r*G
return B'Alice:
C' = a*B'
(= a*Y + a*r*G)
return C'Bob:
C = C' - r*A
(= C' - a*r*G)
(= a*Y)
return C, secret_messageAlice:
Y = hash_to_curve(secret_message)
C == a*YIf true, C must have originated from Alice
```## Resources
- [Cashu documentation](https://docs.cashu.space/)
- [Cashu slides by Gandalf](https://lconf.gandlaf.com/)
- [Nutshell reference implementation](https://github.com/cashubtc/nutshell)