Post
Topic
Board Bitcoin Discussion
Merits 2 from 1 user
Re: lightning network, basic questions
by
kxwhalexk
on 06/07/2021, 07:06:01 UTC
⭐ Merited by Rath_ (2)
funds will be frozen?


Assuming Alice and Bob wants to make use of lightning network, Bod is the owner of one coffee shop, Alice is the customer. Both of them will have to open a channel, the channel is just a 2-of-2 multisig, which means both of them will have the knowledge the transfer of any particular amount they both agreed upon.

If they both agree to put 0.005 btc each on the channel

Alice: 0.005 btc
Bod: 0.005 btc

That means they both have 0.005 btc + 0.005 btc = 0.01 btc on the channel. Assuming Alice went to Bob's shop for coffee and he or she paid 0.0001 btc, the money will be deducted from Alice btc to Bob Btc on the channel. Which means Alice will have 0.0049 btc as 0.0001 btc is transferred by her on the channel while Bob will have 0.0051 btc for the coffee Alice paid for and so on until anyone of them closes the channel.

I think the freeze mentioned by OP is not what you explained

You are right, there must be a pool of funds before Alice and Bob can trade on the Lightning Network. But injecting funds into the fund pool in advance does not mean freezing.

After both parties have determined the allocation of funds in the fund pool, both of them can reflect their own funds at any time (this step needs to be recorded on the chain)

Code:
The freezing in the Lightning Network should refer specifically to HTLC,

Hashed Time Lock Contract,This is similar to a time-limited transfer. Through a smart contract, both parties agree that the transferor will first freeze a certain amount of money (send bitcoin to a multi-signature address), and will be locked by the ultimate recipientthe through the H(R) of a password R .

If the recipient knows the password R within a certain period of time, so that its H(R) adaptation (actually means that the transferor authorized the recipient to withdraw cash), then the money is transferred to the recipient.

If the recipient does not know the password R within the agreed time, the transfer party can retrieve the frozen funds.