New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BOLT 2,4,7: use 8 bytes for amounts, restrict add_htlc for bitcoin only. #175

Merged
merged 2 commits into from May 23, 2017

Conversation

Projects
None yet
4 participants
@rustyrussell
Collaborator

rustyrussell commented May 16, 2017

We had 4 byte fields for amounts because people have no ability to assess
risk, and this limited the damage to $70 at a time.

But then that means $1 maximum HTLCs on Litecoin, which isn't enough
for a cup of (decent) coffee.

Rather than have boutique hacks for Litecoin we enlarge the fields now,
and simply have a bitcoin-specific restriction that the upper 4 bytes be 0.

Suggested-by: Olaoluwa Osuntokun laolu32@gmail.com
Signed-off-by: Rusty Russell rusty@rustcorp.com.au

BOLT 2,4,7: use 8 bytes for amounts, restrict add_htlc for bitcoin only.
We had 4 byte fields for amounts because people have no ability to assess
risk, and this limited the damage to $70 at a time.

But then that means $1 maximum HTLCs on Litecoin, which isn't enough
for a cup of (decent) coffee.

Rather than have boutique hacks for Litecoin we enlarge the fields now,
and simply have a bitcoin-specific restriction that the upper 4 bytes be 0.

Suggested-by: Olaoluwa Osuntokun <laolu32@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@EmelyanenkoK

This comment has been minimized.

Show comment
Hide comment
@EmelyanenkoK

EmelyanenkoK May 16, 2017

Contributor

As I understand in the future LN will support cross-chain swap. Thus we should take into account ethereum-based chains. In ethereum indivisible unit is 1e-18 of one eth.
Thus I propose to extend funding_satoshis field too, from 8bytes to 16. It will allow us to lock up sufficient amount of ether in the channel (from 18.5 for now to up to 3e20 with 16bytes)

Contributor

EmelyanenkoK commented May 16, 2017

As I understand in the future LN will support cross-chain swap. Thus we should take into account ethereum-based chains. In ethereum indivisible unit is 1e-18 of one eth.
Thus I propose to extend funding_satoshis field too, from 8bytes to 16. It will allow us to lock up sufficient amount of ether in the channel (from 18.5 for now to up to 3e20 with 16bytes)

@rustyrussell

This comment has been minimized.

Show comment
Hide comment
@rustyrussell

rustyrussell May 18, 2017

Collaborator

@EmelyanenkoK I understand what you're saying, but we're going to need more changes for ethereum, and as no hardware supports 128-bit numbers natively, I'm reluctant to change this. If people want to send more than 18.5 ethers(?) which seems like $1500 right now, we can add a field for them.

Collaborator

rustyrussell commented May 18, 2017

@EmelyanenkoK I understand what you're saying, but we're going to need more changes for ethereum, and as no hardware supports 128-bit numbers natively, I'm reluctant to change this. If people want to send more than 18.5 ethers(?) which seems like $1500 right now, we can add a field for them.

@cdecker

This comment has been minimized.

Show comment
Hide comment
@cdecker

cdecker May 18, 2017

Collaborator

That branch name... LGTM

Collaborator

cdecker commented May 18, 2017

That branch name... LGTM

FIXUP: move ctlv_expiry field to fix alignment.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

@rustyrussell rustyrussell merged commit 068b0bc into lightningnetwork:master May 23, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Roasbeef

This comment has been minimized.

Show comment
Hide comment
@Roasbeef

Roasbeef May 26, 2017

Member

@EmelyanenkoK well as is written now ETH, can't simply copy-pasta the spec into the domain of their blockchain. In fact, I'm not aware of any specification efforts on their part (nor of the design of their LN emulation), so for now I think it make sense to just focus on BTC (which allows BTC derived coins like LTC adopt the spec verbatim).

Member

Roasbeef commented May 26, 2017

@EmelyanenkoK well as is written now ETH, can't simply copy-pasta the spec into the domain of their blockchain. In fact, I'm not aware of any specification efforts on their part (nor of the design of their LN emulation), so for now I think it make sense to just focus on BTC (which allows BTC derived coins like LTC adopt the spec verbatim).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment