项目作者: yuntai

项目描述 :
Schnorr related examples (Schnorr, BN, MuSig, discreet log contracts)
高级语言: Python
项目地址: git://github.com/yuntai/schnorr-examples.git
创建时间: 2018-03-29T07:50:02Z
项目社区:https://github.com/yuntai/schnorr-examples

开源协议:

下载


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.