diff --git a/README.md b/README.md index 1c8a981aab526746ba183a3a9ec09783e2f51c37..a8376d39abfac7e63010f36054af554965d3ef0d 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,62 @@ -# python-mnemonic +python-mnemonic +=============== -#### 介绍 -Implementation of Bitcoin BIP-0039 +Reference implementation of BIP-0039: Mnemonic code for generating +deterministic keys -#### 软件架构 -软件架构说明 +Abstract +-------- +This BIP describes the implementation of a mnemonic code or mnemonic sentence -- +a group of easy to remember words -- for the generation of deterministic wallets. -#### 安装教程 +It consists of two parts: generating the mnenomic, and converting it into a +binary seed. This seed can be later used to generate deterministic wallets using +BIP-0032 or similar methods. -1. xxxx -2. xxxx -3. xxxx +BIP Paper +--------- -#### 使用说明 +See https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki +for full specification -1. xxxx -2. xxxx -3. xxxx +Installation +------------ -#### 参与贡献 +To install this library and its dependencies use: -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request + ``pip install mnemonic`` +Usage examples +-------------- -#### 码云特技 +Import library into python project via: -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 -5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) + from mnemonic import Mnemonic + +Initialize class instance, picking from available dictionaries: + +- english +- chinese_simplified +- chinese_traditional +- french +- italian +- japanese +- korean +- spanish + + + mnemo = Mnemonic(language) + mnemo = Mnemonic("english") + +Generate word list given the strength (128 - 256): + + words = mnemo.generate(strength=256) + +Given the word list and custom passphrase (empty in example), generate seed: + + seed = mnemo.to_seed(words, passphrase="") + +Given the word list, calculate original entropy: + + entropy = mnemo.to_entropy(words) diff --git a/mnemonic-0.18.tar.gz b/mnemonic-0.18.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..2df4a59b765804f41b3793fe096d8006abe1a9f3 Binary files /dev/null and b/mnemonic-0.18.tar.gz differ diff --git a/python-mnemonic.spec b/python-mnemonic.spec new file mode 100644 index 0000000000000000000000000000000000000000..1d4c9986ed6c6fc124fba42f9c40b9e12bb94cb9 --- /dev/null +++ b/python-mnemonic.spec @@ -0,0 +1,66 @@ +%global srcname mnemonic +%global sum Implementation of Bitcoin BIP-0039 + +Name: python-%{srcname} +Version: 0.18 +Release: 1 +Summary: %{sum} + +License: MIT +URL: https://github.com/trezor/python-mnemonic +Source0: https://files.pythonhosted.org/packages/source/m/%{srcname}/%{srcname}-%{version}.tar.gz +BuildArch: noarch +BuildRequires: python3-devel + +%description +This BIP describes the implementation of a mnemonic code or mnemonic sentence - +a group of easy to remember words - for the generation of deterministic wallets. + +It consists of two parts: generating the mnenomic, and converting it into a +binary seed. This seed can be later used to generate deterministic wallets using +BIP-0032 or similar methods. + +See https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki for full +specification. + + +%package -n python3-%{srcname} +Summary: %{sum} +Requires: python3-pbkdf2 +BuildRequires: python3-pbkdf2 +%{?python_provide:%python_provide python3-%{srcname}} + +%description -n python3-%{srcname} +This BIP describes the implementation of a mnemonic code or mnemonic sentence - +a group of easy to remember words - for the generation of deterministic wallets. + +It consists of two parts: generating the mnenomic, and converting it into a +binary seed. This seed can be later used to generate deterministic wallets using +BIP-0032 or similar methods. + +See https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki for full +specification. + + +%prep +%autosetup -n %{srcname}-%{version} +rm -rf %{srcname}.egg-info + +%build +%py3_build + +%install +%py3_install + +%check +%{__python3} setup.py test + +%files -n python3-%{srcname} +%doc PKG-INFO +%doc README.rst +%license LICENSE +%{python3_sitelib}/* + +%changelog +* Wed Jul 07 2021 liuzhaoyang - 0.18-1 +- Initial package