Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: Muhammed Zakir on October 25, 2014, 11:42:21 AM



Title: How to create a raw unsigned transaction?
Post by: Muhammed Zakir on October 25, 2014, 11:42:21 AM
Hello! It is very hard for me to connect my computer to internet, I access from another computer which isn't really secure. So to send a tx, I am planning to do like this:
  • Create a raw unsigned transaction.
  • Sign it using Armory offline wallet.
  • Then push it through blockchain.info or btc.blockr.io.
To copy the raw tx, I use a mobile or I type by hand. This isn't really important here but to avoid questions about this, I just mentioned.

Suggestions are welcome! :)

   ~~MZ~~


Title: Re: How to create a raw unsigned transaction?
Post by: shorena on October 25, 2014, 12:43:57 PM
I made a few to play around with feeless TXs with bitcoin core. This "guide" [1] by gavin helped a lot. IIRC one of the commands is now called slightly different. The downside for your case would be that the online computer would need to sync the blockchain first, which might take some time depending how ofter you use it. AFAIK electrum supports watch only wallets and should thus be able to make a raw unsigned TX, but I have never tried it.


[1] https://gist.github.com/gavinandresen/2839617 - Edit: sendrawtx is actually sendrawtransaction, which isnt important if you want to send via bc.i or blockr


Title: Re: How to create a raw unsigned transaction?
Post by: Muhammed Zakir on October 25, 2014, 05:33:52 PM
I made a few to play around with feeless TXs with bitcoin core. This "guide" [1] by gavin helped a lot. IIRC one of the commands is now called slightly different.

[1] https://gist.github.com/gavinandresen/2839617

I read it just before I post here, if I am right. And, this too : https://people.xiph.org/~greg/signdemo.txt ;)

The downside for your case would be that the online computer would need to sync the blockchain first, which might take some time depending how ofter you use it.

That's the problem here, I can only use it for a few hours + internet speed is terrible low - ~60 KB/s . :(

AFAIK electrum supports watch only wallets and should thus be able to make a raw unsigned TX, but I have never tried it.

Thanks! :) I will try it and will give a feedback! I know electrum uses a dedicated server for syncing but do you know approx. time it will take(address was generated this year)?


Any alternative way? Is there any possible way to create a unsigned raw tx without syncing? I tried brainwallet.github.io/#tx but it can only be used for signing/re-signing and if needed, pushing though it downloads unspent tx(s) using Blockchain.info API. Can I create a raw tx using *non-synced Bitcoin-qt* if I know unspent tx(s) using createrawtransaction [{"txid":txid,"vout":n],...] {address:amount,...} ? ???

   ~~MZ~~


Title: Re: How to create a raw unsigned transaction?
Post by: dserrano5 on October 25, 2014, 06:42:29 PM
Can I create a raw tx using *non-synced Bitcoin-qt* if I know unspent tx(s) using createrawtransaction [{"txid":txid,"vout":n],...] {address:amount,...} ? ???

I don't have a non-synced bitcoin core handy but I'd expect this to fail if there were some validations in place:

Code:
bitcoin-cli createrawtransaction '[{"txid":"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","vout":42}]', '{"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa":1234567.89}'
0100000001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff2a00000000ffffffff0140af0d86487000001976a91462e907b15cbf27d5425399ebf6f0fb50ebb88f1888ac00000000

It decodes fine:

Code:
bitcoin-cli decoderawtransaction 0100000001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff2a00000000ffffffff0140af0d86487000001976a91462e907b15cbf27d5425399ebf6f0fb50ebb88f1888ac00000000
{
    "txid" : "a634540f411354f449960c8b8b33ca7b3fda6002e75febb30b3759a6d6f13958",
    "version" : 1,
    "locktime" : 0,
    "vin" : [
        {
            "txid" : "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
            "vout" : 42,
            "scriptSig" : {
                "asm" : "",
                "hex" : ""
            },
            "sequence" : 4294967295
        }
    ],
    "vout" : [
        {
            "value" : 1234567.89000000,
            "n" : 0,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 62e907b15cbf27d5425399ebf6f0fb50ebb88f18 OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a91462e907b15cbf27d5425399ebf6f0fb50ebb88f1888ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
                ]
            }
        }
    ]
}

So I guess you can create any transaction you want without syncing.


Title: Re: How to create a raw unsigned transaction?
Post by: shorena on October 25, 2014, 06:58:00 PM
-snip-

So I guess you can create any transaction you want without syncing.

Neat, I had a way more complicated way of testing in my head.

-snip-

Thanks! :) I will try it and will give a feedback! I know electrum uses a dedicated server for syncing but do you know approx. time it will take(address was generated this year)?


Electrum syncs very fast for me, but I only every used it for LTC and I usually have a stable and fast connection, so your results might be different ;)

Any alternative way? Is there any possible way to create a unsigned raw tx without syncing? I tried brainwallet.github.io/#tx but it can only be used for signing/re-signing and if needed, pushing though it downloads unspent tx(s) using Blockchain.info API. Can I create a raw tx using *non-synced Bitcoin-qt* if I know unspent tx(s) using createrawtransaction [{"txid":txid,"vout":n],...] {address:amount,...} ? ???

   ~~MZ~~

You could probably write your own client or script to create a TX. hmmm I might try that...


Title: Re: How to create a raw unsigned transaction?
Post by: Muhammed Zakir on October 26, 2014, 04:33:17 AM

 =snip=

So I guess you can create any transaction you want without syncing.

I will try that too! Thanks!

Electrum syncs very fast for me, but I only every used it for LTC and I usually have a stable and fast connection, so your results might be different ;)

;D

You could probably write your own client or script to create a TX. hmmm I might try that...

I am just studying the languages now. So it may take a long time to write it. Anyway, if I do, I will post it! ;)

   ~~MZ~~


Title: Re: How to create a raw unsigned transaction?
Post by: Muhammed Zakir on October 27, 2014, 04:33:23 PM
I tried electrum but it only supports watch-only-mode of another electrum wallet(seed). So it won't work for me as I can't sweep private key, it will cause a big head ache. ::) Armory doesn't support compressed private keys. I will now use bitcoin-qt... :) Thanks for all the help! :)

   ~~MZ~~


Title: Re: How to create a raw unsigned transaction?
Post by: Muhammed Zakir on November 02, 2014, 03:32:44 AM
When I create rawtx, it is showing errors. Need help! :(

Edit: Now I tried once more and it worked. I don't know why it didn't work yesterday, typed same thing, maybe some mistakes. ::)

   ~~MZ~~