Skip to content

Schnorr related examples (Schnorr, BN, MuSig, discreet log contracts)

Notifications You must be signed in to change notification settings

yuntai/schnorr-examples

Repository files navigation

Key Aggregation example for Schnorr Signatures

schnorr/schnorr.py and schnorr/schonnr_d.py contain the code simulating the signing and verifying schnorr, BN(Bellare-Neven) & MuSig scheme. The code is based on Elliptic Curve Cryptography implementation (ecc.py) from the course material of Programming Blockchain seminar given by Jimmy Song. The original Programming Blockchain(PB) codebase can be found in https://github.com/jimmysong/pb-exercises.

The implementation is based on

I also found this blog helpful - Key Aggregation for Schnorr Signatures

Discrete Log Contracts example

schnorr/dlc.py to simulate DLC execution using ecc.py

Based on Discreet Log Contracts paper by Tadge Dryja.

Extensino to Tx (transaction) to support segwit

wtx.py contains extension for Segwit to the original tx.py from the PB codebase.

Currently (April 8 2018),

  • parsing and serializing Segwit transaction
  • sign and verification for P2WPK transaction test_p2wpkh.py

are implemented. More to come as my learning about bitcoin progresses!

HD Wallet

keychain.py contains an initial implementation of the key derivation scheme specified in [BIP-0032] (https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki). It is based on Elliptic Curve Cryptography implementation (ecc.py) from the course material of Programming Blockchain seminar given by Jimmy Song. The original Programming Blockchain(PB) codebase can be found in https://github.com/jimmysong/pb-exercises.

Third party code

All codes are based on PB codebase (https://github.com/jimmysong/pb-exercises) except segwit_addr.py which is from https://github.com/sipa/bech32.

About

Schnorr related examples (Schnorr, BN, MuSig, discreet log contracts)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages