@@ -17,159 +17,159 @@ To install with pip, run:
17
17
Quickstart Guide
18
18
----------------
19
19
20
- Usage:
20
+ Usage:
21
21
22
- python bmt.py -h
23
- usage: python3 bmt.py [ -h] {sign,verify} ...
22
+ python bmt.py -h
23
+ usage: python3 bmt.py [-h] {sign,verify} ...
24
24
25
- Bitcoin message signing/verification tool
25
+ Bitcoin message signing/verification tool
26
26
27
- positional arguments:
28
- {sign,verify}
27
+ positional arguments:
28
+ {sign,verify}
29
29
30
- options:
31
- -h, --help show this help message and exit
30
+ options:
31
+ -h, --help show this help message and exit
32
32
33
- Message signing
33
+ Message signing
34
34
35
- python bmt.py sign -h
36
- usage: python3 bmt.py sign [ -h] -p -a {p2pkh,p2wpkh-p2sh,p2wpkh} -m [ MESSAGE ...] [ -d] [ -v]
35
+ python bmt.py sign -h
36
+ usage: python3 bmt.py sign [-h] -p -a {p2pkh,p2wpkh-p2sh,p2wpkh} -m [MESSAGE ...] [-d] [-v]
37
37
38
- options:
39
- -h, --help show this help message and exit
38
+ options:
39
+ -h, --help show this help message and exit
40
40
41
- Sign messsage:
42
- -p, --privkey private key in wallet import format (WIF)
43
- -a {p2pkh,p2wpkh-p2sh,p2wpkh}, --addr_type {p2pkh,p2wpkh-p2sh,p2wpkh}
44
- type of bitcoin address
45
- -m [ MESSAGE ...] , --message [ MESSAGE ...]
46
- Message to sign
47
- -d, --deterministic sign deterministtically (RFC6979)
48
- -v, --verbose print prettified message
41
+ Sign messsage:
42
+ -p, --privkey private key in wallet import format (WIF)
43
+ -a {p2pkh,p2wpkh-p2sh,p2wpkh}, --addr_type {p2pkh,p2wpkh-p2sh,p2wpkh}
44
+ type of bitcoin address
45
+ -m [MESSAGE ...], --message [MESSAGE ...]
46
+ Message to sign
47
+ -d, --deterministic sign deterministtically (RFC6979)
48
+ -v, --verbose print prettified message
49
49
50
- Example 1:
51
- Non-deterministic signature for compressed private key and p2pkh address
50
+ Example 1:
51
+ Non-deterministic signature for compressed private key and p2pkh address
52
52
53
- $python bmt.py sign -p -a p2pkh -m ECDSA is the most fun I have ever experienced
53
+ $python bmt.py sign -p -a p2pkh -m ECDSA is the most fun I have ever experienced
54
54
55
- PrivateKey(WIF): <insert private key here >
55
+ PrivateKey(WIF): <insert private key here>
56
56
57
- Output:
57
+ Output:
58
58
59
- Bitcoin address: 175A5YsPUdM71mnNCC3i8faxxYJgBonjWL
60
- Message: ECDSA is the most fun I have ever experienced
61
- Signature: IBuc5GXSJCr6m7KevsBAoCiX8ToOjW2CDZMr6PCEbiHwQJ237LZTj/REbDHI1/yelY6uBWEWXiOWoGnajlgvO/A=
59
+ Bitcoin address: 175A5YsPUdM71mnNCC3i8faxxYJgBonjWL
60
+ Message: ECDSA is the most fun I have ever experienced
61
+ Signature: IBuc5GXSJCr6m7KevsBAoCiX8ToOjW2CDZMr6PCEbiHwQJ237LZTj/REbDHI1/yelY6uBWEWXiOWoGnajlgvO/A=
62
62
63
- Example 2:
64
- Deterministic signature for compressed private key and p2pkh address
63
+ Example 2:
64
+ Deterministic signature for compressed private key and p2pkh address
65
65
66
- $python bmt.py sign -p -a p2pkh -m ECDSA is the most fun I have ever experienced -d
66
+ $python bmt.py sign -p -a p2pkh -m ECDSA is the most fun I have ever experienced -d
67
67
68
- PrivateKey(WIF): <insert private key here >
68
+ PrivateKey(WIF): <insert private key here>
69
69
70
- Output:
70
+ Output:
71
71
72
- Bitcoin address: 175A5YsPUdM71mnNCC3i8faxxYJgBonjWL
73
- Message: ECDSA is the most fun I have ever experienced
74
- Signature: HyiLDcQQ1p2bKmyqM0e5oIBQtKSZds4kJQ+VbZWpr0kYA6Qkam2MlUeTr+lm1teUGHuLapfa43JjyrRqdSA0pxs=
72
+ Bitcoin address: 175A5YsPUdM71mnNCC3i8faxxYJgBonjWL
73
+ Message: ECDSA is the most fun I have ever experienced
74
+ Signature: HyiLDcQQ1p2bKmyqM0e5oIBQtKSZds4kJQ+VbZWpr0kYA6Qkam2MlUeTr+lm1teUGHuLapfa43JjyrRqdSA0pxs=
75
75
76
- Example 3:
77
- Deterministic signature for compressed private key and p2pkh address (verbose mode)
76
+ Example 3:
77
+ Deterministic signature for compressed private key and p2pkh address (verbose mode)
78
78
79
- $python bmt.py sign -p -a p2pkh -m ECDSA is the most fun I have ever experienced -d -v
79
+ $python bmt.py sign -p -a p2pkh -m ECDSA is the most fun I have ever experienced -d -v
80
80
81
- PrivateKey(WIF): <insert private key here >
81
+ PrivateKey(WIF): <insert private key here>
82
82
83
- Output:
83
+ Output:
84
84
85
- -----BEGIN BITCOIN SIGNED MESSAGE-----
86
- ECDSA is the most fun I have ever experienced
87
- -----BEGIN BITCOIN SIGNATURE-----
88
- 175A5YsPUdM71mnNCC3i8faxxYJgBonjWL
85
+ -----BEGIN BITCOIN SIGNED MESSAGE-----
86
+ ECDSA is the most fun I have ever experienced
87
+ -----BEGIN BITCOIN SIGNATURE-----
88
+ 175A5YsPUdM71mnNCC3i8faxxYJgBonjWL
89
89
90
- HyiLDcQQ1p2bKmyqM0e5oIBQtKSZds4kJQ+VbZWpr0kYA6Qkam2MlUeTr+lm1teUGHuLapfa43JjyrRqdSA0pxs=
91
- -----END BITCOIN SIGNATURE-----
90
+ HyiLDcQQ1p2bKmyqM0e5oIBQtKSZds4kJQ+VbZWpr0kYA6Qkam2MlUeTr+lm1teUGHuLapfa43JjyrRqdSA0pxs=
91
+ -----END BITCOIN SIGNATURE-----
92
92
93
- Example 4:
94
- Uncompressed private keys can't produce addresses other than 'p2pkh'
93
+ Example 4:
94
+ Uncompressed private keys can't produce addresses other than 'p2pkh'
95
95
96
- python bmt.py sign -p -m ECDSA is the most fun I have ever experienced -a 'p2wpkh' -d -v
96
+ python bmt.py sign -p -m ECDSA is the most fun I have ever experienced -a 'p2wpkh' -d -v
97
97
98
- PrivateKey(WIF): <insert private key here >
98
+ PrivateKey(WIF): <insert private key here>
99
99
100
- Output:
100
+ Output:
101
101
102
- Traceback (most recent call last):
103
- ...
104
- PrivateKeyError: ('Need WIF-compressed private key for this address type:', 'p2wpkh')
102
+ Traceback (most recent call last):
103
+ ...
104
+ PrivateKeyError: ('Need WIF-compressed private key for this address type:', 'p2wpkh')
105
105
106
- Message verification
106
+ Message verification
107
107
108
- python bmt.py verify -h
109
- usage: python3 bmt.py verify [ -h] -a ADDRESS -m [ MESSAGE ...] -s SIGNATURE [ -v] [ -r]
108
+ python bmt.py verify -h
109
+ usage: python3 bmt.py verify [-h] -a ADDRESS -m [MESSAGE ...] -s SIGNATURE [-v] [-r]
110
110
111
- options:
112
- -h, --help show this help message and exit
111
+ options:
112
+ -h, --help show this help message and exit
113
113
114
- Verify messsage:
115
- -a ADDRESS, --address ADDRESS
116
- specify bitcoin address
117
- -m [ MESSAGE ...] , --message [ MESSAGE ...]
118
- Message to verify
119
- -s SIGNATURE, --signature SIGNATURE
120
- bitcoin signature in base64 format
121
- -v, --verbose print full message
122
- -r, --recpub recover public key
114
+ Verify messsage:
115
+ -a ADDRESS, --address ADDRESS
116
+ specify bitcoin address
117
+ -m [MESSAGE ...], --message [MESSAGE ...]
118
+ Message to verify
119
+ -s SIGNATURE, --signature SIGNATURE
120
+ bitcoin signature in base64 format
121
+ -v, --verbose print full message
122
+ -r, --recpub recover public key
123
123
124
- Example 1:
125
- Standard message verification
124
+ Example 1:
125
+ Standard message verification
126
126
127
- python bmt.py verify -a 175A5YsPUdM71mnNCC3i8faxxYJgBonjWL \
128
- > -m ECDSA is the most fun I have ever experienced \
129
- > -s HyiLDcQQ1p2bKmyqM0e5oIBQtKSZds4kJQ+VbZWpr0kYA6Qkam2MlUeTr+lm1teUGHuLapfa43JjyrRqdSA0pxs=
127
+ python bmt.py verify -a 175A5YsPUdM71mnNCC3i8faxxYJgBonjWL \
128
+ > -m ECDSA is the most fun I have ever experienced \
129
+ > -s HyiLDcQQ1p2bKmyqM0e5oIBQtKSZds4kJQ+VbZWpr0kYA6Qkam2MlUeTr+lm1teUGHuLapfa43JjyrRqdSA0pxs=
130
130
131
- Output:
131
+ Output:
132
132
133
- True
133
+ True
134
134
135
- Example 2:
136
- Message verification in verbose mode
135
+ Example 2:
136
+ Message verification in verbose mode
137
137
138
- python bmt.py verify -a 175A5YsPUdM71mnNCC3i8faxxYJgBonjWL \
139
- > -m ECDSA is the most fun I have ever experienced \
140
- > -s HyiLDcQQ1p2bKmyqM0e5oIBQtKSZds4kJQ+VbZWpr0kYA6Qkam2MlUeTr+lm1teUGHuLapfa43JjyrRqdSA0pxs= \
141
- > -v
138
+ python bmt.py verify -a 175A5YsPUdM71mnNCC3i8faxxYJgBonjWL \
139
+ > -m ECDSA is the most fun I have ever experienced \
140
+ > -s HyiLDcQQ1p2bKmyqM0e5oIBQtKSZds4kJQ+VbZWpr0kYA6Qkam2MlUeTr+lm1teUGHuLapfa43JjyrRqdSA0pxs= \
141
+ > -v
142
142
143
- Output:
143
+ Output:
144
144
145
- True
146
- Message verified to be from 175A5YsPUdM71mnNCC3i8faxxYJgBonjWL
145
+ True
146
+ Message verified to be from 175A5YsPUdM71mnNCC3i8faxxYJgBonjWL
147
147
148
- Example 3:
149
- Display a recovered public key
148
+ Example 3:
149
+ Display a recovered public key
150
150
151
- python bmt.py verify -a 175A5YsPUdM71mnNCC3i8faxxYJgBonjWL \
152
- > -m ECDSA is the most fun I have ever experienced \
153
- > -s HyiLDcQQ1p2bKmyqM0e5oIBQtKSZds4kJQ+VbZWpr0kYA6Qkam2MlUeTr+lm1teUGHuLapfa43JjyrRqdSA0pxs= \
154
- > --recpub
151
+ python bmt.py verify -a 175A5YsPUdM71mnNCC3i8faxxYJgBonjWL \
152
+ > -m ECDSA is the most fun I have ever experienced \
153
+ > -s HyiLDcQQ1p2bKmyqM0e5oIBQtKSZds4kJQ+VbZWpr0kYA6Qkam2MlUeTr+lm1teUGHuLapfa43JjyrRqdSA0pxs= \
154
+ > --recpub
155
155
156
- Output:
156
+ Output:
157
157
158
- True
159
- 024aeaf55040fa16de37303d13ca1dde85f4ca9baa36e2963a27a1c0c1165fe2b1
158
+ True
159
+ 024aeaf55040fa16de37303d13ca1dde85f4ca9baa36e2963a27a1c0c1165fe2b1
160
160
161
- Example 4:
162
- Error message
161
+ Example 4:
162
+ Error message
163
163
164
- python bmt.py verify -a 175A5YsPUdM71mnNCC3i8faxxYJgBonjWL \
165
- > -m ECDSA is the most fun I have ever experienced \
166
- > -s HyiLDcQQ1p2bKmyqM0e5oIBQtKSZds4kJQ+VbZWpr0kYA6Qkam2MlUeTr+lm1teUGHuLaffa43Jj= -v -r \
164
+ python bmt.py verify -a 175A5YsPUdM71mnNCC3i8faxxYJgBonjWL \
165
+ > -m ECDSA is the most fun I have ever experienced \
166
+ > -s HyiLDcQQ1p2bKmyqM0e5oIBQtKSZds4kJQ+VbZWpr0kYA6Qkam2MlUeTr+lm1teUGHuLaffa43Jj= -v -r \
167
167
168
- Output:
168
+ Output:
169
169
170
- Traceback (most recent call last):
171
- ...
172
- SignatureError: ('Signature must be 65 bytes long:', 57)
170
+ Traceback (most recent call last):
171
+ ...
172
+ SignatureError: ('Signature must be 65 bytes long:', 57)
173
173
174
174
Contribute
175
175
----------
0 commit comments