Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

Awesome Lists containing this project

README

        


Blind Diffie-Hellmann Key Exchange (BDHKE) implementation in Cairo.

GitHub Workflow Status

Bitcoin
Nostr
Bitcoin Lightning
Cairo

# 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 A

Bob:
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_message

Alice:
Y = hash_to_curve(secret_message)
C == a*Y

If 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)