Bitcoin Forum
August 05, 2024, 12:10:13 AM *
News: Latest Bitcoin Core release: 27.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: What does blockchain.address.listunspent exactly return?  (Read 356 times)
nathan_24 (OP)
Newbie
*
Offline Offline

Activity: 24
Merit: 3


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

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:

Code:
{"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]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!