@@ -42,14 +42,33 @@ caddr = bytes_addr(seed_bytes, True)
42
42
uaddr = bytes_addr(seed_bytes)
43
43
```
44
44
45
- ### bytes to ethereum address
45
+ ### Ethereum address
46
46
47
47
``` 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
+
51
55
```
52
56
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
+ ```
53
72
---
54
73
### wif to address:
55
74
@@ -64,34 +83,84 @@ caddr = libit.wif_addr(wif, True)
64
83
# uncompressed
65
84
uaddr = libit.wif_addr(wif)
66
85
```
67
- ### private key to wif
86
+ ---
87
+ ### Passphrase
68
88
69
- convert private key (hex ) to wif compressed and uncompressed
89
+ Generated and Convereted Passphrase (string ) to Compressed and Uncompressed Bitcoin Address Wallet
70
90
71
91
``` python
72
92
import libit
73
93
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
79
101
```
80
102
81
103
---
82
104
83
- ### private key to decimal
105
+ ### Private Key (HEX)
84
106
85
107
``` python
86
108
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
89
141
```
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.
91
146
92
147
``` python
93
148
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 = 0x 0861cce1da15fc2dd79f1164c4f7b3e6c1526e7e8d85716578689ca9a5dc349d
152
+ s1 = 0x 6cf26e2776f7c94cafcee05cc810471ddca16fa864d13d57bee1c06ce39a3188
153
+ s2 = 0x 4ba75bdda43b3aab84b895cfd9ef13a477182657faaf286a7b0d25f0cb9a7de2
154
+ z1 = 0x 01b125d18422cdfa7b153f5bcf5b01927cf59791d1d9810009c70cd37b14f4e6
155
+ z2 = 0x 339ff7b1ced3a45c988b3e4e239ea745db3b2b3fda6208134691bd2e4a37d6e1
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
+
97
165
```
166
+
0 commit comments