Following this post, I am trying to access all transactions within the #630873 block in the bitcoin blockchain.
import requestsr = requests.get('https://blockchain.info/block-height/630873?format=json')
data = r.json()
When inspecting the (0-indexed) 4th transaction within this block (via data['blocks'][0]['tx'][4]['out']
), I get this:
[{'n': 0,'script': '0014d0aba2c93bac0fcafafe43f2ad39d664ba51910d','spent': False,'tx_index': 0,'type': 0,'value': 19571491},{'addr': '1A7tWftaGHohhGcJMVkkm4zAYnF53KjRnU','n': 1,'script': '76a9146406a0a47d4ed716f6ddf2eeca20c725932763f188ac','spending_outpoints': [{'n': 0, 'tx_index': 0}],'spent': True,'tx_index': 0,'type': 0,'value': 3928145371}]
Only the addr
of the second recipient of this transaction is included. On the blockchain.com website this transaction looks like:
The bc1q6z469jfm4s8u47h7g0e26wwkvja9rygdqpeykd
address is visible there. How to access it through the API?
The unaccessible address has BECH32
format, while the accessible one has BASE58
(which information I get by clicking on the address on the website). Those transactions which I was able to retrieve the reciepient address, had BASE58
format.
Link to the block I am talking about..