Hacker News new | ask | show | jobs
by jenadine 72 days ago
On the main chain, bitcoin transactions can have "scripts" that describes who and under what condition this money can be spent.

You have to lock your bitcoin on the main chain in a script that shares the bitcoin between you, and another lightning network user (typically a hub)

The trick is that a lightning transaction happen by signing transactions to the other party that changes the way the bitcoins are split, without broadcasting it to the main chain. You only broadcast to the main chain when you want to unlock the bitcoin. Broadcasting an earlier transaction will result of you losing the found because subsequent transaction contains secrets that allow the other party to take them.

1 comments

So I allocate my one BTC to lightning network A, so I can spend it there. I try to spend it on lightning network B and it rejects the spend because it's allocated to A in the main blockchain, even if I never spent it on A. There exists some mechanism for me to switch my bitcoin to B (by broadcasting on the main chain)... maybe? But then A needs to sign off that I don't have pending transactions?
Normally, network A and network B would be connected by a path, so your bitcoins can be routed through the destination by moving balances of each intermediaries. If there is no route to the destination, you can't send them as is. You'd need to take the bitcoin out of network A and open a channel with B. And that's operations on the main chain so it may take some time.