<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/18/2017 01:40 PM, Rusty Russell wrote:&#xA;&gt; Andy Schroder &lt;info at AndySchroder.com&gt; writes:&#xA;&gt;&gt; What&#39;s the rational for using millisatoshis as the units for lightning&#xA;&gt;&gt; channels? Aren&#39;t you going to loose up to 1/2 of a satoshi when the&#xA;&gt;&gt; channel is closed?&#xA;&gt; You can lose up to 0.999 satoshi per in-progress payment, yes.  BOLT #3:&#xA;&gt;&#xA;&gt;      The amounts for each output MUST be rounded down to whole satoshis.&#xA;&#xA;Okay, round down, not regular rounding!&#xA;&#xA;&#xA;&gt;&#xA;&gt;&gt; Is this because it doesn&#39;t hurt and you might as well&#xA;&gt;&gt; be open to the opportunity for these sub satoshi transactions, because&#xA;&gt;&gt; if you aren&#39;t, you are giving up the opportunity to get accumulated&#xA;&gt;&gt; revenue from many of those small transactions, that could end up being&#xA;&gt;&gt; greater than 1/2 of a satoshi?&#xA;&gt; In practice, payments of less than a few thousand satoshi are&#xA;&gt; impractical, as they cost more than that to spend.&#xA;&#xA;They are impractical even on the lightning network?&#xA;&#xA;&#xA;&#xA;&#xA;&gt; Channel closing&#xA;&gt; costs dwarf the gains to be made from cheating, however.&#xA;&gt;&#xA;&gt;&gt; Since millisatoshis is used, is there a maximum channel funding size?&#xA;&gt; Yes, the upper 32 bits must be zero, from BOLT #2:&#xA;&gt;&#xA;&gt;    - for channels with `chain_hash` identifying the Bitcoin blockchain:&#xA;&gt;      - MUST set the four most significant bytes of `amount_msat` to 0.&#xA;&gt;&#xA;&gt; This gives a maximum HTLC value of .04294967295 BTC, which, back when&#xA;&gt; we started, was about $10.&#xA;&#xA;What&#39;s the point of wasting the upper 32 bits? Seems like this is a &#xA;waste of data?&#xA;&#xA;If you have the lower 32 bits of data to use, and 2^32=4,294,967,296, &#xA;then you have 4,294,967,296 milli satoshis. 1 BTC=10^11 milli satoshis, &#xA;so 4,294,967,296 milli satoshis/((10^11 milli satoshis)/1BTC) = &#xA;0.04294967296 BTC. That is off by 1 milli satoshi from what you say &#xA;above. Why is this?&#xA;&#xA;Regardless of the discrepancy of 1 milli satoshi, it still seems like &#xA;0.04294967296 BTC is kind of a low maximum channel size for a lot of &#xA;business applications. Why do you want to limit this when you have those &#xA;extra 4 bytes set to zero? You think any more is too much to safely have &#xA;in a hot wallet? You felt keeping it low will encourage &#xA;decentralization? Something else?&#xA;&#xA;&#xA;Is the max HTLC value the same as the maximum channel size?&#xA;&#xA;&#xA;&#xA;&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 willing to&#xA;&gt;&gt; waste their time with the channel creation in the first place? If not,&#xA;&gt;&gt; what&#39;s it for?&#xA;&gt; It&#39;s for the common case where you want to connect to someone and&#xA;&gt; make a payment immediately.  I&#39;m not sure how widely it will be used,&#xA;&gt; though.  It&#39;s also the only mechanism for the payer to have *zero* funds&#xA;&gt; in channel (ie. below reserve).&#xA;&#xA;Why would you ever want to start up a channel and immediately have zero &#xA;funds in reserve? If you are doing that, why not just make a blockchain &#xA;transaction?&#xA;&#xA;&#xA;&gt;&#xA;&gt;&gt; In all of the clients that I&#39;ve looked at, I can&#39;t seem to find out how&#xA;&gt;&gt; to define the timeout closing out a channel when someone does not&#xA;&gt;&gt; cooperate. Is there a fixed value for this as part of the protocol? Or&#xA;&gt;&gt; do most clients have a default that they enforce over all channels that&#xA;&gt;&gt; they create?&#xA;&gt; If there&#39;s no in-progress payment, there&#39;s no reason to close a channel&#xA;&gt; to an unreachable peer, unless you want to abandon the channel and get&#xA;&gt; the funds back.&#xA;&gt;&#xA;&gt; If there is, BOLT #2 has you covered:&#xA;&gt;&#xA;&gt;          https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md#requirements-8&#xA;&#xA;&#xA;Okay, so every time you get a new HTLC, your client can change the &#xA;timeout that you require for closing the channel, which will control how &#xA;long it takes you to abandon the channel and get your funds back when &#xA;the peer is unreachable? Or is that set during initial channel creation &#xA;only?&#xA;&#xA;&#xA;&#xA;&gt;&#xA;&gt; Hope that helps,&#xA;&gt; Rusty.&#xA;&gt;</html></oembed>