Bitcoin Forum
July 23, 2018, 12:07:22 PM *
News: Latest stable version of Bitcoin Core: 0.16.1  [Torrent]. (New!)
   Home   Help Search Donate Login Register  
Pages: [1]
Author Topic: What does blockchain.address.listunspent exactly return?  (Read 269 times)
Offline Offline

Activity: 24
Merit: 0

View Profile
November 02, 2015, 01:05:11 PM

I am building a simple application that allows user to create and broadcast spend transaction by providing a private key to get funds from and a BTC address to send those funds to.

The application first calculates the BTC address of that private key and then performs a request to a electrum server:

{"id": 0, "method":"blockchain.address.listunspent","params":["1addresshere1fk29ka3"]}

The problem is, this only returns a list of [transaction hash, output position, value in satoshis, position in blockchain] for every output. But it doesn't contain the script of that output.

Is it safe to assume that every output script is going to be the standard pay-to-hash  '76a914' + addr_hash + '88ac' ??

Or do I have to perform another request asking for the raw of all the provided transaction hashes and check that the specific outputs are actually a standard pay-to-hash?

Will blockchain.address.listunspent only provide outputs with pay-to-hash scripts? Will it provide outputs with other kind of scripts such us multisig? Even if its a 1 of 2 keys and you have 1 of them?

And another question, blockchain.address.getbalance, does this also only give the total balance of pay-to-hash scripts? Or does it also add the multisig scripts?

And a final question, will blockchain.address.listunspent return the ouputs that were spent in an already broadcasted transaction that is not yet added in the blockchain?

Sorry for asking this question but it is kind of hard to find a good documentation of the electrum protocol.
Pages: [1]
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!