<oembed><type>rich</type><version>1.0</version><author_name>npub1r375vdaydp5nnnytff6ee2kwzxak8whmwkmnkm6h67agr7dadfkqxn6ccq</author_name><author_url>https://nostr.ae/npub1r375vdaydp5nnnytff6ee2kwzxak8whmwkmnkm6h67agr7dadfkqxn6ccq</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2017-12-27&#xA;📝 Original message:&#xA;Andy Schroder&#xA;&#xA;On 12/27/2017 12:56 AM, ZmnSCPxj wrote:&#xA;&gt; Good morning Andy,&#xA;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt;     Channel closing&#xA;&gt;&gt;     costs dwarf the gains to be made from cheating, however.&#xA;&gt;&gt;&#xA;&gt;&gt;         Since millisatoshis is used, is there a maximum channel&#xA;&gt;&gt;         funding size?&#xA;&gt;&gt;         Yes, the upper 32 bits must be zero, from BOLT #2:&#xA;&gt;&gt;&#xA;&gt;&gt;      *&#xA;&gt;&gt;         for channels with |chain_hash| identifying the Bitcoin&#xA;&gt;&gt;         blockchain:&#xA;&gt;&gt;           o MUST set the four most significant bytes of |amount_msat|&#xA;&gt;&gt;             to 0.&#xA;&gt;&gt;&#xA;&gt;&gt;     This gives a maximum HTLC value of .04294967295 BTC, which, back when&#xA;&gt;&gt;     we started, was about $10.&#xA;&gt;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt; What&#39;s the point of wasting the upper 32 bits? Seems like this is a&#xA;&gt;&gt; waste of data?&#xA;&gt;&#xA;&gt; The specs are intended to eventually support other similar &#xA;&gt; cryptocurrencies, such as Litecoin.  For those currencies, payments of &#xA;&gt; hundreds of whole coins may be practical, and thus the 0.042 limit is &#xA;&gt; not imposed.  For Bitcoin only, the limit is applied.  This simplifies &#xA;&gt; the design of software by only imposing a limit to a large field under &#xA;&gt; certain conditions (i.e. for Bitcoin) while retaining the same format &#xA;&gt; for all coins. Other cryptocurrencies may have different imposed &#xA;&gt; limits when Lightning gets around to those.&#xA;&#xA;It seems like you are making assumptions about the purchasing power of &#xA;certain cryptocurrencies. Why even bother doing this? You have no idea &#xA;what the future holds. Why set a limit for any cryptocurrency that might &#xA;use lightning?&#xA;&#xA;Even if you are right about the purchasing power of a particular &#xA;cryptocurrency, why is a limit needed at all? If I have an high, bi &#xA;weekly paid salary, and I have a low budget lifestyle, let&#39;s say I save &#xA;90% of my income. It seems like your assumed limits could require &#xA;multiple payments and multiple open channels for each bi weekly payment. &#xA;What if I want to buy a boat, do you expect me to make payments from a &#xA;lot of different channels? I was kind of under the assumption that the &#xA;long term goal of lightning was only to have a few on chain payments per &#xA;human per year.&#xA;&#xA;Or, are you just worried right now because lightning isn&#39;t well tested?&#xA;&#xA;&#xA;&#xA;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt; If you have the lower 32 bits of data to use, and 2^32=4,294,967,296,&#xA;&gt;&gt; then you have 4,294,967,296 milli satoshis. 1 BTC=10^11 milli satoshis,&#xA;&gt;&gt; so 4,294,967,296 milli satoshis/((10^11 milli satoshis)/1BTC) =&#xA;&gt;&gt; 0.04294967296 BTC. That is off by 1 milli satoshi from what you say&#xA;&gt;&gt; above. Why is this?&#xA;&gt;&gt;&#xA;&gt;&#xA;&gt; You have an off-by-one error.  The largest number representable by 32 &#xA;&gt; bits is 2^32 - 1, not 2^32.&#xA;&#xA;Okay, thanks for the clarification.&#xA;&#xA;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt; Regardless of the discrepancy of 1 milli satoshi, it still seems like&#xA;&gt;&gt; 0.04294967296 BTC is kind of a low maximum channel size for a lot of&#xA;&gt;&gt; business applications. Why do you want to limit this when you have those&#xA;&gt;&gt; extra 4 bytes set to zero? You think any more is too much to safely have&#xA;&gt;&gt; in a hot wallet? You felt keeping it low will encourage&#xA;&gt;&gt; decentralization? Something else?&#xA;&gt;&gt;&#xA;&gt;&#xA;&gt; This is not the channel size.  This is the payment size limit.  The &#xA;&gt; channel size limit is 0.16777215 BTC, or 16777215 satoshi (2^24 - 1).&#xA;&gt;&#xA;&gt; A single payment can be up to 0.04294967295, but a channel is up to &#xA;&gt; 0.16777215.&#xA;&#xA;Okay, so why bother making these two amounts different?&#xA;&#xA;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt; Is the max HTLC value the same as the maximum channel size?&#xA;&gt;&gt;&#xA;&gt;&gt;&#xA;&gt;&#xA;&gt; No&#xA;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt;         Is the optional initial push of millisatoshis during the channel&#xA;&gt;&gt;         creation there in order to motivate the other party to be&#xA;&gt;&gt;         willing to&#xA;&gt;&gt;         waste their time with the channel creation in the first&#xA;&gt;&gt;         place? If not,&#xA;&gt;&gt;         what&#39;s it for?&#xA;&gt;&gt;         It&#39;s for the common case where you want to connect to someone and&#xA;&gt;&gt;         make a payment immediately. I&#39;m not sure how widely it will&#xA;&gt;&gt;         be used,&#xA;&gt;&gt;         though. It&#39;s also the only mechanism for the payer to have&#xA;&gt;&gt;         /zero/ funds&#xA;&gt;&gt;         in channel (ie. below reserve).&#xA;&gt;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt; Why would you ever want to start up a channel and immediately have zero&#xA;&gt;&gt; funds in reserve? If you are doing that, why not just make a blockchain&#xA;&gt;&gt; transaction?&#xA;&gt;&gt;&#xA;&gt;&#xA;&gt; An exchange might support this.  You buy for example 100USD worth of &#xA;&gt; BTC and indicate a desire to open a new channel between your node to &#xA;&gt; the exchange&#39;s.  The exchange opens the channel with your node and &#xA;&gt; specifies the push_msat equivalent of 100USD minus fees to your node.  &#xA;&gt; The exchange will want to do this because your new channel goes &#xA;&gt; directly to the exchange and it can earn routing fees from your &#xA;&gt; spending.  Presumably you want to do this so that you can spend your &#xA;&gt; 100USD on Lightning for things within a short time frame.&#xA;&gt;&#xA;&gt; The alternative is to send the money from the exchange onchain to you, &#xA;&gt; then for your node to open a new channel (not necessarily to the &#xA;&gt; exchange, too, so the exchange loses the routing fees) with the &#xA;&gt; onchain funds.  This is two onchain transactions (from exchange to &#xA;&gt; you, and from your node to a Lightning channel), unlike the case where &#xA;&gt; the exchange does a single open and reassigns the funds to you via &#xA;&gt; push_msat.&#xA;&gt;&#xA;&gt; Both you and the exchange would want to do this: the exchange wants &#xA;&gt; this so it can capture your routing fees, you want this so that you do &#xA;&gt; not even touch the chain at all and start out in Lightning in the &#xA;&gt; first place.&#xA;&#xA;Okay, so all this feature is doing is saving the extra step of making an &#xA;initial payment? Just saving a little time, and not a monumental or &#xA;required feature?&#xA;&#xA;Thanks,&#xA;Andy Schroder&#xA;&#xA;&#xA;&gt;&#xA;&gt; Regards,&#xA;&gt; ZmnSCPxj&#xA;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20171227/8e8c3749/attachment.html&gt;</html></oembed>