-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsign.py
25 lines (17 loc) · 1.21 KB
/
sign.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# -*- coding: utf-8 -*-
from bitcoin.transaction import signall, deserialize
def sign_tx(tx, priv):
tx = signall(tx, priv)
return tx
if __name__ == "__main__":
import sys
args = sys.argv
tx = sign_tx(args[1], args[2])
print "签名后的tx:"
print "-----" * 30
print tx
print "####" * 30
# demo
"""
python sign.py 0100000008ff042f0457a99613ed034f5e9e7cef893eb1b8a6ef251a038d531fccdc9664ea0000000000ffffffff84c5ebfa6fc3f270f86733f0ea070da5232f4a35f161ce987ab807dcb9f881b50000000000ffffffffe1653f145f430703fd05829e6e03913bbc3f55ccf068a49f80a36685bf5309720000000000fffffffffd7c16da449588224fc40f9e75a12857183bee594df47e4600725d35ee34bfb70000000000fffffffffd9fdcffca7f3345949ab01d131eb5362b890bece8abd1b88a16632555f72e1b0000000000ffffffffa8b85b635371ce42131f67a9ba0201cc711db5ef9f1ae3e26c957e851d772c960000000000ffffffff473ca23e17d805c5434ab4e2e694a44d046e0a2e41b42dfa6b70a9b908f0ece00000000000ffffffffa4b1ed0b747587884af16eed29af9bd29639f7d640a1827661499f9c68ecea220000000000ffffffff0200e40b54020000001976a914e314a5c994280c29b3123e5af2c5f0bd5fe6d3b388ac7bf89b22000000001976a914536ffa992491508dca0354e52f32a3a7a679a53a88ac00000000 57c617d9b4e1f7af6ec97ca2ff57e94a28279a7eedd4d12a99fa11170e94f5a4
"""