Post
Topic
Board Development & Technical Discussion
Re: btc rpc how to get the output address
by
naufragus
on 21/11/2020, 16:35:37 UTC
If you are using Linux shell and run my script (bitcoin.tx.sh):

Code:
user@archhost ~ % bitcoin.tx.sh a64be218809b61ac67ddc7f6c7f9fbebfe420cf75fe0318ebc727f060df48b37
txs: 1/1

backing up existing result file..
renamed '/home/user/00.transactions.parsed.txt' -> '/home/user/00.transactions.parsed.txt.1605976409.bak'

--------
Transaction information
TxId____: a64be218809b61ac67ddc7f6c7f9fbebfe420cf75fe0318ebc727f060df48b37
Hash____: a64be218809b61ac67ddc7f6c7f9fbebfe420cf75fe0318ebc727f060df48b37
BlkHash_: 0000000049a63b4dda3a43450c19d085d6c28bfb4cbb2e0576815d7f31919c5d
Time____: 1233636459    2009-02-03T04:47:39Z
BlkTime_: 1233636459    2009-02-03T04:47:39Z
LockTime: 0
Version_: 1
Vsize___: 276
Size____: 276
Weight__: 1104
Confirma: 650779

Vins
  TxIndex: 131f68261e28a80c3300b048c4c51f3ca4745653ba7ad6b20cc9188322818f25
  Sequenc: 4294967295
  VoutNum: 1
  Addresses
  Number_: 1    Value__: 49.99
    type: pubkey
    1AbHNFdKJeVL8FRZyRZoiTzG9VCmzLrtvm


Vouts
  Number_: 0    Value__: 0.01
  Addresses
    type: pubkey
    1CbAopr7sNMKjsJa8dAS6P5sM788kmMooo

  Number_: 1    Value__: 49.98
  Addresses
    type: pubkey
    1AbHNFdKJeVL8FRZyRZoiTzG9VCmzLrtvm


VinSum__: 49.99000000
VoutSum_: 49.99000000
TxFee___: 0


>>>final transaction parsing at: /home/user/00.transactions.parsed.txt
>>>temporary directory removed -- /dev/shm/bitcoin.tx.sh.116526.5TZ3VjAk
>>>took 1 seconds  (0 minutes)

The script uses grondilu's bitcoin-bash-tools to make the address from the pub key..
Script from my githubh repo: https://github.com/mountaineerbr/scripts/blob/master/bitcoin.tx.sh