Author

Topic: Urgent help Finding scriptPubKey for a transaction without bitcoincore (Read 602 times)

staff
Activity: 3458
Merit: 6793
Just writing some code
You can get the raw hex of a transaction by going to blockchain.info and appending ?format=hex to the URL for the transaction. You can also go to blockcypher, look up the transaction, and click on the button for "api call" under the Advanced details section. This will give you JSON for the transaction and under the outputs section is the script for the output in hex.


In Electrum, you can go to the console and type
Code:
gettransaction("")
where is the txid. This will give you the raw hex of the transaction.

Then you can take that hex and type
Code:
deserialize(""
which will give you the decoded version of the transaction. You can chain the two commands together by doing
Code:
deserialize(gettransaction(""))
and get the decoded transaction from the txid.
newbie
Activity: 72
Merit: 0
Hi guys, I am having an issue sending bitcoin from a multisig address I made.

Before I begin, two caveats:
1. I am using raw transactions which I'm hand crafting .
2. I do not have access to a bitcoincore with blocks downloaded on it.

As I understand it I need to have the scriptPubKey for the transaction which paid into the multisig address and which I want to pay from.

Now when I send a transaction from electrum to the multisig address I can get a copy of the transaction from electrum which I can run "bitcoin-cli decoderawtransaction" on and get the scriptPublicKey so I am able to send those transactions from the multisig address no problem.

My issue arises when someone else sends my multisig address some coins, how do I get the scriptPubKey (or raw transaction in hex) for that transaction so I can redeem the coins.

I've looked all over google for a service that provides this and I've turned up nothing so I'm asking here.

Thanks for the help.
Jump to: