用于比特币和比特币测试的高清工具
hdtools的Python项目详细描述
hdtools
用于cyrptoccurrency的hd工具,如btc和btct 基于mcdallas/cryptotools。
要求
- 创建virtualenv:
virtualenv -p python3 .env
- 安装要求:
pip install -r requirements
- 使用库:
fromhdtools.extended_keysimport*private_key=XPrv.from_mnemonic('mnemonic phrase')private_key.encode()
如何安装
pip install hdtools
示例
创建高清钱包
>>>fromhdtools.extended_keysimport*>>>M=XPrv.from_mnemonic('lemon child success once board usual cigar buffalo video cheese kitten onion build axis dose')>>>M.encode()b'xprv9s21ZrQH143K38p5ouMV2qFYest2F3uRQC51JPLqsdi8Lh1rkXUJRUy1m7rd5TvooJn6gerthNmntuJag6e73mrf8GmG96Ua8rpayQtUEsL'
地址生成
>>>(M/44./0./0./0/0).address('P2PKH')# BIP44b'1DgEh5Y6NioqaxHBBc2puDYq6SvG5NDsG9'>>>(M/49./0./0./0/0).address('P2WPKH-P2SH')# BIP49b'39Qn8kHG6h7zv1Fh1iwjjyeRibx7gHTq1Z'>>>(M/84./0./0./0/0).address('P2WPKH')# BIP84'bc1qrxxtlul9j3p95wrt33zg7vdf74skujnhnghaey'
运行测试
python3 -m uninttest
运行setup.py
python setup.py sdist bdist_wheel