Skip to content
LearnBitcoin

ResearchBitcoin Dev Archive lightning-dev list

General questions about channels

23 messages, Dec 17, 2017, to Jan 3, 2018. Started by Andy Schroder.

Andy Schroder (9), ZmnSCPxj (4), Christian Decker (4), Rusty Russell (3), dreamwvr, Daniel McNally, Mark F

Permalink First message in the Wayback Machine

Andy Schroder permalink original

What's the rational for using millisatoshis as the units for lightning channels? Aren't you going to loose up to 1/2 of a satoshi when the channel is closed? Is this because it doesn't hurt and you might as well be open to the opportunity for these sub satoshi transactions, because if you aren't, you are giving up the opportunity to get accumulated revenue from many of those small transactions, that could end up being greater than 1/2 of a satoshi?

Since millisatoshis is used, is there a maximum channel funding size?

Is the optional initial push of millisatoshis during the channel creation there in order to motivate the other party to be willing to waste their time with the channel creation in the first place? If not, what's it for?

In all of the clients that I've looked at, I can't seem to find out how to define the timeout closing out a channel when someone does not cooperate. Is there a fixed value for this as part of the protocol? Or do most clients have a default that they enforce over all channels that they create?

Thanks,

Rusty Russell in reply to Andy Schroder permalink original

Andy Schroder <info at AndySchroder.com> writes:

Quoted text (3 lines)
> What's the rational for using millisatoshis as the units for lightning
> channels? Aren't you going to loose up to 1/2 of a satoshi when the
> channel is closed?

You can lose up to 0.999 satoshi per in-progress payment, yes. BOLT #3:

    The amounts for each output MUST be rounded down to whole satoshis.
Quoted text (5 lines)
> Is this because it doesn't hurt and you might as well
> be open to the opportunity for these sub satoshi transactions, because
> if you aren't, you are giving up the opportunity to get accumulated
> revenue from many of those small transactions, that could end up being
> greater than 1/2 of a satoshi?

In practice, payments of less than a few thousand satoshi are impractical, as they cost more than that to spend. Channel closing costs dwarf the gains to be made from cheating, however.

Quoted text (1 line)
> Since millisatoshis is used, is there a maximum channel funding size?

Yes, the upper 32 bits must be zero, from BOLT #2:

  - for channels with `chain_hash` identifying the Bitcoin blockchain:
    - MUST set the four most significant bytes of `amount_msat` to 0.

This gives a maximum HTLC value of .04294967295 BTC, which, back when we started, was about $10.

Quoted text (4 lines)
> Is the optional initial push of millisatoshis during the channel
> creation there in order to motivate the other party to be willing to
> waste their time with the channel creation in the first place? If not,
> what's it for?

It's for the common case where you want to connect to someone and make a payment immediately. I'm not sure how widely it will be used, though. It's also the only mechanism for the payer to have *zero* funds in channel (ie. below reserve).

Quoted text (5 lines)
> In all of the clients that I've looked at, I can't seem to find out how
> to define the timeout closing out a channel when someone does not
> cooperate. Is there a fixed value for this as part of the protocol? Or
> do most clients have a default that they enforce over all channels that
> they create?

If there's no in-progress payment, there's no reason to close a channel to an unreachable peer, unless you want to abandon the channel and get the funds back.

If there is, BOLT #2 has you covered:

        https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md#requirements-8

Hope that helps, Rusty.

dreamwvr in reply to Andy Schroder permalink original

On Fri, Dec 29, 2017 at 01:01:03PM -0500, Andy Schroder wrote:

Quoted text (31 lines)
> Hello,
>
> Thanks for all of the discussion on this topic. In general, I don't
> have a solid opinion formed yet, but I understand all of the points
> that everyone has made. I think the bottom line is that a limit
> doesn't hurt right now unless the purchasing power of bitcoin
> dramatically declines. This limit is like the block size limit in
> that it is conservative and we need to have some experience in order
> to determine whether the limit is needed at all. It proved to be
> very clear over time that a block size limit was needed as one force
> against centralization. Maybe a limit is needed for lightning
> channels, maybe it isn't, but we need to first see how the network
> starts to evolve. My main concern long term is that a large business
> couldn't operate using lightning, because the channel sizes and
> payment sizes are too small. What if you're buying an oil rig, a
> locomotive, a gas turbine, a load of coal, or a herd of cattle.
> Should a blockchain transaction be used for everyone in the world
> for these types of purchases? But then again, maybe different types
> of users will use different kinds of lightning networks.
>
> Another reason against accepting large incoming channels yourself
> would be that you may not want to encourage people paying you to
> route through one of the super nodes. Super nodes are likely spies
> or targets of spies and users won't naturally want to deal with
> those types of actors.
>
> Also, the Eclair implementation supports push_msat too.
>
> Other than as "training wheels", I'm still not sure why we need a
> payment limit if we have a channel limit. It seems as though the
> channel limit puts an implicit payment limit in place.

centralized payments have limits. Is that model flawed or does it create a situation of check and balances to control situations where transactions go sideways in ways unforseen?

Quoted text (126 lines)
>
> Andy Schroder
>
> On 12/27/2017 03:13 PM, ZmnSCPxj wrote:
> >Good morning Daniel,
> >
> >
> >
> >>-------- Original Message --------
> >>Subject: Re: [Lightning-dev] General questions about channels
> >>Local Time: December 27, 2017 10:30 PM
> >>UTC Time: December 27, 2017 2:30 PM
> >>From: therealsangaman at gmail.com
> >>To: ZmnSCPxj <ZmnSCPxj at protonmail.com>
> >>Andy Schroder <info at andyschroder.com>,
> >>lightning-dev at lists.linuxfoundation.org
> >><lightning-dev at lists.linuxfoundation.org>
> >>
> >>I've only really been getting my hands into LN the past few weeks but
> >>I thought I'd share my thoughts here.
> >>
> >>ZmnSCPxj via Lightning-dev
> >>lightning-dev at lists.linuxfoundation.org
> >><mailto:lightning-dev at lists.linuxfoundation.org> wrote:
> >>
> >>    Perhaps some day, in the LONG TERM, the limits may be increased
> >>
> >>
> >>I was always under the impression that the channel and payment limits
> >>were intended to be training wheels, this is the first I've heard of
> >>them intended to stick around long term. I find the channel limit to
> >>be particularly restrictive, as it hinders some use cases I'd envision
> >>where large payment channels between two parties are useful and can
> >>also be used for routing LN payments. Large payments afaik can be
> >>broken up into smaller ones without incurring too much cost or
> >>trouble,
> >
> >Splitting up large payments would require multiple invoices at
> >least for now (whether this is troublesome or not may be a matter
> >of opinion, bit I suspect juggling more than a few invoices would
> >be painful as a user experience). Routing larger payments over
> >multiple routes automatically while using a single invoice, is
> >harder as multiple routes need to be set up, and each route must
> >have different preimages: further it is likely you want the entire
> >large payment to be done atomically, which would be harder to
> >arrange.
> >
> >>but that's not the case for creating channels. As the channel
> >>itself involves only two parties - and in sticking to my general
> >>political/philosophical mantra - there is really no justification for
> >>limits to be imposed on this. Which brings me to my next point.
> >>
> >
> >Perhaps our definition of "long term" is askew. A year after
> >mainnet release, I doubt anyone would feel safe implementing
> >removal of the limit; this is my "long term".  Five years, I
> >imagine quite a few will use the nonlimited version and may form a
> >subnetwork among themselves.  But possibly by then it would be
> >unlikely that most people using Bitcoin at all would evem be
> >capable of putting 150 mBTC in spending money on a hot wallet, in
> >which case whether there is a 167 mBTC limit per channel or not is
> >largely a moot point. Or perhaps I simply imagine
> >hyperbitcoinization by then, with people putting entire bitcoins
> >into hot wallets equivalent to people putting thousands of USD
> >today in their back pockets as invitation to be attacked.
> >
> >>
> >>    There is also again the wisdom, that one should keep most of the
> >>    funds in
> >>    cold storage, and only a small amount for spending in hot wallets
> >>    like
> >>    Lightning nodes
> >>
> >>
> >>I think this is a top-down way of thinking that runs counter to the
> >>spirit of bitcoin. The "wisest" thing to do in fact may be to simply
> >>buy inflation-adjusted treasury bonds and not mess with bitcoin at
> >>all, much less the experimental lightning network. As advice this is
> >>perfectly fine to share with others for them to follow on a voluntary
> >>basis, but I don't see why this ought to be enforced as a rule on a
> >>protocol level.
> >>
> >
> >Possibly.  At the protocol level, a limit encourages the growth of
> >the network towards a mesh network rather than more central forms,
> >however.  I merely put this since it is unlikely that most people
> >following this "wisdom" would have an incentive to even run
> >software with the limit removed: that is, by the time Lightning
> >becomes fully deployed the limit may not even be reached in
> >practice.
> >
> >>
> >>Also, I personally can't see a reason why a node would reject a large
> >>channel being made with it, where is the downside or risk? The party
> >>committing funds to the channel is the one risking loss or delay of
> >>funds.
> >>
> >
> >But the party committing funds to the channel is known via node
> >gossip, and it is known also who the other end of the channel is.
> >If you were to propose opening for example a 5BTC channel to me
> >with the funds coming from you, I would consider the possibility
> >that I might get attacked in order to get to your funds (and I
> >might not have the resources to protect against such an attack on
> >my end, even if you might). Further, putting 5BTC implies that at
> >some point there is the future possibility, due to routing and so
> >on, that the channel will have around 5BTC belonging to me, and at
> >some point before you can spend the entire 5BTC I would want to
> >close the channel and commit the funds that I now own into cold
> >storage (so that the ability to channel 5BTC from you to me is a
> >moot point).
> >
> >
> >Regards,
> >ZmnSCPxj
>
>
>
> !DSPAM:5a3fc746296411625131755!

> _______________________________________________
> Lightning-dev mailing list
> Lightning-dev at lists.linuxfoundation.org
> https://www.learnbitcoin.com/archive/lists/lightning-dev
>
>
> !DSPAM:5a3fc746296411625131755!
Andy Schroder in reply to Rusty Russell permalink original

Andy Schroder

On 12/18/2017 01:40 PM, Rusty Russell wrote:

Quoted text (7 lines)
> Andy Schroder <info at AndySchroder.com> writes:
>> What's the rational for using millisatoshis as the units for lightning
>> channels? Aren't you going to loose up to 1/2 of a satoshi when the
>> channel is closed?
> You can lose up to 0.999 satoshi per in-progress payment, yes.  BOLT #3:
>
>      The amounts for each output MUST be rounded down to whole satoshis.

Okay, round down, not regular rounding!

Quoted text (8 lines)
>
>> Is this because it doesn't hurt and you might as well
>> be open to the opportunity for these sub satoshi transactions, because
>> if you aren't, you are giving up the opportunity to get accumulated
>> revenue from many of those small transactions, that could end up being
>> greater than 1/2 of a satoshi?
> In practice, payments of less than a few thousand satoshi are
> impractical, as they cost more than that to spend.

They are impractical even on the lightning network?

Quoted text (11 lines)
> Channel closing
> costs dwarf the gains to be made from cheating, however.
>
>> Since millisatoshis is used, is there a maximum channel funding size?
> Yes, the upper 32 bits must be zero, from BOLT #2:
>
>    - for channels with `chain_hash` identifying the Bitcoin blockchain:
>      - MUST set the four most significant bytes of `amount_msat` to 0.
>
> This gives a maximum HTLC value of .04294967295 BTC, which, back when
> we started, was about $10.

What's the point of wasting the upper 32 bits? Seems like this is a waste of data?

If you have the lower 32 bits of data to use, and 2^32=4,294,967,296, then you have 4,294,967,296 milli satoshis. 1 BTC=10^11 milli satoshis, so 4,294,967,296 milli satoshis/((10^11 milli satoshis)/1BTC) = 0.04294967296 BTC. That is off by 1 milli satoshi from what you say above. Why is this?

Regardless of the discrepancy of 1 milli satoshi, it still seems like 0.04294967296 BTC is kind of a low maximum channel size for a lot of business applications. Why do you want to limit this when you have those extra 4 bytes set to zero? You think any more is too much to safely have in a hot wallet? You felt keeping it low will encourage decentralization? Something else?

Is the max HTLC value the same as the maximum channel size?

Quoted text (9 lines)
>
>> Is the optional initial push of millisatoshis during the channel
>> creation there in order to motivate the other party to be willing to
>> waste their time with the channel creation in the first place? If not,
>> what's it for?
> It's for the common case where you want to connect to someone and
> make a payment immediately.  I'm not sure how widely it will be used,
> though.  It's also the only mechanism for the payer to have *zero* funds
> in channel (ie. below reserve).

Why would you ever want to start up a channel and immediately have zero funds in reserve? If you are doing that, why not just make a blockchain transaction?

Quoted text (13 lines)
>
>> In all of the clients that I've looked at, I can't seem to find out how
>> to define the timeout closing out a channel when someone does not
>> cooperate. Is there a fixed value for this as part of the protocol? Or
>> do most clients have a default that they enforce over all channels that
>> they create?
> If there's no in-progress payment, there's no reason to close a channel
> to an unreachable peer, unless you want to abandon the channel and get
> the funds back.
>
> If there is, BOLT #2 has you covered:
>
>          https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md#requirements-8

Okay, so every time you get a new HTLC, your client can change the timeout that you require for closing the channel, which will control how long it takes you to abandon the channel and get your funds back when the peer is unreachable? Or is that set during initial channel creation only?

Quoted text (4 lines)
>
> Hope that helps,
> Rusty.
>
ZmnSCPxj in reply to Andy Schroder permalink original

Good morning Andy,

Quoted text (17 lines)
>
>
>> Channel closing
>> costs dwarf the gains to be made from cheating, however.
>>
>>> Since millisatoshis is used, is there a maximum channel funding size?
>>> Yes, the upper 32 bits must be zero, from BOLT #2:
>>
>> - for channels with chain_hash identifying the Bitcoin blockchain:
>>
>> - MUST set the four most significant bytes of amount_msat to 0.
>>
>> This gives a maximum HTLC value of .04294967295 BTC, which, back when
>> we started, was about $10.
>
> What's the point of wasting the upper 32 bits? Seems like this is a
> waste of data?

The specs are intended to eventually support other similar cryptocurrencies, such as Litecoin. For those currencies, payments of hundreds of whole coins may be practical, and thus the 0.042 limit is not imposed. For Bitcoin only, the limit is applied. This simplifies the design of software by only imposing a limit to a large field under certain conditions (i.e. for Bitcoin) while retaining the same format for all coins. Other cryptocurrencies may have different imposed limits when Lightning gets around to those.

Quoted text (6 lines)
>
> If you have the lower 32 bits of data to use, and 2^32=4,294,967,296,
> then you have 4,294,967,296 milli satoshis. 1 BTC=10^11 milli satoshis,
> so 4,294,967,296 milli satoshis/((10^11 milli satoshis)/1BTC) =
> 0.04294967296 BTC. That is off by 1 milli satoshi from what you say
> above. Why is this?

You have an off-by-one error. The largest number representable by 32 bits is 2^32 - 1, not 2^32.

Quoted text (7 lines)
>
> Regardless of the discrepancy of 1 milli satoshi, it still seems like
> 0.04294967296 BTC is kind of a low maximum channel size for a lot of
> business applications. Why do you want to limit this when you have those
> extra 4 bytes set to zero? You think any more is too much to safely have
> in a hot wallet? You felt keeping it low will encourage
> decentralization? Something else?

This is not the channel size. This is the payment size limit. The channel size limit is 0.16777215 BTC, or 16777215 satoshi (2^24 - 1).

A single payment can be up to 0.04294967295, but a channel is up to 0.16777215.

Quoted text (2 lines)
>
> Is the max HTLC value the same as the maximum channel size?

No

Quoted text (14 lines)
>
>
>>> Is the optional initial push of millisatoshis during the channel
>>> creation there in order to motivate the other party to be willing to
>>> waste their time with the channel creation in the first place? If not,
>>> what's it for?
>>> It's for the common case where you want to connect to someone and
>>> make a payment immediately. I'm not sure how widely it will be used,
>>> though. It's also the only mechanism for the payer to have zero funds
>>> in channel (ie. below reserve).
>
> Why would you ever want to start up a channel and immediately have zero
> funds in reserve? If you are doing that, why not just make a blockchain
> transaction?

An exchange might support this. You buy for example 100USD worth of BTC and indicate a desire to open a new channel between your node to the exchange's. The exchange opens the channel with your node and specifies the push_msat equivalent of 100USD minus fees to your node. The exchange will want to do this because your new channel goes directly to the exchange and it can earn routing fees from your spending. Presumably you want to do this so that you can spend your 100USD on Lightning for things within a short time frame.

The alternative is to send the money from the exchange onchain to you, then for your node to open a new channel (not necessarily to the exchange, too, so the exchange loses the routing fees) with the onchain funds. This is two onchain transactions (from exchange to you, and from your node to a Lightning channel), unlike the case where the exchange does a single open and reassigns the funds to you via push_msat.

Both you and the exchange would want to do this: the exchange wants this so it can capture your routing fees, you want this so that you do not even touch the chain at all and start out in Lightning in the first place.

Regards, ZmnSCPxj

Andy Schroder in reply to Andy Schroder permalink original

Andy Schroder

On 12/27/2017 12:18 AM, Andy Schroder wrote:

Quoted text (30 lines)
>> Channel closing
>> costs dwarf the gains to be made from cheating, however.
>>
>>> Since millisatoshis is used, is there a maximum channel funding size?
>> Yes, the upper 32 bits must be zero, from BOLT #2:
>>
>>    - for channels with `chain_hash` identifying the Bitcoin blockchain:
>>      - MUST set the four most significant bytes of `amount_msat` to 0.
>>
>> This gives a maximum HTLC value of .04294967295 BTC, which, back when
>> we started, was about $10.
>
> What's the point of wasting the upper 32 bits? Seems like this is a
> waste of data?
>
> If you have the lower 32 bits of data to use, and 2^32=4,294,967,296,
> then you have 4,294,967,296 milli satoshis. 1 BTC=10^11 milli
> satoshis, so 4,294,967,296 milli satoshis/((10^11 milli
> satoshis)/1BTC) = 0.04294967296 BTC. That is off by 1 milli satoshi
> from what you say above. Why is this?
>
> Regardless of the discrepancy of 1 milli satoshi, it still seems like
> 0.04294967296 BTC is kind of a low maximum channel size for a lot of
> business applications. Why do you want to limit this when you have
> those extra 4 bytes set to zero? You think any more is too much to
> safely have in a hot wallet? You felt keeping it low will encourage
> decentralization? Something else?
>
>
> Is the max HTLC value the same as the maximum channel size?
Okay, so I may have discovered part of this answer to this question in
BOLT 2 where it says: "MUST set |funding_satoshis| to less than 2^24
satoshi". However, I still don't understand the rational of why |max
||funding_satoshis doesn't equal max |amount_msat, or where the values
of (2^24)*10^3 and 2^32 milli satoshis came from. Also, why don't you
use units of millisatoshis everywhere in the spec? Sometimes it's
satoshis and sometimes it's milli satoshis.
ZmnSCPxj in reply to Andy Schroder permalink original

Good morning Andy,

Quoted text (22 lines)
> Andy Schroder
>
> On 12/27/2017 12:18 AM, Andy Schroder wrote:
>
>>> Channel closing
>>> costs dwarf the gains to be made from cheating, however.
>>>
>>>> Since millisatoshis is used, is there a maximum channel funding size?
>>>
>>> Yes, the upper 32 bits must be zero, from BOLT #2:
>>>
>>>    - for channels with `chain_hash` identifying the Bitcoin blockchain:
>>>      - MUST set the four most significant bytes of `amount_msat` to 0.
>>>
>>> This gives a maximum HTLC value of .04294967295 BTC, which, back when
>>> we started, was about $10.
>>
>> What's the point of wasting the upper 32 bits? Seems like this is a waste of data?
>>
>> If you have the lower 32 bits of data to use, and 2^32=4,294,967,296, then you have 4,294,967,296 milli satoshis. 1 BTC=10^11 milli satoshis, so 4,294,967,296 milli satoshis/((10^11 milli satoshis)/1BTC) = 0.04294967296 BTC. That is off by 1 milli satoshi from what you say above. Why is this?
>>
>> Regardless of the discrepancy of 1 milli satoshi, it still seems like 0.04294967296 BTC is kind of a low maximum channel size for a lot of business applications. Why do you want to limit this when you have those extra 4 bytes set to zero? You think any more is too much to safely have in a hot wallet? You felt keeping it low will encourage decentralization? Something else?

Yes, I believe Rusty did indeed consider 42mBTC as a reasonable amount to transfer on Lightning. So that in case of trouble on Lightning, not a lot of money gets lost. At the time he decided this 42mBTC limit, it was about 10 USD only, so Rusty could always just buy you a drink if he somehow causes c-lightning to lose that much.

Of course, 42mBTC today is much larger.

For myself, I think the channel limit of 167mBTC is good as it encourages decentralization by encouraging people to make many small channels than one large channel. Many small channels helps in keeping your funds resilient against temporary outages of your fellow nodes.

Quoted text (3 lines)
>> Is the max HTLC value the same as the maximum channel size?
>
> Okay, so I may have discovered part of this answer to this question in BOLT 2 where it says: "MUST setfunding_satoshis to less than 2^24 satoshi". However, I still don't understand the rational of why max funding_satoshis doesn't equal max amount_msat, or where the values of (2^24)*10^3 and 2^32 milli satoshis came from. Also, why don't you use units of millisatoshis everywhere in the spec? Sometimes it's satoshis and sometimes it's milli satoshis.

This is actually very simple. Everything that touches the chain (opening and closing) uses satoshis. Everything that does not, uses millisatoshis. This is because the chain uses satoshis as the smallest amount. Offchain, we can use millisatoshis, and it is used everywhere offchain.

Regards, ZmnSCPxj

Andy Schroder in reply to ZmnSCPxj permalink original

Andy Schroder

On 12/27/2017 12:56 AM, ZmnSCPxj wrote:

Quoted text (31 lines)
> Good morning Andy,
>
>>
>>     Channel closing
>>     costs dwarf the gains to be made from cheating, however.
>>
>>         Since millisatoshis is used, is there a maximum channel
>>         funding size?
>>         Yes, the upper 32 bits must be zero, from BOLT #2:
>>
>>      *
>>         for channels with |chain_hash| identifying the Bitcoin
>>         blockchain:
>>           o MUST set the four most significant bytes of |amount_msat|
>>             to 0.
>>
>>     This gives a maximum HTLC value of .04294967295 BTC, which, back when
>>     we started, was about $10.
>>
>>
>> What's the point of wasting the upper 32 bits? Seems like this is a
>> waste of data?
>
> The specs are intended to eventually support other similar
> cryptocurrencies, such as Litecoin.  For those currencies, payments of
> hundreds of whole coins may be practical, and thus the 0.042 limit is
> not imposed.  For Bitcoin only, the limit is applied.  This simplifies
> the design of software by only imposing a limit to a large field under
> certain conditions (i.e. for Bitcoin) while retaining the same format
> for all coins. Other cryptocurrencies may have different imposed
> limits when Lightning gets around to those.

It seems like you are making assumptions about the purchasing power of certain cryptocurrencies. Why even bother doing this? You have no idea what the future holds. Why set a limit for any cryptocurrency that might use lightning?

Even if you are right about the purchasing power of a particular cryptocurrency, why is a limit needed at all? If I have an high, bi weekly paid salary, and I have a low budget lifestyle, let's say I save 90% of my income. It seems like your assumed limits could require multiple payments and multiple open channels for each bi weekly payment. What if I want to buy a boat, do you expect me to make payments from a lot of different channels? I was kind of under the assumption that the long term goal of lightning was only to have a few on chain payments per human per year.

Or, are you just worried right now because lightning isn't well tested?

Quoted text (11 lines)
>
>>
>> If you have the lower 32 bits of data to use, and 2^32=4,294,967,296,
>> then you have 4,294,967,296 milli satoshis. 1 BTC=10^11 milli satoshis,
>> so 4,294,967,296 milli satoshis/((10^11 milli satoshis)/1BTC) =
>> 0.04294967296 BTC. That is off by 1 milli satoshi from what you say
>> above. Why is this?
>>
>
> You have an off-by-one error.  The largest number representable by 32
> bits is 2^32 - 1, not 2^32.

Okay, thanks for the clarification.

Quoted text (15 lines)
>
>>
>> Regardless of the discrepancy of 1 milli satoshi, it still seems like
>> 0.04294967296 BTC is kind of a low maximum channel size for a lot of
>> business applications. Why do you want to limit this when you have those
>> extra 4 bytes set to zero? You think any more is too much to safely have
>> in a hot wallet? You felt keeping it low will encourage
>> decentralization? Something else?
>>
>
> This is not the channel size.  This is the payment size limit.  The
> channel size limit is 0.16777215 BTC, or 16777215 satoshi (2^24 - 1).
>
> A single payment can be up to 0.04294967295, but a channel is up to
> 0.16777215.

Okay, so why bother making these two amounts different?

Quoted text (49 lines)
>
>>
>> Is the max HTLC value the same as the maximum channel size?
>>
>>
>
> No
>
>>
>>         Is the optional initial push of millisatoshis during the channel
>>         creation there in order to motivate the other party to be
>>         willing to
>>         waste their time with the channel creation in the first
>>         place? If not,
>>         what's it for?
>>         It's for the common case where you want to connect to someone and
>>         make a payment immediately. I'm not sure how widely it will
>>         be used,
>>         though. It's also the only mechanism for the payer to have
>>         /zero/ funds
>>         in channel (ie. below reserve).
>>
>>
>> Why would you ever want to start up a channel and immediately have zero
>> funds in reserve? If you are doing that, why not just make a blockchain
>> transaction?
>>
>
> An exchange might support this.  You buy for example 100USD worth of
> BTC and indicate a desire to open a new channel between your node to
> the exchange's.  The exchange opens the channel with your node and
> specifies the push_msat equivalent of 100USD minus fees to your node.
> The exchange will want to do this because your new channel goes
> directly to the exchange and it can earn routing fees from your
> spending.  Presumably you want to do this so that you can spend your
> 100USD on Lightning for things within a short time frame.
>
> The alternative is to send the money from the exchange onchain to you,
> then for your node to open a new channel (not necessarily to the
> exchange, too, so the exchange loses the routing fees) with the
> onchain funds.  This is two onchain transactions (from exchange to
> you, and from your node to a Lightning channel), unlike the case where
> the exchange does a single open and reassigns the funds to you via
> push_msat.
>
> Both you and the exchange would want to do this: the exchange wants
> this so it can capture your routing fees, you want this so that you do
> not even touch the chain at all and start out in Lightning in the
> first place.

Okay, so all this feature is doing is saving the extra step of making an initial payment? Just saving a little time, and not a monumental or required feature?

Thanks, Andy Schroder

Quoted text (3 lines)
>
> Regards,
> ZmnSCPxj
Andy Schroder in reply to ZmnSCPxj permalink original

Andy Schroder

On 12/27/2017 01:06 AM, ZmnSCPxj wrote:

Quoted text (48 lines)
> Good morning Andy,
>
>> Andy Schroder
>> On 12/27/2017 12:18 AM, Andy Schroder wrote:
>>>> Channel closing
>>>> costs dwarf the gains to be made from cheating, however.
>>>>
>>>>
>>>>> Since millisatoshis is used, is there a maximum channel funding size?
>>>> Yes, the upper 32 bits must be zero, from BOLT #2:
>>>>
>>>>    - for channels with `chain_hash` identifying the Bitcoin
>>>> blockchain:
>>>>      - MUST set the four most significant bytes of `amount_msat` to 0.
>>>>
>>>> This gives a maximum HTLC value of .04294967295 BTC, which, back when
>>>> we started, was about $10.
>>>>
>>>
>>> What's the point of wasting the upper 32 bits? Seems like this is a
>>> waste of data?
>>>
>>> If you have the lower 32 bits of data to use, and
>>> 2^32=4,294,967,296, then you have 4,294,967,296 milli satoshis. 1
>>> BTC=10^11 milli satoshis, so 4,294,967,296 milli satoshis/((10^11
>>> milli satoshis)/1BTC) = 0.04294967296 BTC. That is off by 1 milli
>>> satoshi from what you say above. Why is this?
>>>
>>> Regardless of the discrepancy of 1 milli satoshi, it still seems
>>> like 0.04294967296 BTC is kind of a low maximum channel size for a
>>> lot of business applications. Why do you want to limit this when you
>>> have those extra 4 bytes set to zero? You think any more is too much
>>> to safely have in a hot wallet? You felt keeping it low will
>>> encourage decentralization? Something else?
>>>
>
> Yes, I believe Rusty did indeed consider 42mBTC as a reasonable amount
> to transfer on Lightning.  So that in case of trouble on Lightning,
> not a lot of money gets lost.  At the time he decided this 42mBTC
> limit, it was about 10 USD only, so Rusty could always just buy you a
> drink if he somehow causes c-lightning to lose that much.
>
> Of course, 42mBTC today is much larger.
>
> For myself, I think the channel limit of 167mBTC is good as it
> encourages decentralization by encouraging people to make many small
> channels than one large channel. Many small channels helps in keeping
> your funds resilient against temporary outages of your fellow nodes.

I understand what you are saying about decentralization, but is this really something that will be enforceable? Seems like people will just make an alt-lightning network layer with different limits to get around this, since there isn't really a consensus rule set like on the block chain to motivate them.

Quoted text (18 lines)
>
>>>
>>> Is the max HTLC value the same as the maximum channel size?
>>
>> Okay, so I may have discovered part of this answer to this question
>> in BOLT 2 where it says: "MUST set|funding_satoshis| to less than
>> 2^24 satoshi". However, I still don't understand the rational of why
>> |max ||funding_satoshis doesn't equal max |amount_msat, or where the
>> values of (2^24)*10^3 and 2^32 milli satoshis came from. Also, why
>> don't you use units of millisatoshis everywhere in the spec?
>> Sometimes it's satoshis and sometimes it's milli satoshis.
>>
>
> This is actually very simple. Everything that touches the chain
> (opening and closing) uses satoshis. Everything that does not, uses
> millisatoshis.  This is because the chain uses satoshis as the
> smallest amount.  Offchain, we can use millisatoshis, and it is used
> everywhere offchain.

Okay, the unit choices now make sense!

Quoted text (4 lines)
>
> Regards,
> ZmnSCPxj
>
ZmnSCPxj in reply to Andy Schroder permalink original

Good morning Andy,

Sent with [ProtonMail](https://protonmail.com) Secure Email.

Quoted text (44 lines)
> -------- Original Message --------
> Subject: Re: [Lightning-dev] General questions about channels
> Local Time: December 27, 2017 2:27 PM
> UTC Time: December 27, 2017 6:27 AM
> From: info at AndySchroder.com
> To: ZmnSCPxj <ZmnSCPxj at protonmail.com>
> Rusty Russell <rusty at rustcorp.com.au>, lightning-dev at lists.linuxfoundation.org <lightning-dev at lists.linuxfoundation.org>
>
> Andy Schroder
>
> On 12/27/2017 01:06 AM, ZmnSCPxj wrote:
>
>> Good morning Andy,
>>
>>> Andy Schroder
>>>
>>> On 12/27/2017 12:18 AM, Andy Schroder wrote:
>>>
>>>>> Channel closing
>>>>> costs dwarf the gains to be made from cheating, however.
>>>>>
>>>>>> Since millisatoshis is used, is there a maximum channel funding size?
>>>>>
>>>>> Yes, the upper 32 bits must be zero, from BOLT #2:
>>>>>
>>>>>    - for channels with `chain_hash` identifying the Bitcoin blockchain:
>>>>>      - MUST set the four most significant bytes of `amount_msat` to 0.
>>>>>
>>>>> This gives a maximum HTLC value of .04294967295 BTC, which, back when
>>>>> we started, was about $10.
>>>>
>>>> What's the point of wasting the upper 32 bits? Seems like this is a waste of data?
>>>>
>>>> If you have the lower 32 bits of data to use, and 2^32=4,294,967,296, then you have 4,294,967,296 milli satoshis. 1 BTC=10^11 milli satoshis, so 4,294,967,296 milli satoshis/((10^11 milli satoshis)/1BTC) = 0.04294967296 BTC. That is off by 1 milli satoshi from what you say above. Why is this?
>>>>
>>>> Regardless of the discrepancy of 1 milli satoshi, it still seems like 0.04294967296 BTC is kind of a low maximum channel size for a lot of business applications. Why do you want to limit this when you have those extra 4 bytes set to zero? You think any more is too much to safely have in a hot wallet? You felt keeping it low will encourage decentralization? Something else?
>>
>> Yes, I believe Rusty did indeed consider 42mBTC as a reasonable amount to transfer on Lightning.  So that in case of trouble on Lightning, not a lot of money gets lost.  At the time he decided this 42mBTC limit, it was about 10 USD only, so Rusty could always just buy you a drink if he somehow causes c-lightning to lose that much.
>>
>> Of course, 42mBTC today is much larger.
>>
>> For myself, I think the channel limit of 167mBTC is good as it encourages decentralization by encouraging people to make many small channels than one large channel. Many small channels helps in keeping your funds resilient against temporary outages of your fellow nodes.
>
> I understand what you are saying about decentralization, but is this really something that will be enforceable? Seems like people will just make an alt-lightning network layer with different limits to get around this, since there isn't really a consensus rule set like on the block chain to motivate them.

If I run a node which refuses the higher limits, then:

1. The alt-lightning network node cannot channel to me directly to unless they accept my channel size limit. (they will have to channel through a node that will accept my channel size limit and also accept their increased channel size limit, or just never open a channel to me greater than 167mBTC).
2.  The alt-lightning network node cannot route through me unless they accept my payment size (HTLC size) limit.
3.  I won't route through the alt-lightning network for any value greater than my payment size limit.

Making Lightning software work is difficult, and given the above constraints it will not be as easy as "just remove the limit-checking code" - the alt-lightning network node software is strictly more complicated as it has to check if it is using or creating a channel that has the existing limits imposed or not: indeed, if most of the existing network uses the existing limits, then the alt-lightning node is still practically limited to the 42mBTC limit when routing through the existing network (and the alt-lightning network might not be big enough to find routes through only the alt-lightning nodes - if it has to pass through even one legacy node imposing the 42mBTC limit, then the payment is automatically limited by that node). One might compare the supposedly simple "just change the constant to 2x its value" attempted by 2X, when in reality what happens is the more complicated "change the constant to a variable that has the old value on or before before block N and a new value on or after block N+1", which also failed rather spectacularly due to off-by-one error..

Indeed, such a "whale Lightning network" might be feasible if all the whales channel with each other, but at some point they will have to pay some hoi polloi node imposing the 42mBTC limit. If I am not a whale and will not be able to send or receive large amounts of bitcoin anyway, I have no real incentive to run a whalenode whose expanded capabilities I would not be able to utilize anyway. Further, wise whales will keep most of their money in cold storage and only put small spending amounts on hot wallets, which Lightning nodes most definitely are, since they keep the keys on an online computer; there is still no incentive to run a whalenode either.

So it might be that one day we will remove the limit and find that nobody in practice uses the expanded capacity either.

Quoted text (1 line)
> It seems like you are making assumptions about the purchasing power of certain cryptocurrencies. Why even bother doing this? You have no idea what the future holds. Why set a limit for any cryptocurrency that might use lightning?

Well, the truth of the matter is that originally, the field was 32-bit and not 64-bit. Rusty decided that the 42mBTC limit this imposed was A-OK since it would limit the risk involved if payments get stuck to about 10USD at the time, and so on.

When Rusty & friends made a "Litening" network node (Lightning on Litecoin) 32-bits was not enough for anything practical, since 0.042LTC is really low in value. So the field was expanded to 64-bit, but for BTC the 42mBTC limit was still imposed by requiring, for BTC only, that the upper 32-bits be 0.

Similar for the channel limit (it was originally 24-bit only, and was expanded for Litening and the original limit re-imposed specifically for BTC).

Quoted text (3 lines)
> Even if you are right about the purchasing power of a particular cryptocurrency, why is a limit needed at all? If I have an high, bi weekly paid salary, and I have a low budget lifestyle, let's say I save 90% of my income. It seems like your assumed limits could require multiple payments and multiple open channels for each bi weekly payment. What if I want to buy a boat, do you expect me to make payments from a lot of different channels? I was kind of under the assumption that the long term goal of lightning was only to have a few on chain payments per human per year.
>
> Or, are you just worried right now because lightning isn't well tested?

Partially this, also. Lightning is still alpha-level to beta-level software and we want to "start soft". Perhaps some day, in the LONG TERM, the limits may be increased (but in practice it will take time before all nodes upgrade to higher limits, and the existing channels will have to be re-consolidated and so on).

There is also again the wisdom, that one should keep most of the funds in cold storage, and only a small amount for spending in hot wallets like Lightning nodes; presumably, rare purchases of boats (which I doubt you would want to buy daily) would be doable on-chain straight from cold storage, even with just "a few on chain payments per human per year" - even really rich people are likely to buy at a rate of one new car and/or one new boat each year because seriously what would you do with it, so that is still "a few on chain transactions per year".

As for salary accumulation - well indeed, perhaps a higher channel limit would be useful here, but again maybe after a few months you might want to withdraw to cold storage - as a hot wallet any unexpected 0-days of Lightning software, the hardware you run on, and the operating system you run on, might lose you several months' worth of salary if you kept it on Lightning. You might prefer to receive your salary once a month, put the first month into Lightning and the succeeding months directly into cold storage, until you need to replenish your Lightning funds for groceries. And so on. Perhaps salary-conversion services (since governments are likely to require your salary be denominated in the local fiat because government) would replenish part of your Lightning funds for you, then forward the rest to your cold storage.

Quoted text (3 lines)
>> A single payment can be up to 0.04294967295, but a channel is up to 0.16777215.
>
> Okay, so why bother making these two amounts different?

Why should they be the same? Should not the channel be able to survive one or two or three 0.042 payments, so the channel limit being 0.167 is just shy of being able to fit 4 max-size payments through it?

If the two limits were the same, then in practice nobody could use the maximum payment limit. One must also factor in the "channel reserve" and the fact that most of the time it is likely that the channel will be in a "halfway" state between the two nodes (i.e. about 83.88mBTC each). So it is sensible to make the channel limit higher than the payment limit, so that in practice many max-size payments will go through.

Quoted text (3 lines)
> <snip push_msat>
>
> Okay, so all this feature is doing is saving the extra step of making an initial payment? Just saving a little time, and not a monumental or required feature?

Yes. Indeed to my knowledge no current LN software implements non-zero push_msat. It might be useful, it might not be. The option is there and is supported, especially since support for it is relatively trivial (one only need adjust the initial commitment transactions).

We are a lot less strict about channel opening message bloat as channel opening is expected to be a rare event, so optimizing these "wasted always 0 bytes" in the channel opening messages is not a high priority. Gossip messages are more likely to be strictly optimized.

Regards, ZmnSCPxj

Daniel McNally in reply to ZmnSCPxj permalink original

I've only really been getting my hands into LN the past few weeks but I thought I'd share my thoughts here.

ZmnSCPxj via Lightning-dev <lightning-dev at lists.linuxfoundation.org> wrote:

Quoted text (1 line)
> Perhaps some day, in the LONG TERM, the limits may be increased

I was always under the impression that the channel and payment limits were intended to be training wheels, this is the first I've heard of them intended to stick around long term. I find the channel limit to be particularly restrictive, as it hinders some use cases I'd envision where large payment channels between two parties are useful and can also be used for routing LN payments. Large payments afaik can be broken up into smaller ones without incurring too much cost or trouble, but that's not the case for creating channels. As the channel itself involves only two parties - and in sticking to my general political/philosophical mantra - there is really no justification for limits to be imposed on this. Which brings me to my next point.

Quoted text (7 lines)
> If I run a node which refuses the higher limits, then:
>
> 1. The alt-lightning network node cannot channel to me directly to unless
> they accept my channel size limit. (they will have to channel through a node
> that will accept my channel size limit and also accept their increased
> channel size limit, or just never open a channel to me greater than
> 167mBTC).

The parenthetical here is correct. If nodes A and B have huge channels between each other, they can still be totally compatible with the rest of the network as long as they don't try exceeding the channel limit with nodes that won't accept it. In practice, "whales" will quite easily be able to run their own rules with regards to these limits and I think that is a good thing.

Quoted text (3 lines)
> There is also again the wisdom, that one should keep most of the funds in
> cold storage, and only a small amount for spending in hot wallets like
> Lightning nodes

I think this is a top-down way of thinking that runs counter to the spirit of bitcoin. The "wisest" thing to do in fact may be to simply buy inflation-adjusted treasury bonds and not mess with bitcoin at all, much less the experimental lightning network. As advice this is perfectly fine to share with others for them to follow on a voluntary basis, but I don't see why this ought to be enforced as a rule on a protocol level.

Also, I personally can't see a reason why a node would reject a large channel being made with it, where is the downside or risk? The party committing funds to the channel is the one risking loss or delay of funds.

Quoted text (2 lines)
> Yes.  Indeed to my knowledge no current LN software implements non-zero
> push_msat

As an aside, I believe push_sat is implemented by LND.

Anyway, I think these limits are fine for LN's baby steps, but overly restrictive for a mature LN network. Ideally I believe I'd want these limits to be non-existent or configurable by nodes (and announced to peers), but maybe I am missing some technical reasons why such an approach would be challenging. Either way I expect I'll be among the first to run software with less restrictive limits when LN's training wheels are ready to come off.

Thanks for the discussion and for your work on LN.

Daniel

ZmnSCPxj in reply to Daniel McNally permalink original

Good morning Daniel,

Quoted text (23 lines)
> -------- Original Message --------
> Subject: Re: [Lightning-dev] General questions about channels
> Local Time: December 27, 2017 10:30 PM
> UTC Time: December 27, 2017 2:30 PM
> From: therealsangaman at gmail.com
> To: ZmnSCPxj <ZmnSCPxj at protonmail.com>
> Andy Schroder <info at andyschroder.com>, lightning-dev at lists.linuxfoundation.org <lightning-dev at lists.linuxfoundation.org>
>
> I've only really been getting my hands into LN the past few weeks but
> I thought I'd share my thoughts here.
>
> ZmnSCPxj via Lightning-dev lightning-dev at lists.linuxfoundation.org wrote:
>
>> Perhaps some day, in the LONG TERM, the limits may be increased
>
> I was always under the impression that the channel and payment limits
> were intended to be training wheels, this is the first I've heard of
> them intended to stick around long term. I find the channel limit to
> be particularly restrictive, as it hinders some use cases I'd envision
> where large payment channels between two parties are useful and can
> also be used for routing LN payments. Large payments afaik can be
> broken up into smaller ones without incurring too much cost or
> trouble,

Splitting up large payments would require multiple invoices at least for now (whether this is troublesome or not may be a matter of opinion, bit I suspect juggling more than a few invoices would be painful as a user experience). Routing larger payments over multiple routes automatically while using a single invoice, is harder as multiple routes need to be set up, and each route must have different preimages: further it is likely you want the entire large payment to be done atomically, which would be harder to arrange.

Quoted text (4 lines)
> but that's not the case for creating channels. As the channel
> itself involves only two parties - and in sticking to my general
> political/philosophical mantra - there is really no justification for
> limits to be imposed on this. Which brings me to my next point.

Perhaps our definition of "long term" is askew. A year after mainnet release, I doubt anyone would feel safe implementing removal of the limit; this is my "long term". Five years, I imagine quite a few will use the nonlimited version and may form a subnetwork among themselves. But possibly by then it would be unlikely that most people using Bitcoin at all would evem be capable of putting 150 mBTC in spending money on a hot wallet, in which case whether there is a 167 mBTC limit per channel or not is largely a moot point. Or perhaps I simply imagine hyperbitcoinization by then, with people putting entire bitcoins into hot wallets equivalent to people putting thousands of USD today in their back pockets as invitation to be attacked.

Quoted text (13 lines)
>
>
>> There is also again the wisdom, that one should keep most of the funds in
>> cold storage, and only a small amount for spending in hot wallets like
>> Lightning nodes
>
> I think this is a top-down way of thinking that runs counter to the
> spirit of bitcoin. The "wisest" thing to do in fact may be to simply
> buy inflation-adjusted treasury bonds and not mess with bitcoin at
> all, much less the experimental lightning network. As advice this is
> perfectly fine to share with others for them to follow on a voluntary
> basis, but I don't see why this ought to be enforced as a rule on a
> protocol level.

Possibly. At the protocol level, a limit encourages the growth of the network towards a mesh network rather than more central forms, however. I merely put this since it is unlikely that most people following this "wisdom" would have an incentive to even run software with the limit removed: that is, by the time Lightning becomes fully deployed the limit may not even be reached in practice.

Quoted text (5 lines)
>
> Also, I personally can't see a reason why a node would reject a large
> channel being made with it, where is the downside or risk? The party
> committing funds to the channel is the one risking loss or delay of
> funds.

But the party committing funds to the channel is known via node gossip, and it is known also who the other end of the channel is. If you were to propose opening for example a 5BTC channel to me with the funds coming from you, I would consider the possibility that I might get attacked in order to get to your funds (and I might not have the resources to protect against such an attack on my end, even if you might). Further, putting 5BTC implies that at some point there is the future possibility, due to routing and so on, that the channel will have around 5BTC belonging to me, and at some point before you can spend the entire 5BTC I would want to close the channel and commit the funds that I now own into cold storage (so that the ability to channel 5BTC from you to me is a moot point).

Regards, ZmnSCPxj

Mark F in reply to ZmnSCPxj permalink original

Splitting a single payment into multiple invoices has bad semantic properties. Beyond implementation difficulties it also makes the payment no longer atomic. You can end up in a situation where part of a transaction has gone through but then channel capacity has been exhausted. The. What do you do?

While an annoying (and potentially exploitable) edge case for payments, it also makes it basically impossible in practice to build higher level smart contracts on top of lightning channels as primitives, since those constructs typically use a single HTLC revelation as the decision gate between multiple contingent outcomes.

I had always assumed the protocol limits were training wheels, and would be shocked and dismayed if that were not the case (and would immediately begin work on an alternative fork because such limits would make lightning useless for my intended applications).

On the topic of cold storage, I think perhaps that is less of a settled issue than you take for granted. I think the value proposition of bitcoin is exactly its ability to serve as non custodial collateral and I do not anticipate a future where large portions of the bitcoin monetary base are not held as collateral in smart contract payment channels. Indeed I would consider that a failure mode both worth designing for...

Quoted text (71 lines)
> On Dec 27, 2017, at 12:13 PM, ZmnSCPxj via Lightning-dev <lightning-dev at lists.linuxfoundation.org> wrote:
>
> Good morning Daniel,
>
>
>
>> -------- Original Message --------
>> Subject: Re: [Lightning-dev] General questions about channels
>> Local Time: December 27, 2017 10:30 PM
>> UTC Time: December 27, 2017 2:30 PM
>> From: therealsangaman at gmail.com
>> To: ZmnSCPxj <ZmnSCPxj at protonmail.com>
>> Andy Schroder <info at andyschroder.com>, lightning-dev at lists.linuxfoundation.org <lightning-dev at lists.linuxfoundation.org>
>>
>> I've only really been getting my hands into LN the past few weeks but
>> I thought I'd share my thoughts here.
>>
>> ZmnSCPxj via Lightning-dev lightning-dev at lists.linuxfoundation.org wrote:
>> Perhaps some day, in the LONG TERM, the limits may be increased
>>
>> I was always under the impression that the channel and payment limits
>> were intended to be training wheels, this is the first I've heard of
>> them intended to stick around long term. I find the channel limit to
>> be particularly restrictive, as it hinders some use cases I'd envision
>> where large payment channels between two parties are useful and can
>> also be used for routing LN payments. Large payments afaik can be
>> broken up into smaller ones without incurring too much cost or
>> trouble,
>
> Splitting up large payments would require multiple invoices at least for now (whether this is troublesome or not may be a matter of opinion, bit I suspect juggling more than a few invoices would be painful as a user experience). Routing larger payments over multiple routes automatically while using a single invoice, is harder as multiple routes need to be set up, and each route must have different preimages: further it is likely you want the entire large payment to be done atomically, which would be harder to arrange.
>
>> but that's not the case for creating channels. As the channel
>> itself involves only two parties - and in sticking to my general
>> political/philosophical mantra - there is really no justification for
>> limits to be imposed on this. Which brings me to my next point.
>>
>
> Perhaps our definition of "long term" is askew. A year after mainnet release, I doubt anyone would feel safe implementing removal of the limit; this is my "long term".  Five years, I imagine quite a few will use the nonlimited version and may form a subnetwork among themselves.  But possibly by then it would be unlikely that most people using Bitcoin at all would evem be capable of putting 150 mBTC in spending money on a hot wallet, in which case whether there is a 167 mBTC limit per channel or not is largely a moot point. Or perhaps I simply imagine hyperbitcoinization by then, with people putting entire bitcoins into hot wallets equivalent to people putting thousands of USD today in their back pockets as invitation to be attacked.
>
>>
>> There is also again the wisdom, that one should keep most of the funds in
>> cold storage, and only a small amount for spending in hot wallets like
>> Lightning nodes
>>
>> I think this is a top-down way of thinking that runs counter to the
>> spirit of bitcoin. The "wisest" thing to do in fact may be to simply
>> buy inflation-adjusted treasury bonds and not mess with bitcoin at
>> all, much less the experimental lightning network. As advice this is
>> perfectly fine to share with others for them to follow on a voluntary
>> basis, but I don't see why this ought to be enforced as a rule on a
>> protocol level.
>>
>
> Possibly.  At the protocol level, a limit encourages the growth of the network towards a mesh network rather than more central forms, however.  I merely put this since it is unlikely that most people following this "wisdom" would have an incentive to even run software with the limit removed: that is, by the time Lightning becomes fully deployed the limit may not even be reached in practice.
>
>>
>> Also, I personally can't see a reason why a node would reject a large
>> channel being made with it, where is the downside or risk? The party
>> committing funds to the channel is the one risking loss or delay of
>> funds.
>>
>
> But the party committing funds to the channel is known via node gossip, and it is known also who the other end of the channel is. If you were to propose opening for example a 5BTC channel to me with the funds coming from you, I would consider the possibility that I might get attacked in order to get to your funds (and I might not have the resources to protect against such an attack on my end, even if you might). Further, putting 5BTC implies that at some point there is the future possibility, due to routing and so on, that the channel will have around 5BTC belonging to me, and at some point before you can spend the entire 5BTC I would want to close the channel and commit the funds that I now own into cold storage (so that the ability to channel 5BTC from you to me is a moot point).
>
>
> Regards,
> ZmnSCPxj
> _______________________________________________
> Lightning-dev mailing list
> Lightning-dev at lists.linuxfoundation.org
> https://www.learnbitcoin.com/archive/lists/lightning-dev
Christian Decker in reply to Mark F permalink original

Mark Friedenbach <mark at friedenbach.org> writes:

Quoted text (5 lines)
> Splitting a single payment into multiple invoices has bad semantic
> properties. Beyond implementation difficulties it also makes the
> payment no longer atomic. You can end up in a situation where part of
> a transaction has gone through but then channel capacity has been
> exhausted. The. What do you do?

We are indeed working on a solution for multipath payments, and they are pretty simple to implement if the sender and recipient know how to handle them. Re-use the same HTLC secret along all paths and the atomicity is re-established. The only blocker is that it increases complexity on the recipient, e.g., how do I tell whether the partial payment is all I'll ever get, or whether there is more incoming, when do I abort waiting, and similar concerns. That's the reason it didn't make it into the v1.0 spec, but we are confident that it'll be added soon.

It is technically already possible to do so, if you hack together the recipient node to wait for all parts of the payment before releasing the secret. No need for multiple invoices.

Quoted text (5 lines)
> While an annoying (and potentially exploitable) edge case for
> payments, it also makes it basically impossible in practice to build
> higher level smart contracts on top of lightning channels as
> primitives, since those constructs typically use a single HTLC
> revelation as the decision gate between multiple contingent outcomes.

Absolutely, that's why we want to have the payment contingent on a single secret, or on secrets that can be derived from one another.

Quoted text (4 lines)
> I had always assumed the protocol limits were training wheels, and
> would be shocked and dismayed if that were not the case (and would
> immediately begin work on an alternative fork because such limits
> would make lightning useless for my intended applications).

They are training wheels, we just decided for our own implementations that we want to limit individual potential losses due to bugs. It is trivial to change that on a per-channel level, and we have all the pieces in place to perform an upgrade using the feature bits, no need to fork lightning just yet :-) You just need to agree on using larger amounts with your peer, on the peer layer, there is nothing preventing the use of large channels in the multi-hop layer.

HTH, Christian

Andy Schroder in reply to ZmnSCPxj permalink original

Hello,

Thanks for all of the discussion on this topic. In general, I don't have a solid opinion formed yet, but I understand all of the points that everyone has made. I think the bottom line is that a limit doesn't hurt right now unless the purchasing power of bitcoin dramatically declines. This limit is like the block size limit in that it is conservative and we need to have some experience in order to determine whether the limit is needed at all. It proved to be very clear over time that a block size limit was needed as one force against centralization. Maybe a limit is needed for lightning channels, maybe it isn't, but we need to first see how the network starts to evolve. My main concern long term is that a large business couldn't operate using lightning, because the channel sizes and payment sizes are too small. What if you're buying an oil rig, a locomotive, a gas turbine, a load of coal, or a herd of cattle. Should a blockchain transaction be used for everyone in the world for these types of purchases? But then again, maybe different types of users will use different kinds of lightning networks.

Another reason against accepting large incoming channels yourself would be that you may not want to encourage people paying you to route through one of the super nodes. Super nodes are likely spies or targets of spies and users won't naturally want to deal with those types of actors.

Also, the Eclair implementation supports push_msat too.

Other than as "training wheels", I'm still not sure why we need a payment limit if we have a channel limit. It seems as though the channel limit puts an implicit payment limit in place.

Andy Schroder

On 12/27/2017 03:13 PM, ZmnSCPxj wrote:

Quoted text (106 lines)
> Good morning Daniel,
>
>
>
>> -------- Original Message --------
>> Subject: Re: [Lightning-dev] General questions about channels
>> Local Time: December 27, 2017 10:30 PM
>> UTC Time: December 27, 2017 2:30 PM
>> From: therealsangaman at gmail.com
>> To: ZmnSCPxj <ZmnSCPxj at protonmail.com>
>> Andy Schroder <info at andyschroder.com>,
>> lightning-dev at lists.linuxfoundation.org
>> <lightning-dev at lists.linuxfoundation.org>
>>
>> I've only really been getting my hands into LN the past few weeks but
>> I thought I'd share my thoughts here.
>>
>> ZmnSCPxj via Lightning-dev lightning-dev at lists.linuxfoundation.org
>> <mailto:lightning-dev at lists.linuxfoundation.org> wrote:
>>
>>     Perhaps some day, in the LONG TERM, the limits may be increased
>>
>>
>> I was always under the impression that the channel and payment limits
>> were intended to be training wheels, this is the first I've heard of
>> them intended to stick around long term. I find the channel limit to
>> be particularly restrictive, as it hinders some use cases I'd envision
>> where large payment channels between two parties are useful and can
>> also be used for routing LN payments. Large payments afaik can be
>> broken up into smaller ones without incurring too much cost or
>> trouble,
>
> Splitting up large payments would require multiple invoices at least
> for now (whether this is troublesome or not may be a matter of
> opinion, bit I suspect juggling more than a few invoices would be
> painful as a user experience). Routing larger payments over multiple
> routes automatically while using a single invoice, is harder as
> multiple routes need to be set up, and each route must have different
> preimages: further it is likely you want the entire large payment to
> be done atomically, which would be harder to arrange.
>
>> but that's not the case for creating channels. As the channel
>> itself involves only two parties - and in sticking to my general
>> political/philosophical mantra - there is really no justification for
>> limits to be imposed on this. Which brings me to my next point.
>>
>
> Perhaps our definition of "long term" is askew. A year after mainnet
> release, I doubt anyone would feel safe implementing removal of the
> limit; this is my "long term".  Five years, I imagine quite a few will
> use the nonlimited version and may form a subnetwork among
> themselves.  But possibly by then it would be unlikely that most
> people using Bitcoin at all would evem be capable of putting 150 mBTC
> in spending money on a hot wallet, in which case whether there is a
> 167 mBTC limit per channel or not is largely a moot point. Or perhaps
> I simply imagine hyperbitcoinization by then, with people putting
> entire bitcoins into hot wallets equivalent to people putting
> thousands of USD today in their back pockets as invitation to be attacked.
>
>>
>>     There is also again the wisdom, that one should keep most of the
>>     funds in
>>     cold storage, and only a small amount for spending in hot wallets
>>     like
>>     Lightning nodes
>>
>>
>> I think this is a top-down way of thinking that runs counter to the
>> spirit of bitcoin. The "wisest" thing to do in fact may be to simply
>> buy inflation-adjusted treasury bonds and not mess with bitcoin at
>> all, much less the experimental lightning network. As advice this is
>> perfectly fine to share with others for them to follow on a voluntary
>> basis, but I don't see why this ought to be enforced as a rule on a
>> protocol level.
>>
>
> Possibly.  At the protocol level, a limit encourages the growth of the
> network towards a mesh network rather than more central forms,
> however.  I merely put this since it is unlikely that most people
> following this "wisdom" would have an incentive to even run software
> with the limit removed: that is, by the time Lightning becomes fully
> deployed the limit may not even be reached in practice.
>
>>
>> Also, I personally can't see a reason why a node would reject a large
>> channel being made with it, where is the downside or risk? The party
>> committing funds to the channel is the one risking loss or delay of
>> funds.
>>
>
> But the party committing funds to the channel is known via node
> gossip, and it is known also who the other end of the channel is. If
> you were to propose opening for example a 5BTC channel to me with the
> funds coming from you, I would consider the possibility that I might
> get attacked in order to get to your funds (and I might not have the
> resources to protect against such an attack on my end, even if you
> might). Further, putting 5BTC implies that at some point there is the
> future possibility, due to routing and so on, that the channel will
> have around 5BTC belonging to me, and at some point before you can
> spend the entire 5BTC I would want to close the channel and commit the
> funds that I now own into cold storage (so that the ability to channel
> 5BTC from you to me is a moot point).
>
>
> Regards,
> ZmnSCPxj
Christian Decker in reply to Andy Schroder permalink original

Hi Andy,

just one minor point regarding your comparison with the bitcoin block size: while the bitcoin block size is a consensus critical parameter that cannot be modified without every participant agreeing, the capacity limit is not consensus critical and can be changed at any point in time. It can be negotiated by the two endpoints of a channel and no other party is involved.

I quite like the comparison to training wheels, it's there as long as you don't feel safe, and you can get rid of them once you're confidence in the system and yourself increases :-)

Cheers, Christian

Andy Schroder <info at AndySchroder.com> writes:

Quoted text (144 lines)
> Hello,
>
> Thanks for all of the discussion on this topic. In general, I don't have
> a solid opinion formed yet, but I understand all of the points that
> everyone has made. I think the bottom line is that a limit doesn't hurt
> right now unless the purchasing power of bitcoin dramatically declines.
> This limit is like the block size limit in that it is conservative and
> we need to have some experience in order to determine whether the limit
> is needed at all. It proved to be very clear over time that a block size
> limit was needed as one force against centralization. Maybe a limit is
> needed for lightning channels, maybe it isn't, but we need to first see
> how the network starts to evolve. My main concern long term is that a
> large business couldn't operate using lightning, because the channel
> sizes and payment sizes are too small. What if you're buying an oil rig,
> a locomotive, a gas turbine, a load of coal, or a herd of cattle. Should
> a blockchain transaction be used for everyone in the world for these
> types of purchases? But then again, maybe different types of users will
> use different kinds of lightning networks.
>
> Another reason against accepting large incoming channels yourself would
> be that you may not want to encourage people paying you to route through
> one of the super nodes. Super nodes are likely spies or targets of spies
> and users won't naturally want to deal with those types of actors.
>
> Also, the Eclair implementation supports push_msat too.
>
> Other than as "training wheels", I'm still not sure why we need a
> payment limit if we have a channel limit. It seems as though the channel
> limit puts an implicit payment limit in place.
>
> Andy Schroder
>
> On 12/27/2017 03:13 PM, ZmnSCPxj wrote:
>> Good morning Daniel,
>>
>>
>>
>>> -------- Original Message --------
>>> Subject: Re: [Lightning-dev] General questions about channels
>>> Local Time: December 27, 2017 10:30 PM
>>> UTC Time: December 27, 2017 2:30 PM
>>> From: therealsangaman at gmail.com
>>> To: ZmnSCPxj <ZmnSCPxj at protonmail.com>
>>> Andy Schroder <info at andyschroder.com>,
>>> lightning-dev at lists.linuxfoundation.org
>>> <lightning-dev at lists.linuxfoundation.org>
>>>
>>> I've only really been getting my hands into LN the past few weeks but
>>> I thought I'd share my thoughts here.
>>>
>>> ZmnSCPxj via Lightning-dev lightning-dev at lists.linuxfoundation.org
>>> <mailto:lightning-dev at lists.linuxfoundation.org> wrote:
>>>
>>>     Perhaps some day, in the LONG TERM, the limits may be increased
>>>
>>>
>>> I was always under the impression that the channel and payment limits
>>> were intended to be training wheels, this is the first I've heard of
>>> them intended to stick around long term. I find the channel limit to
>>> be particularly restrictive, as it hinders some use cases I'd envision
>>> where large payment channels between two parties are useful and can
>>> also be used for routing LN payments. Large payments afaik can be
>>> broken up into smaller ones without incurring too much cost or
>>> trouble,
>>
>> Splitting up large payments would require multiple invoices at least
>> for now (whether this is troublesome or not may be a matter of
>> opinion, bit I suspect juggling more than a few invoices would be
>> painful as a user experience). Routing larger payments over multiple
>> routes automatically while using a single invoice, is harder as
>> multiple routes need to be set up, and each route must have different
>> preimages: further it is likely you want the entire large payment to
>> be done atomically, which would be harder to arrange.
>>
>>> but that's not the case for creating channels. As the channel
>>> itself involves only two parties - and in sticking to my general
>>> political/philosophical mantra - there is really no justification for
>>> limits to be imposed on this. Which brings me to my next point.
>>>
>>
>> Perhaps our definition of "long term" is askew. A year after mainnet
>> release, I doubt anyone would feel safe implementing removal of the
>> limit; this is my "long term".  Five years, I imagine quite a few will
>> use the nonlimited version and may form a subnetwork among
>> themselves.  But possibly by then it would be unlikely that most
>> people using Bitcoin at all would evem be capable of putting 150 mBTC
>> in spending money on a hot wallet, in which case whether there is a
>> 167 mBTC limit per channel or not is largely a moot point. Or perhaps
>> I simply imagine hyperbitcoinization by then, with people putting
>> entire bitcoins into hot wallets equivalent to people putting
>> thousands of USD today in their back pockets as invitation to be attacked.
>>
>>>
>>>     There is also again the wisdom, that one should keep most of the
>>>     funds in
>>>     cold storage, and only a small amount for spending in hot wallets
>>>     like
>>>     Lightning nodes
>>>
>>>
>>> I think this is a top-down way of thinking that runs counter to the
>>> spirit of bitcoin. The "wisest" thing to do in fact may be to simply
>>> buy inflation-adjusted treasury bonds and not mess with bitcoin at
>>> all, much less the experimental lightning network. As advice this is
>>> perfectly fine to share with others for them to follow on a voluntary
>>> basis, but I don't see why this ought to be enforced as a rule on a
>>> protocol level.
>>>
>>
>> Possibly.  At the protocol level, a limit encourages the growth of the
>> network towards a mesh network rather than more central forms,
>> however.  I merely put this since it is unlikely that most people
>> following this "wisdom" would have an incentive to even run software
>> with the limit removed: that is, by the time Lightning becomes fully
>> deployed the limit may not even be reached in practice.
>>
>>>
>>> Also, I personally can't see a reason why a node would reject a large
>>> channel being made with it, where is the downside or risk? The party
>>> committing funds to the channel is the one risking loss or delay of
>>> funds.
>>>
>>
>> But the party committing funds to the channel is known via node
>> gossip, and it is known also who the other end of the channel is. If
>> you were to propose opening for example a 5BTC channel to me with the
>> funds coming from you, I would consider the possibility that I might
>> get attacked in order to get to your funds (and I might not have the
>> resources to protect against such an attack on my end, even if you
>> might). Further, putting 5BTC implies that at some point there is the
>> future possibility, due to routing and so on, that the channel will
>> have around 5BTC belonging to me, and at some point before you can
>> spend the entire 5BTC I would want to close the channel and commit the
>> funds that I now own into cold storage (so that the ability to channel
>> 5BTC from you to me is a moot point).
>>
>>
>> Regards,
>> ZmnSCPxj
>
> _______________________________________________
> Lightning-dev mailing list
> Lightning-dev at lists.linuxfoundation.org
> https://www.learnbitcoin.com/archive/lists/lightning-dev
Andy Schroder in reply to Christian Decker permalink original

Hello Christian,

I understand that you have to be in agreement with your direct peers. So you don't really care about what agreements others in your route may have in place? I would think that you would choose not to route through hops that violate your capacity limit.

Andy Schroder

On 12/30/2017 06:14 PM, Christian Decker wrote:

Quoted text (154 lines)
> Hi Andy,
>
> just one minor point regarding your comparison with the bitcoin block
> size: while the bitcoin block size is a consensus critical parameter
> that cannot be modified without every participant agreeing, the capacity
> limit is not consensus critical and can be changed at any point in
> time. It can be negotiated by the two endpoints of a channel and no
> other party is involved.
>
> I quite like the comparison to training wheels, it's there as long as
> you don't feel safe, and you can get rid of them once you're confidence
> in the system and yourself increases :-)
>
> Cheers,
> Christian
>
> Andy Schroder <info at AndySchroder.com> writes:
>> Hello,
>>
>> Thanks for all of the discussion on this topic. In general, I don't have
>> a solid opinion formed yet, but I understand all of the points that
>> everyone has made. I think the bottom line is that a limit doesn't hurt
>> right now unless the purchasing power of bitcoin dramatically declines.
>> This limit is like the block size limit in that it is conservative and
>> we need to have some experience in order to determine whether the limit
>> is needed at all. It proved to be very clear over time that a block size
>> limit was needed as one force against centralization. Maybe a limit is
>> needed for lightning channels, maybe it isn't, but we need to first see
>> how the network starts to evolve. My main concern long term is that a
>> large business couldn't operate using lightning, because the channel
>> sizes and payment sizes are too small. What if you're buying an oil rig,
>> a locomotive, a gas turbine, a load of coal, or a herd of cattle. Should
>> a blockchain transaction be used for everyone in the world for these
>> types of purchases? But then again, maybe different types of users will
>> use different kinds of lightning networks.
>>
>> Another reason against accepting large incoming channels yourself would
>> be that you may not want to encourage people paying you to route through
>> one of the super nodes. Super nodes are likely spies or targets of spies
>> and users won't naturally want to deal with those types of actors.
>>
>> Also, the Eclair implementation supports push_msat too.
>>
>> Other than as "training wheels", I'm still not sure why we need a
>> payment limit if we have a channel limit. It seems as though the channel
>> limit puts an implicit payment limit in place.
>>
>> Andy Schroder
>>
>> On 12/27/2017 03:13 PM, ZmnSCPxj wrote:
>>> Good morning Daniel,
>>>
>>>
>>>
>>>> -------- Original Message --------
>>>> Subject: Re: [Lightning-dev] General questions about channels
>>>> Local Time: December 27, 2017 10:30 PM
>>>> UTC Time: December 27, 2017 2:30 PM
>>>> From: therealsangaman at gmail.com
>>>> To: ZmnSCPxj <ZmnSCPxj at protonmail.com>
>>>> Andy Schroder <info at andyschroder.com>,
>>>> lightning-dev at lists.linuxfoundation.org
>>>> <lightning-dev at lists.linuxfoundation.org>
>>>>
>>>> I've only really been getting my hands into LN the past few weeks but
>>>> I thought I'd share my thoughts here.
>>>>
>>>> ZmnSCPxj via Lightning-dev lightning-dev at lists.linuxfoundation.org
>>>> <mailto:lightning-dev at lists.linuxfoundation.org> wrote:
>>>>
>>>>      Perhaps some day, in the LONG TERM, the limits may be increased
>>>>
>>>>
>>>> I was always under the impression that the channel and payment limits
>>>> were intended to be training wheels, this is the first I've heard of
>>>> them intended to stick around long term. I find the channel limit to
>>>> be particularly restrictive, as it hinders some use cases I'd envision
>>>> where large payment channels between two parties are useful and can
>>>> also be used for routing LN payments. Large payments afaik can be
>>>> broken up into smaller ones without incurring too much cost or
>>>> trouble,
>>> Splitting up large payments would require multiple invoices at least
>>> for now (whether this is troublesome or not may be a matter of
>>> opinion, bit I suspect juggling more than a few invoices would be
>>> painful as a user experience). Routing larger payments over multiple
>>> routes automatically while using a single invoice, is harder as
>>> multiple routes need to be set up, and each route must have different
>>> preimages: further it is likely you want the entire large payment to
>>> be done atomically, which would be harder to arrange.
>>>
>>>> but that's not the case for creating channels. As the channel
>>>> itself involves only two parties - and in sticking to my general
>>>> political/philosophical mantra - there is really no justification for
>>>> limits to be imposed on this. Which brings me to my next point.
>>>>
>>> Perhaps our definition of "long term" is askew. A year after mainnet
>>> release, I doubt anyone would feel safe implementing removal of the
>>> limit; this is my "long term".  Five years, I imagine quite a few will
>>> use the nonlimited version and may form a subnetwork among
>>> themselves.  But possibly by then it would be unlikely that most
>>> people using Bitcoin at all would evem be capable of putting 150 mBTC
>>> in spending money on a hot wallet, in which case whether there is a
>>> 167 mBTC limit per channel or not is largely a moot point. Or perhaps
>>> I simply imagine hyperbitcoinization by then, with people putting
>>> entire bitcoins into hot wallets equivalent to people putting
>>> thousands of USD today in their back pockets as invitation to be attacked.
>>>
>>>>      There is also again the wisdom, that one should keep most of the
>>>>      funds in
>>>>      cold storage, and only a small amount for spending in hot wallets
>>>>      like
>>>>      Lightning nodes
>>>>
>>>>
>>>> I think this is a top-down way of thinking that runs counter to the
>>>> spirit of bitcoin. The "wisest" thing to do in fact may be to simply
>>>> buy inflation-adjusted treasury bonds and not mess with bitcoin at
>>>> all, much less the experimental lightning network. As advice this is
>>>> perfectly fine to share with others for them to follow on a voluntary
>>>> basis, but I don't see why this ought to be enforced as a rule on a
>>>> protocol level.
>>>>
>>> Possibly.  At the protocol level, a limit encourages the growth of the
>>> network towards a mesh network rather than more central forms,
>>> however.  I merely put this since it is unlikely that most people
>>> following this "wisdom" would have an incentive to even run software
>>> with the limit removed: that is, by the time Lightning becomes fully
>>> deployed the limit may not even be reached in practice.
>>>
>>>> Also, I personally can't see a reason why a node would reject a large
>>>> channel being made with it, where is the downside or risk? The party
>>>> committing funds to the channel is the one risking loss or delay of
>>>> funds.
>>>>
>>> But the party committing funds to the channel is known via node
>>> gossip, and it is known also who the other end of the channel is. If
>>> you were to propose opening for example a 5BTC channel to me with the
>>> funds coming from you, I would consider the possibility that I might
>>> get attacked in order to get to your funds (and I might not have the
>>> resources to protect against such an attack on my end, even if you
>>> might). Further, putting 5BTC implies that at some point there is the
>>> future possibility, due to routing and so on, that the channel will
>>> have around 5BTC belonging to me, and at some point before you can
>>> spend the entire 5BTC I would want to close the channel and commit the
>>> funds that I now own into cold storage (so that the ability to channel
>>> 5BTC from you to me is a moot point).
>>>
>>>
>>> Regards,
>>> ZmnSCPxj
>> _______________________________________________
>> Lightning-dev mailing list
>> Lightning-dev at lists.linuxfoundation.org
>> https://www.learnbitcoin.com/archive/lists/lightning-dev
Rusty Russell in reply to Andy Schroder permalink original

Andy Schroder <info at AndySchroder.com> writes:

Quoted text (39 lines)
> Andy Schroder
>
> On 12/27/2017 12:56 AM, ZmnSCPxj wrote:
>> Good morning Andy,
>>
>>>
>>>     Channel closing
>>>     costs dwarf the gains to be made from cheating, however.
>>>
>>>         Since millisatoshis is used, is there a maximum channel
>>>         funding size?
>>>         Yes, the upper 32 bits must be zero, from BOLT #2:
>>>
>>>      *
>>>         for channels with |chain_hash| identifying the Bitcoin
>>>         blockchain:
>>>           o MUST set the four most significant bytes of |amount_msat|
>>>             to 0.
>>>
>>>     This gives a maximum HTLC value of .04294967295 BTC, which, back when
>>>     we started, was about $10.
>>>
>>>
>>> What's the point of wasting the upper 32 bits? Seems like this is a
>>> waste of data?
>>
>> The specs are intended to eventually support other similar
>> cryptocurrencies, such as Litecoin.  For those currencies, payments of
>> hundreds of whole coins may be practical, and thus the 0.042 limit is
>> not imposed.  For Bitcoin only, the limit is applied.  This simplifies
>> the design of software by only imposing a limit to a large field under
>> certain conditions (i.e. for Bitcoin) while retaining the same format
>> for all coins. Other cryptocurrencies may have different imposed
>> limits when Lightning gets around to those.
>
> It seems like you are making assumptions about the purchasing power of
> certain cryptocurrencies. Why even bother doing this? You have no idea
> what the future holds. Why set a limit for any cryptocurrency that might
> use lightning?

Hi Andy,

        I think I covered this pretty well previously: https://medium.com/@rusty_lightning/bitcoin-lightning-faq-why-the-0-042-bitcoin-limit-2eb48b703f3
Quoted text (1 line)
> Okay, so why bother making these two amounts different?

Since that's just between peers, it was less critical in restraiing the network (and far easier to change). There was also a proposal for a "dangerous feature bit" which would avoid this limitation.

Quoted text (8 lines)
>> Both you and the exchange would want to do this: the exchange wants
>> this so it can capture your routing fees, you want this so that you do
>> not even touch the chain at all and start out in Lightning in the
>> first place.
>
> Okay, so all this feature is doing is saving the extra step of making an
> initial payment? Just saving a little time, and not a monumental or
> required feature?

It also allows you to hand *all* the money to the other side (the initial state is not required to have a reserve).

But basically it had the advantage of being trivial. If nobody actually uses it, we'll probably drop it in 1.1.

Cheers, Rusty.

Rusty Russell in reply to Mark F permalink original

Mark Friedenbach <mark at friedenbach.org> writes:

Quoted text (1 line)
> I had always assumed the protocol limits were training wheels, and would be shocked and dismayed if that were not the case (and would immediately begin work on an alternative fork because such limits would make lightning useless for my intended applications).

Mark,

        This is an unnecessarily aggressive sentence; we all need to
take care not to let Bitcoin's mode of discussion leak into Lightning
development.  I've failed at this several times myself.

If you have enough time to work on an alternative fork, I'd encourage you to contribute to the spec process :)

Thanks, Rusty.

Christian Decker in reply to Andy Schroder permalink original

Andy Schroder <info at AndySchroder.com> writes:

Quoted text (4 lines)
> I understand that you have to be in agreement with your direct peers. So
> you don't really care about what agreements others in your route may
> have in place? I would think that you would choose not to route through
> hops that violate your capacity limit.

I'm failing to see why I'd care about a remote channel's capacity, aside from it being large enough to cover the amount I want to transfer. As a participant routing through a channel that has a higher capacity I do not incur any additional risk than from a smaller channel, since the payment is guaranteed to be atomic. In the contrary one could argue that a higher capacity channel has a higher probability of having sufficient capacity in the desired direction to forward my transfer.

Maybe I'm failing to see something? I always interpreted the limit as purely self-defense on how much value I'm confident enough to keep in a channel.

Cheers, Christian

Andy Schroder in reply to Christian Decker permalink original

What you are saying makes perfect sense for the short term.

What I am talking about could promote a big picture healthier network long term by discouraging "super nodes" in the network from existing, if you avoid making connections to nodes that have large channel capacities with other parties.

Does this make sense?

Andy Schroder

On 01/01/2018 12:47 PM, Christian Decker wrote:

Quoted text (20 lines)
> Andy Schroder <info at AndySchroder.com> writes:
>> I understand that you have to be in agreement with your direct peers. So
>> you don't really care about what agreements others in your route may
>> have in place? I would think that you would choose not to route through
>> hops that violate your capacity limit.
> I'm failing to see why I'd care about a remote channel's capacity, aside
> from it being large enough to cover the amount I want to transfer. As a
> participant routing through a channel that has a higher capacity I do
> not incur any additional risk than from a smaller channel, since the
> payment is guaranteed to be atomic. In the contrary one could argue that
> a higher capacity channel has a higher probability of having sufficient
> capacity in the desired direction to forward my transfer.
>
> Maybe I'm failing to see something? I always interpreted the limit as
> purely self-defense on how much value I'm confident enough to keep in a
> channel.
>
> Cheers,
> Christian
>
Christian Decker in reply to Andy Schroder permalink original

I see, are you suggesting that large channels could be an indicator of a large actor trying to attract a lot of payment traffic? Not sure whether that is really a good measure, since it is trivial for a large node to masquerade as any number of smaller nodes, thus hiding its size.

We definitely want to discourage this kind of masquerades since it causes a lot more transactions on-chain and results in UTXO fragmentation. In addition what we actually try to guard against are hubs, which have a lot of channels open, not large ones :-)

Cheers, Christian

Andy Schroder <info at AndySchroder.com> writes:

Quoted text (32 lines)
> What you are saying makes perfect sense for the short term.
>
> What I am talking about could promote a big picture healthier network
> long term by discouraging "super nodes" in the network from existing, if
> you avoid making connections to nodes that have large channel capacities
> with other parties.
>
> Does this make sense?
>
> Andy Schroder
>
> On 01/01/2018 12:47 PM, Christian Decker wrote:
>> Andy Schroder <info at AndySchroder.com> writes:
>>> I understand that you have to be in agreement with your direct peers. So
>>> you don't really care about what agreements others in your route may
>>> have in place? I would think that you would choose not to route through
>>> hops that violate your capacity limit.
>> I'm failing to see why I'd care about a remote channel's capacity, aside
>> from it being large enough to cover the amount I want to transfer. As a
>> participant routing through a channel that has a higher capacity I do
>> not incur any additional risk than from a smaller channel, since the
>> payment is guaranteed to be atomic. In the contrary one could argue that
>> a higher capacity channel has a higher probability of having sufficient
>> capacity in the desired direction to forward my transfer.
>>
>> Maybe I'm failing to see something? I always interpreted the limit as
>> purely self-defense on how much value I'm confident enough to keep in a
>> channel.
>>
>> Cheers,
>> Christian
>>
Andy Schroder in reply to Christian Decker permalink original

Yes, that's what I'm suggesting, but I don't know if it's right or not.

I was assuming many small channels would be partially self regulating because people would have to pay for more on chain transaction fees for the opening and closing of the channels.

Andy Schroder

On 01/02/2018 08:11 AM, Christian Decker wrote:

Quoted text (46 lines)
> I see, are you suggesting that large channels could be an indicator of a
> large actor trying to attract a lot of payment traffic? Not sure whether
> that is really a good measure, since it is trivial for a large node to
> masquerade as any number of smaller nodes, thus hiding its size.
>
> We definitely want to discourage this kind of masquerades since it
> causes a lot more transactions on-chain and results in UTXO
> fragmentation. In addition what we actually try to guard against are
> hubs, which have a lot of channels open, not large ones :-)
>
> Cheers,
> Christian
>
> Andy Schroder <info at AndySchroder.com> writes:
>> What you are saying makes perfect sense for the short term.
>>
>> What I am talking about could promote a big picture healthier network
>> long term by discouraging "super nodes" in the network from existing, if
>> you avoid making connections to nodes that have large channel capacities
>> with other parties.
>>
>> Does this make sense?
>>
>> Andy Schroder
>>
>> On 01/01/2018 12:47 PM, Christian Decker wrote:
>>> Andy Schroder <info at AndySchroder.com> writes:
>>>> I understand that you have to be in agreement with your direct peers. So
>>>> you don't really care about what agreements others in your route may
>>>> have in place? I would think that you would choose not to route through
>>>> hops that violate your capacity limit.
>>> I'm failing to see why I'd care about a remote channel's capacity, aside
>>> from it being large enough to cover the amount I want to transfer. As a
>>> participant routing through a channel that has a higher capacity I do
>>> not incur any additional risk than from a smaller channel, since the
>>> payment is guaranteed to be atomic. In the contrary one could argue that
>>> a higher capacity channel has a higher probability of having sufficient
>>> capacity in the desired direction to forward my transfer.
>>>
>>> Maybe I'm failing to see something? I always interpreted the limit as
>>> purely self-defense on how much value I'm confident enough to keep in a
>>> channel.
>>>
>>> Cheers,
>>> Christian
>>>