<p>In the process of opening a micropayment channel, the two parties put funds into a lock-box of sorts that requires both parties to sign off any any withdrawals from that lockbox. In the blockchain, this is essentially putting some funds into a 2-of-2 multisig output, where the 2 keys are Alice and Bob's keys. If only Bob is going to be transferring money to Alice or vice versa (unidirectional), then only one person need put funds into the 2-of-2 lock box.</p>

<p>Then, when it comes time for Bob to pay Alice, Bob gives Alice a transaction that spends the contents of the lock box, giving Alice some amount of the lock box funds and using a change output that puts the change back into the lockbox. Since withdrawing from the lock box requires both Alice and Bob to sign off, Alice can confirm when Bob has signed off to give her funds.</p>

<p>Notice that it has to be this way, requiring both Alice and Bob to transfer funds through the channel, because if it just required the sender of the funds, you run into the exact problem you mentioned: the sender could be trying to double spend those funds and you wouldn't know.</p>

CC BY-SA 3.0
2015-12-04T19:33:05.837Z
Ok but what about at the time they put money into the lockbox, because that multisig doesn't go through the normal transaction verification process, how do we know that when they first created the lockbox, they had money that was not spent elsewhere?
nbz
CC BY-SA 3.0
2015-12-04T19:35:02.333Z
The transaction that creates the lockbox does actually go through the normal verification process, which can take a while to get enough confirmations to be considered secure.
morsecoder
CC BY-SA 3.0
2015-12-05T18:36:02.933Z
oh I see so the multisig gets confirmations as well....
nbz
CC BY-SA 3.0
2015-12-04T18:10:08.867Z
2015-12-04T19:10:59.507Z
2015-12-04T19:10:59.507Z
morsecoder
<p>Let's say Alice opens a micropayment channel with Bob and sends $10 into the multi sig transaction.</p>

<p>How do we know that Alice has those $10? Or are we taking the risk of her double spending it?</p>

CC BY-SA 3.0
2015-12-04T20:52:42.057Z
Same as any other transaction, you wait until it has sufficient confirmations and then you know that that transaction's rules will control how its funds are spent.
David Schwartz
<bitcoinj><micropaymentchannels>
How is a transaction verified in a micropayment channel?
nbz
# How is a transaction verified in a micropayment channel?

(Asked by: username_0 on 2015-12-04)

Let's say Alice opens a micropayment channel with Bob and sends $10 into the multi sig transaction.

How do we know that Alice has those $10? Or are we taking the risk of her double spending it?

**Tags:** bitcoinj, micropaymentchannels

> **Comments:**
> **username_1**: Same as any other transaction, you wait until it has sufficient confirmations and then you know that that transaction's rules will control how its funds are spent.  

---

## 1 answers

### Answer by username_2 on 2015-12-04. Score: 1 | Accepted answer

In the process of opening a micropayment channel, the two parties put funds into a lock-box of sorts that requires both parties to sign off any any withdrawals from that lockbox. In the blockchain, this is essentially putting some funds into a 2-of-2 multisig output, where the 2 keys are Alice and Bob's keys. If only Bob is going to be transferring money to Alice or vice versa (unidirectional), then only one person need put funds into the 2-of-2 lock box.

Then, when it comes time for Bob to pay Alice, Bob gives Alice a transaction that spends the contents of the lock box, giving Alice some amount of the lock box funds and using a change output that puts the change back into the lockbox. Since withdrawing from the lock box requires both Alice and Bob to sign off, Alice can confirm when Bob has signed off to give her funds.

Notice that it has to be this way, requiring both Alice and Bob to transfer funds through the channel, because if it just required the sender of the funds, you run into the exact problem you mentioned: the sender could be trying to double spend those funds and you wouldn't know.

> **Comments:**
> **username_0**: Ok but what about at the time they put money into the lockbox, because that multisig doesn't go through the normal transaction verification process, how do we know that when they first created the lockbox, they had money that was not spent elsewhere?  
> **username_2**: The transaction that creates the lockbox does actually go through the normal verification process, which can take a while to get enough confirmations to be considered secure.  
> **username_0**: oh I see so the multisig gets confirmations as well....  

---

