Author

Topic: How much blockchain required for raw transactions? (Read 1183 times)

legendary
Activity: 3710
Merit: 1586
Yes I missed that part. I thought it was optional like it says in the wiki.

It is optional (in a full client that has access to enough of the blockchain to look up the scriptPubKeys with the transaction ID and vout that was supplied with the createrawtransaction).

If you opt not to use client that has enough blockchain to look it up, then you have to provide it yourself.

Yes I understand that now. Thanks.
legendary
Activity: 3472
Merit: 4801
Yes I missed that part. I thought it was optional like it says in the wiki.

It is optional (in a full client that has access to enough of the blockchain to look up the scriptPubKeys with the transaction ID and vout that was supplied with the createrawtransaction).

If you opt not to use client that has enough blockchain to look it up, then you have to provide it yourself.
legendary
Activity: 3710
Merit: 1586
you need to get the UTXO info (scriptPubKeys) from somewhere and that is typically going to have to come from a blockchain (whether local or via say blockchain.info)

When the OP stated:

where I specify all the inputs, outputs and private keys for signing. I thought I could do this without downloading the blockchain since I was explicitly specifying the inputs.

I assumed that the OP was planning on supplying the scriptPubKeys in the signrawtransaction command:

As specified in the API:

https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list



Yes I missed that part. I thought it was optional like it says in the wiki.
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
I assumed that the OP was planning on supplying the scriptPubKeys in the signrawtransaction command:

Seems more likely that he doesn't have the scriptPubKeys (maybe he didn't follow that part of the "signrawtransaction").
legendary
Activity: 3472
Merit: 4801
you need to get the UTXO info (scriptPubKeys) from somewhere and that is typically going to have to come from a blockchain (whether local or via say blockchain.info)

When the OP stated:

where I specify all the inputs, outputs and private keys for signing. I thought I could do this without downloading the blockchain since I was explicitly specifying the inputs.

I assumed that the OP was planning on supplying the scriptPubKeys in the signrawtransaction command:

As specified in the API:

https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list

legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
Well it's not working for me. I've tried it both after importing the private key and by specifying it as the third argument of signrawtransaction. If I have the blockchain it will do it but not without it.

I am guessing that you are missing the scriptPubKey parts of the UTXO's used as inputs (which you normally would get from the blockchain).

Have a play with this: http://ciyam.org/rawtx_helper.html (and don't worry it doesn't ask or want private keys).

You can find each UTXO's scriptPubKey through blockchain.info (starting with an address then click on a transaction with an unspent output and click the "Show scripts & coinbase" link - the scriptPubKeys will appear at the bottom left of the page).

It seems my first reply was not clear so let me just expand the steps to create, sign and send a raw tx as I do it with CIYAM Safe:

1) Find your UTXO information (you can do this using "listunspent" via bitcoind with a blockchain or using blockchain.info).
2) Select the destination address(es) and amount(s).
3) Issue the "createrawtransaction" command.
4) Add the scriptPubKey(s) to the rawtransaction in order to create the "signrawtransaction" command.
5) Issue the "signrawtransaction" command (this part requires the private keys to either be in the wallet or explicitly included).
6) Send the raw tx via "sendrawtransaction" (perhaps you might want to do a "decoderawtransaction" first to double check it).

You are needing blockchain information to get the UTXO information (txid, vout and scriptPubKey) but you do not need a blockchain to issue any of the raw tx commands themselves.
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
Uh. No. Thats absolutely not true. If you provide the required information (including scriptpubkeys for the inputs) you can sign transactions without a blockchain at all.

I think you misunderstood my point (which I probably didn't make very well) - you need to get the UTXO info (scriptPubKeys) from somewhere and that is typically going to have to come from a blockchain (whether local or via say blockchain.info) - I never meant that you need a blockchain to *sign* a raw transaction (as CIYAM Safe does not use a blockchain at all).

What I was getting at in regards to upcoming versions of bitcoind was the SPV support.
legendary
Activity: 3472
Merit: 4801
If you provide the required information (including scriptpubkeys for the inputs) you can sign transactions without a blockchain at all.

That's what I thought.  Thanks.
staff
Activity: 4284
Merit: 8808
With the way that bitcoind works currently you will have to have the entire blockchain (it doesn't let you do otherwise).
Uh. No. Thats absolutely not true. If you provide the required information (including scriptpubkeys for the inputs) you can sign transactions without a blockchain at all.
legendary
Activity: 1001
Merit: 1005
Blockchain is not needed. There is a demo site here that allows you to create (and broadcast) a raw transaction.

https://spendcoins.cfapps.io

(of course, it needs private key, so be aware of risks!)
legendary
Activity: 3710
Merit: 1586
The CIYAM Safe does the "signrawtransaction" with no blockchain (and I've used it many times).

All you need to do a "signrawtransaction" is the unsigned raw tx and the keys in the wallet (so use "importprivkey").

The "signrawtransaction" will not create a "complete" tx unless it has all the required private keys.

Well it's not working for me. I've tried it both after importing the private key and by specifying it as the third argument of signrawtransaction. If I have the blockchain it will do it but not without it.

Which version if bitcoind are you using in CIYAM Safe? I am using the 0.8.5 version.
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
The CIYAM Safe does the "signrawtransaction" with no blockchain (and I've used it many times).

All you need to do a "signrawtransaction" is the unsigned raw tx and the keys in the wallet (so use "importprivkey").

The "signrawtransaction" will not create a "complete" tx unless it has all the required private keys. All the UTXO information is contained in the raw tx from "createrawtransaction" (thus it is the "missing link" here).

legendary
Activity: 3710
Merit: 1586
They also lack signrawtransaction which I'd like to have too. I've sent in the request. Please do the same when you get a chance.

The "signrawtransaction" should probably not be made available as it would require them to have your private keys. You can do the "signrawtransaction" without needing a blockchain though so although you'd still need bitcoind it does make things much simpler (such as having the signing occur on a completely offline computer as I do with CIYAM Safe).

For my use case the private key has effectively stopped being private so sending it to bci for signing is not a big deal.

Anyway if you know of a way to sign a transaction without the blockchain I'd love to know? Right now createrawtransaction is working without the chain but not the signing part. signrawtransaction is returning an empty "complete" value (empty, not even 0).
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
They also lack signrawtransaction which I'd like to have too. I've sent in the request. Please do the same when you get a chance.

The "signrawtransaction" should probably not be made available as it would require them to have your private keys. You can do the "signrawtransaction" without needing a blockchain though so although you'd still need bitcoind it does make things much simpler (such as having the signing occur on a completely offline computer as I do with CIYAM Safe).

I will make the request about "createrawtransaction" to piuk shortly.
legendary
Activity: 3710
Merit: 1586
I too would love to see bci implement raw transactions. But until then I either have to run bitcoind or use Vitalik's script.

They do have the APIs decode-tx and pushtx but just lack the create-tx one (if you want to send piuk a PM about that then I will do the same).


They also lack signrawtransaction which I'd like to have too. I've sent in the request. Please do the same when you get a chance.
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
I too would love to see bci implement raw transactions. But until then I either have to run bitcoind or use Vitalik's script.

They do have the APIs decode-tx and pushtx but just lack the create-tx one (if you want to send piuk a PM about that then I will do the same).
legendary
Activity: 3710
Merit: 1586
Ok thanks. You are right about having the txs you want to spend locally (even though I am specifying them explicitly). I may be able to manage that much of the chain.

I too would love to see bci implement raw transactions. But until then I either have to run bitcoind or use Vitalik's script.
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
The CIYAM Safe (http://susestudio.com/a/kp8B3G/ciyam-safe) uses the no blockchain approach with bitcoind (I would love blockchain.info to add a "createrawtransaction" API so I could streamline it).
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
With the way that bitcoind works currently you will have to have the entire blockchain (it doesn't let you do otherwise).

I think this will be changing in future versions - at a minimum you would need the tx's for each UTXO you want to use as an "input" for your tx.

If blockchain.info supported a "createrawtransaction" API then it would be much easier (you wouldn't need the blockchain at all - just the private keys to sign the raw transaction).
legendary
Activity: 3710
Merit: 1586
I want to use bitcoind for one very specific purpose: create and sign raw transactions where I specify all the inputs, outputs and private keys for signing. I thought I could do this without downloading the blockchain since I was explicitly specifying the inputs. But it doesn't work. So how much of the chain is required to be able to do this?



Jump to: