• R/O
  • HTTP
  • SSH
  • HTTPS

pybtm: 提交

Python3 implementation of the Bytom protocol. https://pypi.org/project/pybtm/


Commit MetaInfo

修订版3438a120726b76ac4240f7db5215f0083c40cb2e (tree)
时间2019-03-27 19:55:09
作者Chengcheng Zhang <943420582@qq.c...>
CommiterChengcheng Zhang

Log Message

update readme.md

更改概述

差异

--- a/README.md
+++ b/README.md
@@ -12,9 +12,9 @@ pybtm
1212 - [2.7 Create public key](#27-create-public-key)
1313 - [2.8 Create child expanded private key](#28-create-child-expanded-private-key)
1414 - [2.9 Create child expanded public key](#29-create-child-expanded-public-key)
15- - [Sign message](#sign-message)
16- - [Verify signature](#verify-signature)
17- - [Create new key](#create-new-key)
15+ - [2.10 Sign message](#210-sign-message)
16+ - [2.11 Verify signature](#211-verify-signature)
17+ - [2.12 Create new key](#212-create-new-key)
1818
1919 Python3 implementation of the Bytom protocol.
2020
@@ -30,6 +30,10 @@ $ pip install pybtm
3030
3131 get_entropy() create 128 bits entropy.
3232
33+Return:
34+
35+- entropy_hexstr: 128 bits entropy.
36+
3337 ```python
3438 >>> from pybtm import key
3539 >>> key.get_entropy()
@@ -40,6 +44,14 @@ get_entropy() create 128 bits entropy.
4044
4145 get_mnemonic create 12 new mnemonics.
4246
47+Parameter:
48+
49+- entropy_hexstr(optional): 128 bits entropy, type is hex string.
50+
51+Return:
52+
53+- mnemonic_str: 12 mnemonics.
54+
4355 ```python
4456 >>> key.get_mnemonic('089fe9bf0cac76760bc4b131d938669e')
4557 'ancient young hurt bone shuffle deposit congress normal crack six boost despair'
@@ -57,6 +69,14 @@ If no paramater is specified, it will return 12 new random mnemonics.
5769
5870 get_seed create 512 bits seed from 12 mnemonics.
5971
72+Parameter:
73+
74+- mnemonic_str: 12 mnemonics.
75+
76+Return:
77+
78+- seed_hexstr: 512 bits seed, type is hex string.
79+
6080 ```python
6181 >>> from pybtm import key
6282 >>> key.get_seed('ancient young hurt bone shuffle deposit congress normal crack six boost despair')
@@ -67,6 +87,14 @@ get_seed create 512 bits seed from 12 mnemonics.
6787
6888 get_root_xprv create root expanded private key.
6989
90+Parameter:
91+
92+- seed_hexstr: 512 bits seed, type is hex string.
93+
94+Return:
95+
96+- root_xprv_hexstring: 512 bits seed, type is hex string.
97+
7098 ```python
7199 >>> from pybtm import key
72100 >>> key.get_root_xprv('afa3a86bbec2f40bb32833fc6324593824c4fc7821ed32eac1f762b5893e56745f66a6c6f2588b3d627680aa4e0e50efd25065097b3daa8c6a19d606838fe7d4')
@@ -172,7 +200,7 @@ Return:
172200 'e65c1a9714e2116c6e5d57dee188a53b98dc901a21def5a5ca46fcf78303f4f2bd9de7f2dcad9d7d45389bc94baecaec88aabf58f6e1d832b1f9995a93ec37ea'
173201 ```
174202
175-### Sign message
203+### 2.10 Sign message
176204
177205 xprv_sign sign message.
178206
@@ -193,7 +221,7 @@ Return:
193221 'ab18f49b23d03295bc2a3f2a7d5bb53a2997bed733e1fc408b50ec834ae7e43f7da40fe5d9d50f6ef2d188e1d27f976aa2586cef1ba00dd098b5c9effa046306'
194222 ```
195223
196-### Verify signature
224+### 2.11 Verify signature
197225
198226 xpub_verify verify signature.
199227
@@ -216,7 +244,7 @@ Return:
216244 True
217245 ```
218246
219-### Create new key
247+### 2.12 Create new key
220248
221249 get_new_key create new key.
222250
@@ -251,4 +279,22 @@ Return:
251279 {'base64': '/9j/4AAQSkZJRgABAQAAAQABAAD...'}
252280 ```
253281
282+```python
283+>>> from pybtm import key
284+>>> r = key.get_new_key(entropy_hexstr='4d33735a9e92f634d22aecbb4044038d')
285+>>> r['entropy']
286+'4d33735a9e92f634d22aecbb4044038d'
287+>>> r['mnemonic']
288+'essay oppose stove diamond control bounce emerge frown robust acquire abstract brick'
289+```
254290
291+```python
292+>>> from pybtm import key
293+>>> r = key.get_new_key(mnemonic_str='ancient young hurt bone shuffle deposit congress normal crack six boost despair')
294+>>> r['entropy']
295+''
296+>>> r['mnemonic']
297+'ancient young hurt bone shuffle deposit congress normal crack six boost despair'
298+>>> r['seed']
299+'afa3a86bbec2f40bb32833fc6324593824c4fc7821ed32eac1f762b5893e56745f66a6c6f2588b3d627680aa4e0e50efd25065097b3daa8c6a19d606838fe7d4'
300+```
\ No newline at end of file
--- a/pybtm/__init__.py
+++ b/pybtm/__init__.py
@@ -1,2 +1,2 @@
11 name = "pybtm"
2-version = "0.0.15"
\ No newline at end of file
2+version = "0.0.16"
\ No newline at end of file
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
55
66 setuptools.setup(
77 name="pybtm",
8- version="0.0.15",
8+ version="0.0.16",
99 author="zcc0721",
1010 author_email="zcc0721@foxmail.com",
1111 description="Python3 implementation of the Bytom protocol.",
Show on old repository browser