I've searched in vain, but not been able to find a detailed explanation of how off-chain transactions work.
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?
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?