Research/Bitcoin Dev Archive / lightning-dev list
channel_reserve_satoshis?
8 messages, Feb 2 to 7, 2018. Started by Cezary Dziemian.
Cezary Dziemian (4), ZmnSCPxj (4)
Hello,
When we send open_channel, how we can communicate other party that we would like him to put into channel some of his funds? Is this what is "channel_reserve_satoshis" field for?
Best regards, Cezary
Good morning Cezary,
Quoted text (1 line)
> When we send open_channel, how we can communicate other party that we would like him to put into channel some of his funds?
There is no way to do that as of BOLT v1.0
There are too many issues to allow channel opening by somebody else to ask your node to commit money into channels.
1. If I ask you to put 10.0 BTC from you to put into a channel I make, and you accept, I know you have at least 10.0 BTC lying around. 2. I might open a channel to you and ask you to put in money, then when you have committed the money into the channel, disconnect my node and reformat its hard disk, so that you are forced to use a unilateral close on your side, and locking your funds due to the unilateral close. Even if there is a rule that I must commit at least the same amount as you, a richer attacker can still lock up the funds of a poorer victim.
In general such dual-funded channels require some measure of trust between you and your counterparty due to the above issues, at least that you know that the one initiating the opening will not suddenly disappear.
Such trust issues can be mitigated by simply disallowing dual-funding by default on your node, and requiring you to explicitly allow multi-funding, once, for a particular amount, coming from a particular peer. But in any case, for now it is not defined in BOLT v1.0.
Quoted text (1 line)
> Is this what is "channel_reserve_satoshis" field for?
No. `channel_reserve_satoshis` is different. It is the amount that each of you should keep on the channel, once the channel state has moved from "all of the funds is assigned to the opener of the channel."
The reason for this field is below.
1. Suppose I open a 1BTC channel to you. We agree to a `channel_reserve_satoshis` amounting to 0.1BTC. The initial channel state is (me=1.0BTC, you=0BTC) 2. This means I can make 9 payments of 0.1BTC each, so that the channel state is now (me=0.1BTC, you = 0.9BTC). 3. The `channel_reserve_satoshis` means I cannot pay further to you, i.e. I cannot move the channel state to (me=0BTC, you=1BTC).. 4. Suppose we allowed this (me=0BTC, you=1BTC) state. Then it is costless for me to attempt to steal -- after all, I have 0 money on the channel and there is nothing to punish me with. Even if I steal, and you detect it, I lose nothing because I own nothing on the channel. 5. But if the channel is constrained, so that I need to keep 0.1BTC on the channel, then stealing attempts have a cost. If you detect me, I stand to lose 0.1BTC. If you have a better than 90% chance of detecting me, say 91%, a mere 9% chance of 0.9BTC payoff is not enough to counterbalance the 91% chance of losing 0.1BTC I currently have on the channel 6. In short, the `channel_reserve_satoshis` ensures we do not have costless theft.
Regards, ZmnSCPxj
Thank you very much for answer.
Thanks for explanation about 'channel_reserve_satoshis'. I misunderstood ' channel_reserve_satoshis ' with 'dust_limit'.
Lets say I would like to receive ln payments. How can I do this, without locking funds on the other side of channel?
Best regards, Cezary
2018-02-02 15:07 GMT+01:00 ZmnSCPxj <ZmnSCPxj at protonmail.com>:
Quoted text (61 lines)
> Good morning Cezary, > > When we send open_channel, how we can communicate other party that we > would like him to put into channel some of his funds? > > > There is no way to do that as of BOLT v1.0 > > There are too many issues to allow channel opening by somebody else to ask > your node to commit money into channels. > > 1. If I ask you to put 10.0 BTC from you to put into a channel I make, > and you accept, I know you have at least 10.0 BTC lying around. > 2. I might open a channel to you and ask you to put in money, then when > you have committed the money into the channel, disconnect my node and > reformat its hard disk, so that you are forced to use a unilateral close on > your side, and locking your funds due to the unilateral close. Even if > there is a rule that I must commit at least the same amount as you, a > richer attacker can still lock up the funds of a poorer victim. > > In general such dual-funded channels require some measure of trust between > you and your counterparty due to the above issues, at least that you know > that the one initiating the opening will not suddenly disappear. > > Such trust issues can be mitigated by simply disallowing dual-funding by > default on your node, and requiring you to explicitly allow multi-funding, > once, for a particular amount, coming from a particular peer. But in any > case, for now it is not defined in BOLT v1.0. > > Is this what is "channel_reserve_satoshis" field for? > > > No. `channel_reserve_satoshis` is different. It is the amount that each > of you should keep on the channel, once the channel state has moved from > "all of the funds is assigned to the opener of the channel." > > The reason for this field is below. > > 1. Suppose I open a 1BTC channel to you. We agree to a > `channel_reserve_satoshis` amounting to 0.1BTC. The initial channel state > is (me=1.0BTC, you=0BTC) > 2. This means I can make 9 payments of 0.1BTC each, so that the channel > state is now (me=0.1BTC, you = 0.9BTC). > 3. The `channel_reserve_satoshis` means I cannot pay further to you, i.e. > I cannot move the channel state to (me=0BTC, you=1BTC).. > 4. Suppose we allowed this (me=0BTC, you=1BTC) state. Then it is > costless for me to attempt to steal -- after all, I have 0 money on the > channel and there is nothing to punish me with. Even if I steal, and you > detect it, I lose nothing because I own nothing on the channel. > 5. But if the channel is constrained, so that I need to keep 0.1BTC on > the channel, then stealing attempts have a cost. If you detect me, I stand > to lose 0.1BTC. If you have a better than 90% chance of detecting me, say > 91%, a mere 9% chance of 0.9BTC payoff is not enough to counterbalance the > 91% chance of losing 0.1BTC I currently have on the channel > 6. In short, the `channel_reserve_satoshis` ensures we do not have > costless theft. > > Regards, > ZmnSCPxj > >
Good morning Cezary,
Quoted text (1 line)
> Lets say I would like to receive ln payments. How can I do this, without locking funds on the other side of channel?
1. Do the Blockstream Store route: do it early enough, and people will make channels to you, because, they want to try out Lightning Network quickly.
2. Publish the node and contact details (IP or TOR onion service) and hope people are excited enough about your product to open a channel to you.
3. In all likelihood, some service later will offer deals like "up to 300mBTC receive for only 1mBTC! At least 3 months channel alive!" for new upcoming businesses.
4. Ask a friend to channel to you.
Regards, ZmnSCPxj
Thanks for answer ZmnSCPxj,
I think first two options are for those, who want to earn some money for payments fee. The option that can be interesting for for some business like coffee is third option. Do you agree with me?
Quoted text (3 lines)
> 3. In all likelihood, some service later will offer deals like "up to 300mBTC receive for only 1mBTC! At least 3 months channel alive!" for new upcoming businesses.
It seams the best option for new businesses, but what if such new business would like to have channel with 300mBTC on both side. Let's say this is ATM. The owner of ATM need to be able to receive and sending funds. Without possibility of both-side funding channels this is quite hard to establish such balanced channel. ATM owner needs to send 300 mBTC as on-side transaction to hub, and then hub could open channel with 600 mBTC capacity and send back 300mBTC to ATM owner though this new channel. This requires trust to hub.
I know, LN is in early stage, but I'm very surprised that both sides cannot fund channel. Maybe this is because at the beginning LN was presented with such option. The only reason are trust issues that you described before, or maybe there are also some technical issues to implement such functionality? Do you predict this will be added to BOLT and implemented in the future?
Best regards, Cezary
2018-02-04 10:08 GMT+01:00 ZmnSCPxj <ZmnSCPxj at protonmail.com>:
Quoted text (21 lines)
> Good morning Cezary, > > > Lets say I would like to receive ln payments. How can I do this, without > locking funds on the other side of channel? > > 1. Do the Blockstream Store route: do it early enough, and people will > make channels to you, because, they want to try out Lightning Network > quickly. > > 2. Publish the node and contact details (IP or TOR onion service) and hope > people are excited enough about your product to open a channel to you. > > 3. In all likelihood, some service later will offer deals like "up to > 300mBTC receive for only 1mBTC! At least 3 months channel alive!" for new > upcoming businesses. > > 4. Ask a friend to channel to you. > > Regards, > ZmnSCPxj >
Good morning Cezary,
Quoted text (5 lines)
> I think first two options are for those, who want to earn some money for payments fee. The option that can be interesting for for some business like coffee is third option. Do you agree with me? > >> 3. In all likelihood, some service later will offer deals like "up to 300mBTC receive for only 1mBTC! At least 3 months channel alive!" for new upcoming businesses. > > It seams the best option for new businesses, but what if such new business would like to have channel with 300mBTC on both side. Let's say this is ATM. The owner of ATM need to be able to receive and sending funds. Without possibility of both-side funding channels this is quite hard to establish such balanced channel. ATM owner needs to send 300 mBTC as on-side transaction to hub, and then hub could open channel with 600 mBTC capacity and send back 300mBTC to ATM owner though this new channel. This requires trust to hub.
Then do not trust a single hub. Instead, have incoming 300mBTC from one hub, then make an outgoing 300mBTC to another hub. Encourages more hubs also. This also makes your node a potential routing node, improving network connectivity.
Quoted text (1 line)
> I know, LN is in early stage, but I'm very surprised that both sides cannot fund channel. Maybe this is because at the beginning LN was presented with such option. The only reason are trust issues that you described before, or maybe there are also some technical issues to implement such functionality? Do you predict this will be added to BOLT and implemented in the future?
There is already an issue regarding this. For now, priority is actual implementation of payments. Dual-funding channels can be emulated by having some hubbing service make channels to you, while you make a channel to some other hub (i.e. make two channels). Such an emulation is superior to dual-funding as it allows you to potentially become some alternate route if other routes become congested, letting you earn some small amount; compare this to a single dual-funding channel that, by itself, cannot be used to for routing.
Another thing is that we can make "circular superhubs" if small groups of us cooperate. The smallest 3-circle superhub has 3 members A B C. A opens channel to B, B open channels t C, C open channels to A. Each channel is the same capacity. If each of you has one out-channel other than on the circular superhub, any of A B C can spend to any node that any of them have an out-channel to. Similarly, each of you can receive via any in-channel any of you happen to have. Join a few such small communities and you can be well-connected enough to send and receive reasonably seamlessly to anyone on the network.
Regards, ZmnSCPxj
Quoted text (18 lines)
> Best regards, > Cezary > > 2018-02-04 10:08 GMT+01:00 ZmnSCPxj <ZmnSCPxj at protonmail.com>: > >> Good morning Cezary, >>> Lets say I would like to receive ln payments. How can I do this, without locking funds on the other side of channel? >> >> 1. Do the Blockstream Store route: do it early enough, and people will make channels to you, because, they want to try out Lightning Network quickly. >> >> 2. Publish the node and contact details (IP or TOR onion service) and hope people are excited enough about your product to open a channel to you. >> >> 3. In all likelihood, some service later will offer deals like "up to 300mBTC receive for only 1mBTC! At least 3 months channel alive!" for new upcoming businesses. >> >> 4. Ask a friend to channel to you. >> >> Regards, >> ZmnSCPxj
Thank you very much for answer!
This is quite good way to replace both-funding channels by such "superhub". It would be even easier if I could open more then single channel between both parties, but I saw this is not possible in c-lightning. Could you tell me what is the reason and do you plan to add this possibility in the future? In LND opening multiple channels is possible, but is this compatible with c-lightning then?
Best Regards, Cezary
2018-02-04 13:36 GMT+01:00 ZmnSCPxj <ZmnSCPxj at protonmail.com>:
Quoted text (86 lines)
> Good morning Cezary, > > > I think first two options are for those, who want to earn some money for > payments fee. The option that can be interesting for for some business like > coffee is third option. Do you agree with me? > > > 3. In all likelihood, some service later will offer deals like "up to > 300mBTC receive for only 1mBTC! At least 3 months channel alive!" for new > upcoming businesses. > > It seams the best option for new businesses, but what if such new business > would like to have channel with 300mBTC on both side. Let's say this is > ATM. The owner of ATM need to be able to receive and sending funds. Without > possibility of both-side funding channels this is quite hard to establish > such balanced channel. ATM owner needs to send 300 mBTC as on-side > transaction to hub, and then hub could open channel with 600 mBTC capacity > and send back 300mBTC to ATM owner though this new channel. This requires > trust to hub. > > > Then do not trust a single hub. Instead, have incoming 300mBTC from one > hub, then make an outgoing 300mBTC to another hub. Encourages more hubs > also. This also makes your node a potential routing node, improving > network connectivity. > > > I know, LN is in early stage, but I'm very surprised that both sides > cannot fund channel. Maybe this is because at the beginning LN was > presented with such option. The only reason are trust issues that you > described before, or maybe there are also some technical issues to > implement such functionality? Do you predict this will be added to BOLT and > implemented in the future? > > > There is already an issue regarding this. For now, priority is actual > implementation of payments. Dual-funding channels can be emulated by > having some hubbing service make channels to you, while you make a channel > to some other hub (i.e. make two channels). Such an emulation is superior > to dual-funding as it allows you to potentially become some alternate route > if other routes become congested, letting you earn some small amount; > compare this to a single dual-funding channel that, by itself, cannot be > used to for routing. > > Another thing is that we can make "circular superhubs" if small groups of > us cooperate. The smallest 3-circle superhub has 3 members A B C. A opens > channel to B, B open channels t C, C open channels to A. Each channel is > the same capacity. If each of you has one out-channel other than on the > circular superhub, any of A B C can spend to any node that any of them have > an out-channel to. Similarly, each of you can receive via any in-channel > any of you happen to have. Join a few such small communities and you can > be well-connected enough to send and receive reasonably seamlessly to > anyone on the network. > > Regards, > ZmnSCPxj > > > Best regards, > Cezary > > 2018-02-04 10:08 GMT+01:00 ZmnSCPxj <ZmnSCPxj at protonmail.com>: > >> Good morning Cezary, >> >> > Lets say I would like to receive ln payments. How can I do this, >> without locking funds on the other side of channel? >> >> 1. Do the Blockstream Store route: do it early enough, and people will >> make channels to you, because, they want to try out Lightning Network >> quickly. >> >> 2. Publish the node and contact details (IP or TOR onion service) and >> hope people are excited enough about your product to open a channel to you. >> >> 3. In all likelihood, some service later will offer deals like "up to >> 300mBTC receive for only 1mBTC! At least 3 months channel alive!" for new >> upcoming businesses. >> >> 4. Ask a friend to channel to you. >> >> Regards, >> ZmnSCPxj >> > >
Good Morning Cezary,
Quoted text (1 line)
> This is quite good way to replace both-funding channels by such "superhub". It would be even easier if I could open more then single channel between both parties, but I saw this is not possible in c-lightning.
From a risk perspective, you have increased risk in general if you open channels to few nodes, compared to the case where you open channels to more nodes. Thus if you can afford to open many channels, you would prefer to participate in multiple different circular superhubs, each with a different set of participants, rather than repeatedly opening many channels to the same participant in a single superhub.
Quoted text (1 line)
> Could you tell me what is the reason and do you plan to add this possibility in the future?
The current code tends to couple "channel" to "peer" a little too much, and it is going to take quite some work to uncouple them. I believe cdecker has plans to add this in the future, as there are a few comments in the code from him pointing to bits where this decoupling needs to be implemented.
Quoted text (1 line)
> In LND opening multiple channels is possible, but is this compatible with c-lightning then?
No, currently the c-lightning daemon will reject the multiple channel attempt from LND. LND can form multiple channels with peer LND.
Regards, ZmnSCPxj
Quoted text (42 lines)
> Best Regards, > Cezary > > 2018-02-04 13:36 GMT+01:00 ZmnSCPxj <ZmnSCPxj at protonmail.com>: > >> Good morning Cezary, >> >>> I think first two options are for those, who want to earn some money for payments fee. The option that can be interesting for for some business like coffee is third option. Do you agree with me? >>> >>>> 3. In all likelihood, some service later will offer deals like "up to 300mBTC receive for only 1mBTC! At least 3 months channel alive!" for new upcoming businesses. >>> >>> It seams the best option for new businesses, but what if such new business would like to have channel with 300mBTC on both side. Let's say this is ATM. The owner of ATM need to be able to receive and sending funds. Without possibility of both-side funding channels this is quite hard to establish such balanced channel. ATM owner needs to send 300 mBTC as on-side transaction to hub, and then hub could open channel with 600 mBTC capacity and send back 300mBTC to ATM owner though this new channel. This requires trust to hub. >> >> Then do not trust a single hub. Instead, have incoming 300mBTC from one hub, then make an outgoing 300mBTC to another hub. Encourages more hubs also. This also makes your node a potential routing node, improving network connectivity. >> >>> I know, LN is in early stage, but I'm very surprised that both sides cannot fund channel. Maybe this is because at the beginning LN was presented with such option. The only reason are trust issues that you described before, or maybe there are also some technical issues to implement such functionality? Do you predict this will be added to BOLT and implemented in the future? >> >> There is already an issue regarding this. For now, priority is actual implementation of payments. Dual-funding channels can be emulated by having some hubbing service make channels to you, while you make a channel to some other hub (i.e. make two channels). Such an emulation is superior to dual-funding as it allows you to potentially become some alternate route if other routes become congested, letting you earn some small amount; compare this to a single dual-funding channel that, by itself, cannot be used to for routing. >> >> Another thing is that we can make "circular superhubs" if small groups of us cooperate. The smallest 3-circle superhub has 3 members A B C. A opens channel to B, B open channels t C, C open channels to A. Each channel is the same capacity. If each of you has one out-channel other than on the circular superhub, any of A B C can spend to any node that any of them have an out-channel to. Similarly, each of you can receive via any in-channel any of you happen to have. Join a few such small communities and you can be well-connected enough to send and receive reasonably seamlessly to anyone on the network. >> >> Regards, >> ZmnSCPxj >> >>> Best regards, >>> Cezary >>> >>> 2018-02-04 10:08 GMT+01:00 ZmnSCPxj <ZmnSCPxj at protonmail.com>: >>> >>>> Good morning Cezary, >>>>> Lets say I would like to receive ln payments. How can I do this, without locking funds on the other side of channel? >>>> >>>> 1. Do the Blockstream Store route: do it early enough, and people will make channels to you, because, they want to try out Lightning Network quickly. >>>> >>>> 2. Publish the node and contact details (IP or TOR onion service) and hope people are excited enough about your product to open a channel to you. >>>> >>>> 3. In all likelihood, some service later will offer deals like "up to 300mBTC receive for only 1mBTC! At least 3 months channel alive!" for new upcoming businesses. >>>> >>>> 4. Ask a friend to channel to you. >>>> >>>> Regards, >>>> ZmnSCPxj