1

I've searched in vain, but not been able to find a detailed explanation of how off-chain transactions work.

  1. If I have some BTC on the public blockchain and I want to transfer some of it to someone's wallet off-chain (e.g. we're both using Coinbase) what actually happens? Do I first need to transfer some BTC to a public bitcoin address owned by the wallet provider? This would be akin to Ripple's gateway model I think. If I didn't do this I could double spend (1 tx off-chain and another on-chain), right?

  2. How do I get back on-chain? Is it simply that (assuming I'm correct above) the wallet provider knows my balance off-chain and will make a transfer to my address on-chain?

6

Coins don't really move "off-chain", in the described case you would send money to an address at Coinbase that is associated with your friend's account. As Coinbase manages their customers' accounts for them, he would see on his account page that his balance increased, but he wouldn't be in control of the private key associated with the address.

Now to "move coins off-chain", means that only the accounted values were updated, while no coins actually moved on the blockchain. Just as if a bank is wiring money from one of their own customers to another own customer, they wouldn't take the money from the vault then put it back, no they would just update the two accounts involved.

In the case of Coinbase it would work like this:

1) Coinbase internal accounting:
rageofreason: 1BTC
friend: 0.5BTC

2) rageofreason sends friend 0.4BTC

3) Coinbase internal accounting:
rageofreason: 0.6BTC
friend: 0.9BTC

They just update the accounts, no actual bitcoins were moved. Now, when friend closes his Coinbase account he will want them to send the 0.9BTC to an address directly under his control. That moment, bitcoins will move on the chain, as they actually need to be moved to that address instead of just updating balances in the internal accounting of Coinbase.

3

Do I first need to transfer some BTC to a public bitcoin address owned by the wallet provider?

Yes.

Is it simply that (assuming I'm correct above) the wallet provider knows my balance off-chain and will make a transfer to my address on-chain?

Yes.

I've searched in vain, but not been able to find a detailed explanation of how off-chain transactions work.

That's because there are multiple ways of doing it. The simplest way of doing this is to run a service that keeps a database of users, and records how much Bitcoin each one has. From the point of view of the blockchain, there's one big pile of Bitcoins, and only the service needs to keep track of whose Bitcoins are whose.

Another way of doing it is track who owns which Bitcoins with a distributed database, like Open Transactions or Ripple. This lessens the demand on you to keep the database secure and backed up, but is more complicated.

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.