libcrypto 1.0.1__tar.gz → 1.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. libcrypto-1.0.2/PKG-INFO +193 -0
  2. libcrypto-1.0.2/README.md +160 -0
  3. {libcrypto-1.0.1 → libcrypto-1.0.2}/setup.py +1 -1
  4. {libcrypto-1.0.1 → libcrypto-1.0.2}/src/libcrypto/__init__.py +1 -1
  5. libcrypto-1.0.2/src/libcrypto.egg-info/PKG-INFO +193 -0
  6. libcrypto-1.0.1/PKG-INFO +0 -318
  7. libcrypto-1.0.1/README.md +0 -285
  8. libcrypto-1.0.1/src/libcrypto.egg-info/PKG-INFO +0 -318
  9. {libcrypto-1.0.1 → libcrypto-1.0.2}/LICENSE +0 -0
  10. {libcrypto-1.0.1 → libcrypto-1.0.2}/pyproject.toml +0 -0
  11. {libcrypto-1.0.1 → libcrypto-1.0.2}/setup.cfg +0 -0
  12. {libcrypto-1.0.1 → libcrypto-1.0.2}/src/libcrypto/_version.py +0 -0
  13. {libcrypto-1.0.1 → libcrypto-1.0.2}/src/libcrypto/addresses.py +0 -0
  14. {libcrypto-1.0.1 → libcrypto-1.0.2}/src/libcrypto/bip32.py +0 -0
  15. {libcrypto-1.0.1 → libcrypto-1.0.2}/src/libcrypto/cli.py +0 -0
  16. {libcrypto-1.0.1 → libcrypto-1.0.2}/src/libcrypto/constants.py +0 -0
  17. {libcrypto-1.0.1 → libcrypto-1.0.2}/src/libcrypto/formats.py +0 -0
  18. {libcrypto-1.0.1 → libcrypto-1.0.2}/src/libcrypto/hash.py +0 -0
  19. {libcrypto-1.0.1 → libcrypto-1.0.2}/src/libcrypto/keys.py +0 -0
  20. {libcrypto-1.0.1 → libcrypto-1.0.2}/src/libcrypto/mnemonic.py +0 -0
  21. {libcrypto-1.0.1 → libcrypto-1.0.2}/src/libcrypto/secp256k1.py +0 -0
  22. {libcrypto-1.0.1 → libcrypto-1.0.2}/src/libcrypto/wallet.py +0 -0
  23. {libcrypto-1.0.1 → libcrypto-1.0.2}/src/libcrypto.egg-info/SOURCES.txt +0 -0
  24. {libcrypto-1.0.1 → libcrypto-1.0.2}/src/libcrypto.egg-info/dependency_links.txt +0 -0
  25. {libcrypto-1.0.1 → libcrypto-1.0.2}/src/libcrypto.egg-info/entry_points.txt +0 -0
  26. {libcrypto-1.0.1 → libcrypto-1.0.2}/src/libcrypto.egg-info/not-zip-safe +0 -0
  27. {libcrypto-1.0.1 → libcrypto-1.0.2}/src/libcrypto.egg-info/requires.txt +0 -0
  28. {libcrypto-1.0.1 → libcrypto-1.0.2}/src/libcrypto.egg-info/top_level.txt +0 -0
@@ -0,0 +1,193 @@
1
+ Metadata-Version: 2.4
2
+ Name: libcrypto
3
+ Version: 1.0.2
4
+ Summary: A professional library For Cryptography and Cryptocurrencies in Python.
5
+ Home-page: https://github.com/pymmdrza/libcrypto
6
+ Author: Mmdrza
7
+ Author-email: Mmdrza <pymmdrza@gmail.com>
8
+ License: MIT
9
+ Project-URL: Homepage, https://libcrypto.readthedocs.io/
10
+ Project-URL: Repository, https://github.com/Pymmdrza/libcrypto
11
+ Project-URL: Bug Tracker, https://github.com/Pymmdrza/libcrypto/issues
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Intended Audience :: Developers
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Classifier: Topic :: Security :: Cryptography
22
+ Requires-Python: >=3.8
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: pycryptodome
26
+ Requires-Dist: ecdsa
27
+ Requires-Dist: rich
28
+ Requires-Dist: typer
29
+ Dynamic: author
30
+ Dynamic: home-page
31
+ Dynamic: license-file
32
+ Dynamic: requires-python
33
+
34
+ ![Python Version](https://img.shields.io/pypi/v/libcrypto?color=blue&logo=python)
35
+ ![License](https://img.shields.io/pypi/l/libcrypto)
36
+ ![PyPI Version](https://img.shields.io/pypi/v/libcrypto)
37
+
38
+ A professional library for Cryptography and Cryptocurrencies in Python.
39
+
40
+ This library provides a comprehensive suite of tools for developers working with cryptocurrencies, focusing on key management and address generation with a clean, high-level API.
41
+
42
+ ## Key Features
43
+
44
+ - **High-Level Wallet API**: A simple `Wallet` class to manage keys and addresses.
45
+ - **Multi-Currency Support**: Correctly generate addresses for numerous secp256k1-based cryptocurrencies, including:
46
+ - Bitcoin (BTC) - Legacy, SegWit (P2SH & Native)
47
+ - Ethereum (ETH)
48
+ - Tron (TRX)
49
+ - Ripple (XRP)
50
+ - Bitcoin Cash (BCH) - CashAddr format
51
+ - Litecoin (LTC)
52
+ - Dash (DASH)
53
+ - Dogecoin (DOGE)
54
+ - **Hierarchical Deterministic (HD) Wallets**: Full BIP32 support for generating wallets from a master seed.
55
+ - **BIP39 Mnemonic Support**: Generate, validate, and derive seeds from mnemonic phrases.
56
+ - **Key & Format Conversions**: Easily convert between WIF, Hex, and Bytes for private and public keys.
57
+ - **Powerful Command-Line Interface**: Perform common wallet operations directly from your terminal.
58
+
59
+ ## Installation
60
+
61
+ Install the library using pip:
62
+ ```bash
63
+ pip install libcrypto
64
+ ```
65
+
66
+ ## Quick Start (Library Usage)
67
+
68
+ ```python
69
+ from libcrypto import Wallet
70
+
71
+ key = "Your private key here (hex)"
72
+ # Initialize the Wallet with the private key
73
+ # Replace "Your private key here (hex)" with your actual private key in hexadecimal format
74
+ wallet = Wallet(key)
75
+ # Generate P2PKH, P2SH-P2WPKH, P2WPKH addresses for Bitcoin
76
+ p2pkh = wallet.get_address(coin="bitcoin", address_type="p2pkh")
77
+ p2wsh = wallet.get_address(coin="bitcoin", address_type="p2sh-p2wpkh")
78
+ p2wpkh = wallet.get_address(coin="bitcoin", address_type="p2wpkh")
79
+ # Generate ethereum Address
80
+ ethereum_address = wallet.get_address(coin="ethereum")
81
+ # Generate Dash Address
82
+ dash = wallet.get_address(coin="dash")
83
+ # Generate Dogecoin Address
84
+ dogecoin_address = wallet.get_address(coin="dogecoin")
85
+ # Generate Tron Address
86
+ tron_address = wallet.get_address(coin="tron")
87
+ # Generate Ripple Address
88
+ ripple_address = wallet.get_address(coin="ripple")
89
+ # Generate Litecoin Address
90
+ litecoin_address = wallet.get_address(coin="litecoin")
91
+ # Generate Litecoin Address with specific address types
92
+ litecoin_address_p2pkh = wallet.get_address(coin="litecoin", address_type="p2pkh")
93
+ litecoin_address_p2wsh = wallet.get_address(coin="litecoin", address_type="p2sh-p2wpkh")
94
+ litecoin_address_p2wpkh = wallet.get_address(coin="litecoin", address_type="p2wpkh")
95
+ ```
96
+
97
+ The library is designed to be straightforward. Here is a basic example of generating addresses from an existing private key.
98
+
99
+ ```python
100
+ from libcrypto import Wallet
101
+
102
+ # Initialize a wallet from a WIF private key
103
+ wif_key = "L4ZQks37JHUadEqaj2nGB1eaZFcsRZwZGQ7WVYuQiztzg4pqopU6" # Example WIF key
104
+ wallet = Wallet(wif_key)
105
+
106
+ # Generate addresses for different coins
107
+ eth_address = wallet.get_address('ethereum')
108
+ btc_address = wallet.get_address('bitcoin', address_type='p2wpkh') # Native SegWit
109
+ bch_address = wallet.get_address('bitcoin_cash')
110
+
111
+ print(f"Ethereum Address: {eth_address}")
112
+ print(f"Bitcoin (SegWit) Address: {btc_address}")
113
+ print(f"Bitcoin Cash Address: {bch_address}")
114
+ ```
115
+
116
+ ## Quick Start (Command-Line Interface)
117
+
118
+ ```bash
119
+ # version
120
+ libcrypto -v
121
+ ```
122
+
123
+ Package Information:
124
+ ```bash
125
+ libcrypto info
126
+ ```
127
+
128
+ ### Wallet & Address Generation
129
+ - Generate a Wallet:
130
+ This is the main command for generating new wallets or deriving addresses from existing keys.
131
+ ```bash
132
+ libcrypto generate [OPTIONS]
133
+ ```
134
+
135
+ Options:
136
+
137
+ - `-p`, `--private-key` TEXT: Derive addresses from an existing private key (WIF or Hex format). If omitted, a new random wallet is generated.
138
+ - `-c`, `--coin` TEXT: Specify a coin to generate addresses for. This option can be used multiple times. Defaults to bitcoin and ethereum.
139
+
140
+
141
+ 1. Generate a new wallet for Bitcoin and Litecoin:
142
+ ```bash
143
+ libcrypto generate -c bitcoin -c litecoin
144
+ ```
145
+
146
+ 2. Generate a wallet from an existing private key:
147
+ ```bash
148
+ libcrypto generate -p <your-private-key>
149
+ ```
150
+
151
+ 3. Derive addresses for a specific set of coins from a hex key:
152
+ ```bash
153
+ libcrypto generate -p <your-hex-key> -c bitcoin -c ethereum -c dash -c tron
154
+ ```
155
+
156
+ ### Mnemonic Management
157
+
158
+ The mnemonic subcommand is used for all BIP39 mnemonic phrase operations.
159
+ Generate a Mnemonic Phrase
160
+
161
+ Creates a new, cryptographically secure BIP39 mnemonic phrase.
162
+
163
+ ```bash
164
+ libcrypto mnemonic generate [OPTIONS]
165
+ ```
166
+
167
+ Options:
168
+
169
+ - `-w`, `--words` INTEGER: The number of words in the mnemonic. Can be 12, 15, 18, 21, or 24. [Default: 12]
170
+
171
+ Example:
172
+ ```bash
173
+ libcrypto mnemonic generate --words 24
174
+ ```
175
+
176
+ ### Validate a Mnemonic Phrase
177
+
178
+ Checks if a given BIP39 mnemonic phrase is valid according to the checksum rules.
179
+
180
+ ```bash
181
+ libcrypto mnemonic validate "PHRASE"
182
+ ```
183
+
184
+ Arguments:
185
+
186
+ - `PHRASE`: The full mnemonic phrase, enclosed in double quotes. [Required]
187
+
188
+ Example:
189
+ ```bash
190
+ libcrypto mnemonic validate "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
191
+ ```
192
+
193
+
@@ -0,0 +1,160 @@
1
+ ![Python Version](https://img.shields.io/pypi/v/libcrypto?color=blue&logo=python)
2
+ ![License](https://img.shields.io/pypi/l/libcrypto)
3
+ ![PyPI Version](https://img.shields.io/pypi/v/libcrypto)
4
+
5
+ A professional library for Cryptography and Cryptocurrencies in Python.
6
+
7
+ This library provides a comprehensive suite of tools for developers working with cryptocurrencies, focusing on key management and address generation with a clean, high-level API.
8
+
9
+ ## Key Features
10
+
11
+ - **High-Level Wallet API**: A simple `Wallet` class to manage keys and addresses.
12
+ - **Multi-Currency Support**: Correctly generate addresses for numerous secp256k1-based cryptocurrencies, including:
13
+ - Bitcoin (BTC) - Legacy, SegWit (P2SH & Native)
14
+ - Ethereum (ETH)
15
+ - Tron (TRX)
16
+ - Ripple (XRP)
17
+ - Bitcoin Cash (BCH) - CashAddr format
18
+ - Litecoin (LTC)
19
+ - Dash (DASH)
20
+ - Dogecoin (DOGE)
21
+ - **Hierarchical Deterministic (HD) Wallets**: Full BIP32 support for generating wallets from a master seed.
22
+ - **BIP39 Mnemonic Support**: Generate, validate, and derive seeds from mnemonic phrases.
23
+ - **Key & Format Conversions**: Easily convert between WIF, Hex, and Bytes for private and public keys.
24
+ - **Powerful Command-Line Interface**: Perform common wallet operations directly from your terminal.
25
+
26
+ ## Installation
27
+
28
+ Install the library using pip:
29
+ ```bash
30
+ pip install libcrypto
31
+ ```
32
+
33
+ ## Quick Start (Library Usage)
34
+
35
+ ```python
36
+ from libcrypto import Wallet
37
+
38
+ key = "Your private key here (hex)"
39
+ # Initialize the Wallet with the private key
40
+ # Replace "Your private key here (hex)" with your actual private key in hexadecimal format
41
+ wallet = Wallet(key)
42
+ # Generate P2PKH, P2SH-P2WPKH, P2WPKH addresses for Bitcoin
43
+ p2pkh = wallet.get_address(coin="bitcoin", address_type="p2pkh")
44
+ p2wsh = wallet.get_address(coin="bitcoin", address_type="p2sh-p2wpkh")
45
+ p2wpkh = wallet.get_address(coin="bitcoin", address_type="p2wpkh")
46
+ # Generate ethereum Address
47
+ ethereum_address = wallet.get_address(coin="ethereum")
48
+ # Generate Dash Address
49
+ dash = wallet.get_address(coin="dash")
50
+ # Generate Dogecoin Address
51
+ dogecoin_address = wallet.get_address(coin="dogecoin")
52
+ # Generate Tron Address
53
+ tron_address = wallet.get_address(coin="tron")
54
+ # Generate Ripple Address
55
+ ripple_address = wallet.get_address(coin="ripple")
56
+ # Generate Litecoin Address
57
+ litecoin_address = wallet.get_address(coin="litecoin")
58
+ # Generate Litecoin Address with specific address types
59
+ litecoin_address_p2pkh = wallet.get_address(coin="litecoin", address_type="p2pkh")
60
+ litecoin_address_p2wsh = wallet.get_address(coin="litecoin", address_type="p2sh-p2wpkh")
61
+ litecoin_address_p2wpkh = wallet.get_address(coin="litecoin", address_type="p2wpkh")
62
+ ```
63
+
64
+ The library is designed to be straightforward. Here is a basic example of generating addresses from an existing private key.
65
+
66
+ ```python
67
+ from libcrypto import Wallet
68
+
69
+ # Initialize a wallet from a WIF private key
70
+ wif_key = "L4ZQks37JHUadEqaj2nGB1eaZFcsRZwZGQ7WVYuQiztzg4pqopU6" # Example WIF key
71
+ wallet = Wallet(wif_key)
72
+
73
+ # Generate addresses for different coins
74
+ eth_address = wallet.get_address('ethereum')
75
+ btc_address = wallet.get_address('bitcoin', address_type='p2wpkh') # Native SegWit
76
+ bch_address = wallet.get_address('bitcoin_cash')
77
+
78
+ print(f"Ethereum Address: {eth_address}")
79
+ print(f"Bitcoin (SegWit) Address: {btc_address}")
80
+ print(f"Bitcoin Cash Address: {bch_address}")
81
+ ```
82
+
83
+ ## Quick Start (Command-Line Interface)
84
+
85
+ ```bash
86
+ # version
87
+ libcrypto -v
88
+ ```
89
+
90
+ Package Information:
91
+ ```bash
92
+ libcrypto info
93
+ ```
94
+
95
+ ### Wallet & Address Generation
96
+ - Generate a Wallet:
97
+ This is the main command for generating new wallets or deriving addresses from existing keys.
98
+ ```bash
99
+ libcrypto generate [OPTIONS]
100
+ ```
101
+
102
+ Options:
103
+
104
+ - `-p`, `--private-key` TEXT: Derive addresses from an existing private key (WIF or Hex format). If omitted, a new random wallet is generated.
105
+ - `-c`, `--coin` TEXT: Specify a coin to generate addresses for. This option can be used multiple times. Defaults to bitcoin and ethereum.
106
+
107
+
108
+ 1. Generate a new wallet for Bitcoin and Litecoin:
109
+ ```bash
110
+ libcrypto generate -c bitcoin -c litecoin
111
+ ```
112
+
113
+ 2. Generate a wallet from an existing private key:
114
+ ```bash
115
+ libcrypto generate -p <your-private-key>
116
+ ```
117
+
118
+ 3. Derive addresses for a specific set of coins from a hex key:
119
+ ```bash
120
+ libcrypto generate -p <your-hex-key> -c bitcoin -c ethereum -c dash -c tron
121
+ ```
122
+
123
+ ### Mnemonic Management
124
+
125
+ The mnemonic subcommand is used for all BIP39 mnemonic phrase operations.
126
+ Generate a Mnemonic Phrase
127
+
128
+ Creates a new, cryptographically secure BIP39 mnemonic phrase.
129
+
130
+ ```bash
131
+ libcrypto mnemonic generate [OPTIONS]
132
+ ```
133
+
134
+ Options:
135
+
136
+ - `-w`, `--words` INTEGER: The number of words in the mnemonic. Can be 12, 15, 18, 21, or 24. [Default: 12]
137
+
138
+ Example:
139
+ ```bash
140
+ libcrypto mnemonic generate --words 24
141
+ ```
142
+
143
+ ### Validate a Mnemonic Phrase
144
+
145
+ Checks if a given BIP39 mnemonic phrase is valid according to the checksum rules.
146
+
147
+ ```bash
148
+ libcrypto mnemonic validate "PHRASE"
149
+ ```
150
+
151
+ Arguments:
152
+
153
+ - `PHRASE`: The full mnemonic phrase, enclosed in double quotes. [Required]
154
+
155
+ Example:
156
+ ```bash
157
+ libcrypto mnemonic validate "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
158
+ ```
159
+
160
+
@@ -17,7 +17,7 @@ def get_long_description():
17
17
 
18
18
  setup(
19
19
  name="libcrypto",
20
- version="1.0.1",
20
+ version="1.0.2",
21
21
  description="Comprehensive cryptocurrency wallet library with BIP39/BIP32 support using only pycryptodome",
22
22
  long_description=get_long_description(),
23
23
  long_description_content_type="text/markdown",
@@ -30,7 +30,7 @@ from .formats import (
30
30
  InvalidFormatError
31
31
  )
32
32
 
33
- __version__ = "1.0.1"
33
+ __version__ = "1.0.2"
34
34
  __all__ = [
35
35
  # Library Version
36
36
  '__version__',
@@ -0,0 +1,193 @@
1
+ Metadata-Version: 2.4
2
+ Name: libcrypto
3
+ Version: 1.0.2
4
+ Summary: A professional library For Cryptography and Cryptocurrencies in Python.
5
+ Home-page: https://github.com/pymmdrza/libcrypto
6
+ Author: Mmdrza
7
+ Author-email: Mmdrza <pymmdrza@gmail.com>
8
+ License: MIT
9
+ Project-URL: Homepage, https://libcrypto.readthedocs.io/
10
+ Project-URL: Repository, https://github.com/Pymmdrza/libcrypto
11
+ Project-URL: Bug Tracker, https://github.com/Pymmdrza/libcrypto/issues
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Intended Audience :: Developers
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Classifier: Topic :: Security :: Cryptography
22
+ Requires-Python: >=3.8
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: pycryptodome
26
+ Requires-Dist: ecdsa
27
+ Requires-Dist: rich
28
+ Requires-Dist: typer
29
+ Dynamic: author
30
+ Dynamic: home-page
31
+ Dynamic: license-file
32
+ Dynamic: requires-python
33
+
34
+ ![Python Version](https://img.shields.io/pypi/v/libcrypto?color=blue&logo=python)
35
+ ![License](https://img.shields.io/pypi/l/libcrypto)
36
+ ![PyPI Version](https://img.shields.io/pypi/v/libcrypto)
37
+
38
+ A professional library for Cryptography and Cryptocurrencies in Python.
39
+
40
+ This library provides a comprehensive suite of tools for developers working with cryptocurrencies, focusing on key management and address generation with a clean, high-level API.
41
+
42
+ ## Key Features
43
+
44
+ - **High-Level Wallet API**: A simple `Wallet` class to manage keys and addresses.
45
+ - **Multi-Currency Support**: Correctly generate addresses for numerous secp256k1-based cryptocurrencies, including:
46
+ - Bitcoin (BTC) - Legacy, SegWit (P2SH & Native)
47
+ - Ethereum (ETH)
48
+ - Tron (TRX)
49
+ - Ripple (XRP)
50
+ - Bitcoin Cash (BCH) - CashAddr format
51
+ - Litecoin (LTC)
52
+ - Dash (DASH)
53
+ - Dogecoin (DOGE)
54
+ - **Hierarchical Deterministic (HD) Wallets**: Full BIP32 support for generating wallets from a master seed.
55
+ - **BIP39 Mnemonic Support**: Generate, validate, and derive seeds from mnemonic phrases.
56
+ - **Key & Format Conversions**: Easily convert between WIF, Hex, and Bytes for private and public keys.
57
+ - **Powerful Command-Line Interface**: Perform common wallet operations directly from your terminal.
58
+
59
+ ## Installation
60
+
61
+ Install the library using pip:
62
+ ```bash
63
+ pip install libcrypto
64
+ ```
65
+
66
+ ## Quick Start (Library Usage)
67
+
68
+ ```python
69
+ from libcrypto import Wallet
70
+
71
+ key = "Your private key here (hex)"
72
+ # Initialize the Wallet with the private key
73
+ # Replace "Your private key here (hex)" with your actual private key in hexadecimal format
74
+ wallet = Wallet(key)
75
+ # Generate P2PKH, P2SH-P2WPKH, P2WPKH addresses for Bitcoin
76
+ p2pkh = wallet.get_address(coin="bitcoin", address_type="p2pkh")
77
+ p2wsh = wallet.get_address(coin="bitcoin", address_type="p2sh-p2wpkh")
78
+ p2wpkh = wallet.get_address(coin="bitcoin", address_type="p2wpkh")
79
+ # Generate ethereum Address
80
+ ethereum_address = wallet.get_address(coin="ethereum")
81
+ # Generate Dash Address
82
+ dash = wallet.get_address(coin="dash")
83
+ # Generate Dogecoin Address
84
+ dogecoin_address = wallet.get_address(coin="dogecoin")
85
+ # Generate Tron Address
86
+ tron_address = wallet.get_address(coin="tron")
87
+ # Generate Ripple Address
88
+ ripple_address = wallet.get_address(coin="ripple")
89
+ # Generate Litecoin Address
90
+ litecoin_address = wallet.get_address(coin="litecoin")
91
+ # Generate Litecoin Address with specific address types
92
+ litecoin_address_p2pkh = wallet.get_address(coin="litecoin", address_type="p2pkh")
93
+ litecoin_address_p2wsh = wallet.get_address(coin="litecoin", address_type="p2sh-p2wpkh")
94
+ litecoin_address_p2wpkh = wallet.get_address(coin="litecoin", address_type="p2wpkh")
95
+ ```
96
+
97
+ The library is designed to be straightforward. Here is a basic example of generating addresses from an existing private key.
98
+
99
+ ```python
100
+ from libcrypto import Wallet
101
+
102
+ # Initialize a wallet from a WIF private key
103
+ wif_key = "L4ZQks37JHUadEqaj2nGB1eaZFcsRZwZGQ7WVYuQiztzg4pqopU6" # Example WIF key
104
+ wallet = Wallet(wif_key)
105
+
106
+ # Generate addresses for different coins
107
+ eth_address = wallet.get_address('ethereum')
108
+ btc_address = wallet.get_address('bitcoin', address_type='p2wpkh') # Native SegWit
109
+ bch_address = wallet.get_address('bitcoin_cash')
110
+
111
+ print(f"Ethereum Address: {eth_address}")
112
+ print(f"Bitcoin (SegWit) Address: {btc_address}")
113
+ print(f"Bitcoin Cash Address: {bch_address}")
114
+ ```
115
+
116
+ ## Quick Start (Command-Line Interface)
117
+
118
+ ```bash
119
+ # version
120
+ libcrypto -v
121
+ ```
122
+
123
+ Package Information:
124
+ ```bash
125
+ libcrypto info
126
+ ```
127
+
128
+ ### Wallet & Address Generation
129
+ - Generate a Wallet:
130
+ This is the main command for generating new wallets or deriving addresses from existing keys.
131
+ ```bash
132
+ libcrypto generate [OPTIONS]
133
+ ```
134
+
135
+ Options:
136
+
137
+ - `-p`, `--private-key` TEXT: Derive addresses from an existing private key (WIF or Hex format). If omitted, a new random wallet is generated.
138
+ - `-c`, `--coin` TEXT: Specify a coin to generate addresses for. This option can be used multiple times. Defaults to bitcoin and ethereum.
139
+
140
+
141
+ 1. Generate a new wallet for Bitcoin and Litecoin:
142
+ ```bash
143
+ libcrypto generate -c bitcoin -c litecoin
144
+ ```
145
+
146
+ 2. Generate a wallet from an existing private key:
147
+ ```bash
148
+ libcrypto generate -p <your-private-key>
149
+ ```
150
+
151
+ 3. Derive addresses for a specific set of coins from a hex key:
152
+ ```bash
153
+ libcrypto generate -p <your-hex-key> -c bitcoin -c ethereum -c dash -c tron
154
+ ```
155
+
156
+ ### Mnemonic Management
157
+
158
+ The mnemonic subcommand is used for all BIP39 mnemonic phrase operations.
159
+ Generate a Mnemonic Phrase
160
+
161
+ Creates a new, cryptographically secure BIP39 mnemonic phrase.
162
+
163
+ ```bash
164
+ libcrypto mnemonic generate [OPTIONS]
165
+ ```
166
+
167
+ Options:
168
+
169
+ - `-w`, `--words` INTEGER: The number of words in the mnemonic. Can be 12, 15, 18, 21, or 24. [Default: 12]
170
+
171
+ Example:
172
+ ```bash
173
+ libcrypto mnemonic generate --words 24
174
+ ```
175
+
176
+ ### Validate a Mnemonic Phrase
177
+
178
+ Checks if a given BIP39 mnemonic phrase is valid according to the checksum rules.
179
+
180
+ ```bash
181
+ libcrypto mnemonic validate "PHRASE"
182
+ ```
183
+
184
+ Arguments:
185
+
186
+ - `PHRASE`: The full mnemonic phrase, enclosed in double quotes. [Required]
187
+
188
+ Example:
189
+ ```bash
190
+ libcrypto mnemonic validate "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
191
+ ```
192
+
193
+