<p>The blockchain does not contain yet-to-be-published transactions to publish them based on conditions.  The blockchain is the structure that transactions are published <em>to</em>.  There is no such thing as a "pre-loaded transaction" that can be "released".  Either <code>A</code> (Alice) or <code>B</code> (Bob) has to publish it.</p>

<p>What Alice <em>can</em> do is give Bob a pre-signed transaction that spends an output from a transaction from Bob that has not been published yet.  This way, when Bob publishes his transaction, he can now publish the pre-signed transaction from Alice, but can't publish it beforehand.  This requires more coordination that I believe you are looking for, but it's possible.  It would go like this:</p>

<ol>
<li>Bob creates a transaction, B<sub>1</sub>, with an output to Alice, but does not sign nor publish it.</li>
<li>Bob sends Alice B<sub>1</sub>, still unsigned.</li>
<li>Alice uses the output on B<sub>1</sub> as an input on her own transaction, A<sub>1</sub>.  This transaction has an output that pays to Bob.</li>
<li>Alice signs A<sub>1</sub>, but can't publish it because it spends the still unpublished B<sub>1</sub>.  Instead, she sends the signed A<sub>1</sub> to Bob.</li>
<li>Alice can now go offline, as her part is complete.</li>
<li>Bob, now in possession of a signed A<sub>1</sub>, signs and publishes B<sub>1</sub> to the network.</li>
<li>With B<sub>1</sub> now published, A<sub>1</sub> is now a valid transaction, and Bob publishes it as well.</li>
</ol>

<p>Again, I don't think this is exactly what you are looking for, but I don't think what you are looking for is possible.  Smart contracts generally require sending transactions back and forth before publishing to the blockchain.  You really can't have a smart contract with someone with whom you've never communicated.  The up-front communication is the contract part, and publishing to the blockchain is more like resolving the contract.</p>

CC BY-SA 3.0
2016-06-14T16:15:04.733Z
2016-06-14T16:15:04.733Z
Jestin
<p>I'm not sure whether this was what you meant or not, but at Bitcoin 2014 I saw a prototype for NFC payments.</p>

<p>The <code>payer</code> was offline and using his smartphone to create a transaction, which he then directly sent to the <code>recipient</code> via Near Field Communication. Since it is a valid transaction, it doesn't matter who transmits it to the network, and therefore the <code>recipient</code> could just submit it instead of the <code>payer</code>.</p>

<p>That way, the <code>recipient</code> would get paid, even though the <code>sender</code> was and remained offline.</p>

CC BY-SA 3.0
2016-06-14T14:58:53.693Z
2016-06-14T15:06:37.563Z
2016-06-14T15:06:37.563Z
Murch
<p>Is there some way in which <code>User A</code> who could load a transaction onto the block chain and if some other <code>User B</code> who is willing to pay <code>User A</code>, without <code>User A</code> being online could release the loaded transaction. Something like  a <code>smart contract</code> ?</p>

<p>Lets say if <code>A</code> and <code>B</code> wants to exchange some bitcoin transactions between each other. But they 
both dont know each other before. <code>A</code> list his address some where and when <code>B</code> sees it, <code>B</code> will 
issue a bitcoin transaction to <code>A</code>.  </p>

<p><code>A</code> might not be online when <code>B</code> has issued this transaction. But <code>B</code> should receive back a
transaction from <code>A</code>, if <code>B</code> has payed to <code>A</code>'s address.  How's it possible ?</p>

CC BY-SA 3.0
2016-06-14T14:55:49.117Z
So, `B` wants to pay `A`. `B` is online, but `A` is not? Or did you mistype and `B` is the one that is offline?
Murch
CC BY-SA 3.0
2016-06-14T14:58:26.607Z
`B` is online, but `A` is not, `A` has already loaded a transaction onto the `blockchain`. And if some one is willing to pay to `A`, the pre-loaded transaction should be released.
jgm
CC BY-SA 3.0
2016-06-14T15:01:00.880Z
So, `B` would pay, and then the transaction of `A` would be released? That doesn't make sense to me.
Murch
CC BY-SA 3.0
2016-06-14T15:11:36.407Z
@Murch please find the updated question.
jgm
<transactions><blockchain><smartcontracts>
Issue transaction without being online
jgm
# Issue transaction without being online

(Asked by: username_0 on 2016-06-14)

Is there some way in which `User A` who could load a transaction onto the block chain and if some other `User B` who is willing to pay `User A`, without `User A` being online could release the loaded transaction. Something like a `smart contract` ?

Lets say if `A` and `B` wants to exchange some bitcoin transactions between each other. But they
both dont know each other before. `A` list his address some where and when `B` sees it, `B` will
issue a bitcoin transaction to `A`.

`A` might not be online when `B` has issued this transaction. But `B` should receive back a
transaction from `A`, if `B` has payed to `A`'s address. How's it possible ?

**Tags:** transactions, blockchain, smartcontracts

> **Comments:**
> **username_1**: So, `B` wants to pay `A`. `B` is online, but `A` is not? Or did you mistype and `B` is the one that is offline?  
> **username_0**: `B` is online, but `A` is not, `A` has already loaded a transaction onto the `blockchain`. And if some one is willing to pay to `A`, the pre-loaded transaction should be released.  
> **username_1**: So, `B` would pay, and then the transaction of `A` would be released? That doesn't make sense to me.  
> **username_0**: @username_1 please find the updated question.  

---

## 2 answers

### Answer by username_2 on 2016-06-14. Score: 2

The blockchain does not contain yet-to-be-published transactions to publish them based on conditions. The blockchain is the structure that transactions are published *to*. There is no such thing as a "pre-loaded transaction" that can be "released". Either `A` (Alice) or `B` (Bob) has to publish it.

What Alice *can* do is give Bob a pre-signed transaction that spends an output from a transaction from Bob that has not been published yet. This way, when Bob publishes his transaction, he can now publish the pre-signed transaction from Alice, but can't publish it beforehand. This requires more coordination that I believe you are looking for, but it's possible. It would go like this:

1. Bob creates a transaction, B1, with an output to Alice, but does not sign nor publish it.
2. Bob sends Alice B1, still unsigned.
3. Alice uses the output on B1 as an input on her own transaction, A1. This transaction has an output that pays to Bob.
4. Alice signs A1, but can't publish it because it spends the still unpublished B1. Instead, she sends the signed A1 to Bob.
5. Alice can now go offline, as her part is complete.
6. Bob, now in possession of a signed A1, signs and publishes B1 to the network.
7. With B1 now published, A1 is now a valid transaction, and Bob publishes it as well.

Again, I don't think this is exactly what you are looking for, but I don't think what you are looking for is possible. Smart contracts generally require sending transactions back and forth before publishing to the blockchain. You really can't have a smart contract with someone with whom you've never communicated. The up-front communication is the contract part, and publishing to the blockchain is more like resolving the contract.


---

### Answer by username_1 on 2016-06-14. Score: 1

I'm not sure whether this was what you meant or not, but at Bitcoin 2014 I saw a prototype for NFC payments.

The `payer` was offline and using his smartphone to create a transaction, which he then directly sent to the `recipient` via Near Field Communication. Since it is a valid transaction, it doesn't matter who transmits it to the network, and therefore the `recipient` could just submit it instead of the `payer`.

That way, the `recipient` would get paid, even though the `sender` was and remained offline.


---

