Skip to content

Commit eb9a3f9

Browse files
authoredMar 16, 2025··
Update README.md
1 parent b8047b7 commit eb9a3f9

File tree

1 file changed

+87
-18
lines changed

1 file changed

+87
-18
lines changed
 

‎README.md

+87-18
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,33 @@ caddr = bytes_addr(seed_bytes, True)
4242
uaddr = bytes_addr(seed_bytes)
4343
```
4444

45-
### bytes to ethereum address
45+
### Ethereum address
4646

4747
```python
48-
from libit import bytes_eth
49-
seed_bytes = b"Bytes data (32 bytes)"
50-
eth_addr = bytes_eth(seed_bytes)
48+
import libit
49+
eth = libit.Ethereum(private_key=private_key)
50+
# Ethereum Address
51+
eth_addr = eth.get_address()
52+
# Ethereum Address Hex
53+
eth_hash = eth.get_hexAddress()
54+
5155
```
5256

57+
### Tron
58+
59+
Generate and Converted Private Key to Tron (TRX) Address Wallet + Hex
60+
61+
```python
62+
import libit
63+
# Tron
64+
tron = libit.tron(private_key)
65+
# Address Wallet
66+
tron_addr = tron.get_address()
67+
# TVzMud6edfxrdiyfa6ymEh7huQfWHjtiSK
68+
# Tron Hex
69+
tron_hex = tron.get_hexAddress()
70+
# 41db9a5dc0e70338da631da168f8fe4d503de9c8c5
71+
```
5372
---
5473
### wif to address:
5574

@@ -64,34 +83,84 @@ caddr = libit.wif_addr(wif, True)
6483
# uncompressed
6584
uaddr = libit.wif_addr(wif)
6685
```
67-
### private key to wif
86+
---
87+
### Passphrase
6888

69-
convert private key (hex) to wif compressed and uncompressed
89+
Generated and Convereted Passphrase (string) to Compressed and Uncompressed Bitcoin Address Wallet
7090

7191
```python
7292
import libit
7393

74-
pvk_hex = "hex private key"
75-
# compressed
76-
wif_compress = libit.pvk_to_wif(pvk_hex, True)
77-
# uncompressed
78-
wif_decompress = libit.pvk_to_wif(pvk_hex)
94+
# Passphrase
95+
pass_target = "libit"
96+
97+
compressed_address = libit.passphrase_addr(pass_target, True)
98+
# output: 1MpWosiCM7PYubsi6h1QEgcHPAk3STbyzd
99+
uncompressed_address = libit.passphrase_addr(pass_target, False)
100+
# output: 1Dmaa5Rc3nbCq6XyQ7ytK2XTXKuNZqdGzV
79101
```
80102

81103
---
82104

83-
### private key to decimal
105+
### Private Key (HEX)
84106

85107
```python
86108
import libit
87-
pvk = "hex private key"
88-
decimal = libit.pvk_to_decimal(pvk)
109+
110+
private_key = "3e891d92f1c2af69e0f38a354247c4cc99ed39c690649a784b28eeed26a33c60"
111+
112+
# Decimal
113+
decimal = libit.privatekey_decimal(private_key)
114+
# Output: 28285658772293776204563833849098122629211544261487479808490805808188778298464
115+
116+
# Wif Compress and Uncompress
117+
wif_compress = libit.privatekey_wif(private_key, True)
118+
# output: KyKGj2ZHFv7atucKxGTTsmyCY5ZoPfanvzPd8Ev6w1SM4saVTss7
119+
wif_decompress = libit.privatekey_wif(private_key, False)
120+
# output: 5JHpyCECqh8PBQFM9tzCXY2rjqcXSymp7LoMsaWhmQfNKAnrt9z
121+
122+
# Bitcoin Address Compress and Uncompress
123+
btc_compress = libit.privatekey_addr(private_key, True)
124+
# output: 1EwmhfQhsMsYWSd2VwgmxmcSPjVXuovPVa
125+
btc_decompress = libit.privatekey_addr(private_key, False)
126+
# output: 16KuHiP42KTxbPJc3y4DmjToRZXX9ePEyH
127+
128+
# Ethereum Address and Hex Address
129+
eth = libit.Ethereum(private_key=private_key)
130+
eth_addr = eth.get_address()
131+
# output: 0xdb9a5dc0e70338da631da168f8fe4d503de9c8c5
132+
eth_hex = eth.get_hexAddress()
133+
# output: 3e891d92f1c2af69e0f38a354247c4cc99ed39c690649a784b28eeed26a33c60
134+
135+
# Tron Address and Hex Address (Hash)
136+
tron = libit.tron(private_key=private_key)
137+
tron_addr = tron.get_address()
138+
# output: TVzMud6edfxrdiyfa6ymEh7huQfWHjtiSK
139+
tron_hex = tron.get_hexAddress()
140+
# output: 41db9a5dc0e70338da631da168f8fe4d503de9c8c5
89141
```
90-
### private key to address
142+
143+
### Reuse Method
144+
145+
Extract Private Key and Public Key From Transaction ID (hash) for reuse type wallet.
91146

92147
```python
93148
import libit
94-
pvk = "hex private key"
95-
compress_addr = libit.privatekey_addr(pvk, True)
96-
uncompress_addr = libit.privatekey_addr(pvk)
149+
from libit import reuse
150+
151+
r = 0x0861cce1da15fc2dd79f1164c4f7b3e6c1526e7e8d85716578689ca9a5dc349d
152+
s1 = 0x6cf26e2776f7c94cafcee05cc810471ddca16fa864d13d57bee1c06ce39a3188
153+
s2 = 0x4ba75bdda43b3aab84b895cfd9ef13a477182657faaf286a7b0d25f0cb9a7de2
154+
z1 = 0x01b125d18422cdfa7b153f5bcf5b01927cf59791d1d9810009c70cd37b14f4e6
155+
z2 = 0x339ff7b1ced3a45c988b3e4e239ea745db3b2b3fda6208134691bd2e4a37d6e1
156+
157+
pvk, pub = reuse.extract_key(r, s1, s2, z1, z2)
158+
# pvk: e773cf35fce567d0622203c28f67478a3361bae7e6eb4366b50e1d27eb1ed82e
159+
# pub: eaa57720a5b012351d42b2d9ed6409af2b7cff11d2b8631684c1c97f49685fbb
160+
# convert private key to bitcoin address
161+
address = libit.privatekey_addr(pvk, True)
162+
# output: 1FCpHq81nNLPkppTmidmoHAUy8xApTZ292
163+
# (Total Transaction: 8 | Received: 1.56534788 BTC | Total Sent: 1.56534788 BTC)
164+
97165
```
166+

0 commit comments

Comments
 (0)
Please sign in to comment.