2016-02-05 02:52:15 +00:00
|
|
|
from bitcoin.rpc import RawProxy
|
|
|
|
|
|
|
|
p = RawProxy()
|
|
|
|
|
|
|
|
# Alice's transaction ID
|
2023-02-05 17:02:41 +00:00
|
|
|
txid = "466200308696215bbc949d5141a49a4138ecdfdfaa2a8029c1f9bcecd1f96177"
|
2016-02-05 02:52:15 +00:00
|
|
|
|
|
|
|
# First, retrieve the raw transaction in hex
|
|
|
|
raw_tx = p.getrawtransaction(txid)
|
|
|
|
|
|
|
|
# Decode the transaction hex into a JSON object
|
|
|
|
decoded_tx = p.decoderawtransaction(raw_tx)
|
|
|
|
|
|
|
|
# Retrieve each of the outputs from the transaction
|
|
|
|
for output in decoded_tx['vout']:
|
2023-02-05 17:02:41 +00:00
|
|
|
print(output['scriptPubKey']['address'], output['value'])
|