How to get sender bitcoin address from transaction ID

0 votes

I am using coinpayment.net payment API for my project now.

Here is an example bitcoin transaction. https://www.blockchain.com/btc/tx/25ecdc29903aa8f80efb51a6b41ac036a91fe441aefd0d26df383827b9578cae

Here is transactionID is 25ecdc29903aa8f80efb51a6b41ac036a91fe441aefd0d26df383827b9578cae.

Sender address is bc1q3q2jw046t888slq9rrg6ypwfna7ellkxh0ytss

I want to get this sender address by programming with TxID.

If you have got any solution or API, please let me know.

I have checked coinpayments.net API, but they don't provide the sender address somehow in the webhook endpoint. So, I am trying to find out this by external API or any solution.

The purpose of this is that I want to send some BTC to the sender again every month without asking to withdraw addresses to every customer.

Apr 6, 2022 in Blockchain by Soham
• 9,730 points
3,942 views

1 answer to this question.

0 votes

 You can use any scripting language with JSON support like perl, Javascipt or Python or use command line tool like jq:

curl -s https://blockchain.info/tx/25ecdc29903aa8f80efb51a6b41ac036a91fe441aefd0d26df383827b9578cae\?format\=json | jq '.inputs[0]."prev_out".addr'

to get familiar with jq use https://jqplay.org/

You can get a better understanding with the Blockchain development course.

answered Apr 12, 2022 by Rahul
• 9,690 points

Related Questions In Blockchain

0 votes
1 answer