2

let's say i create a valid transaction (offline without sending it, such as like this: http://brainwallet.org/#tx. let's call this "A"

a)before having sent A, can i get the transaction ID of A?

b)I wish to create a new offline Transaction (called B), using the outputs from A as inputs for B.Still, A has not been sent to the bitcoin network. Is this possible? For example, A sends money from account x to account y. B sends the same bitcoins sent from x to y, from y to z.

c) if part b) is possible, and I send A, then immediately send B to the bitcoin network. what would happen?

1

before having sent A, can i get the transaction ID of A?

Yes, you can calculate the TXID without any connection to the network.

I wish to create a new offline Transaction (called B), using the outputs from A as inputs for B.Still, A has not been sent to the bitcoin network. Is this possible?

Yes, but there's a small technicality when working with nested unconfirmed transactions. If you build a large number of them on top of each other, and one of them is never confirmed, then the entire chain of transactions will disappear. That is to say, if you build A, B, and C, and A had an incorrect fee, none of the subsequent transactions will ever confirm and will eventually drop from the network.

That being said there's nothing stopping you from making chains of infinite lengths, they just have to be broadcast in order for the nodes to be able to see the previous inputs. If you make them out of order (C, A, B) they will likely be rejected.

is possible, and I send A, then immediately send B to the bitcoin network. what would happen?

This is completely valid and a reasonably normal flow for some applications, it's not invalid or unrecommended if the fees for each input are properly paid.

  • Apologies. My original question made it seem as though I was asking if I could double-spend the same bitcoins, from the same account. I rephrased my original question b). For example: account x has 1 BTC. account y has 0 BTC. can i create offline transactions sending the 1 BTC from x to Y (transaction A). at the same time, create an offline transaction sending 1 BTC from y to z (the same 1 BTC from transaction A). and then send those both to the network. A, then B, but very fast – user10557 Dec 10 '13 at 13:43
  • My mistake entirely, I've updated the answer to match. – Anonymous Dec 10 '13 at 13:51
  • Let's say I submitted them in reverse order, but still in rapid succession. Would they still somehow "float around" long enough to get chained together. I guess my question is: roughly speaking, is a small time frame difference a cause for preventing chains of transactions from being processed? – user10557 Dec 10 '13 at 13:55
  • I wouldn't bet on that working, it might due to pure luck with the latency between nodes causing some of them to accept the chain, but it's most certainly something you don't want to rely upon. If you submit B and a node hasn't heard of A, then the node will reject it as B is trying to spend an output that doesn't exist to it yet. You can have a play with this on the testnet, if you're submitting the chain too fast you just won't see it on other nodes, testnet.btclook.com is good for watching them in real time. It's quite a good playground for testing behaviour like this. – Anonymous Dec 10 '13 at 14:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.