<blockquote>
  <p>before having sent A, can i get the transaction ID of A?</p>
</blockquote>

<p>Yes, you can calculate the TXID without any connection to the network. </p>

<blockquote>
  <p>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?</p>
</blockquote>

<p>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. </p>

<p>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. </p>

<blockquote>
  <p>is possible, and I send A, then immediately send B to the bitcoin network. what would happen?</p>
</blockquote>

<p>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.</p>

CC BY-SA 3.0
2013-12-10T13:43:55.040Z
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
CC BY-SA 3.0
2013-12-10T13:51:32.657Z
My mistake entirely, I've updated the answer to match.
Anonymous
CC BY-SA 3.0
2013-12-10T13:55:01.560Z
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
CC BY-SA 3.0
2013-12-10T14:01:39.177Z
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, http://testnet.btclook.com/ is good for watching them in real time. It's quite a good playground for testing behaviour like this.
Anonymous
CC BY-SA 3.0
2013-12-10T11:39:32.843Z
2013-12-10T13:51:28.500Z
2013-12-10T13:51:28.500Z
Anonymous
<p>let's say i create a valid transaction (offline without sending it, such as like this: <a href="http://brainwallet.org/#tx" rel="nofollow">http://brainwallet.org/#tx</a>. let's call this "A"</p>

<p>a)before having sent A, can i get the transaction ID of A?</p>

<p>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.</p>

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

<transactions><offline>
get offline Bitcoin transaction id, chain multiple offline transactions
user10557
# get offline Bitcoin transaction id, chain multiple offline transactions

(Asked by: username_0 on 2013-12-10)

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?

**Tags:** transactions, offline


---

## 1 answers

### Answer by username_1 on 2013-12-10. Score: 1 | Accepted answer

> 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.

> **Comments:**
> **username_0**: 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  
> **username_1**: My mistake entirely, I've updated the answer to match.  
> **username_0**: 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?  
> **username_1**: 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, http://testnet.btclook.com/ is good for watching them in real time. It's quite a good playground for testing behaviour like this.  

---

