yuntai / schnorr-examples

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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)


Languages

Language:Python 100.0%