Skip to content

Support option_simplified_commitment#887

Closed
araspitzu wants to merge 75 commits into
masterfrom
simplified_commitmeint_more_simplified
Closed

Support option_simplified_commitment#887
araspitzu wants to merge 75 commits into
masterfrom
simplified_commitmeint_more_simplified

Conversation

@araspitzu
Copy link
Copy Markdown
Contributor

@araspitzu araspitzu commented Mar 8, 2019

Add support for the new commitment type with option_simplified_commitment. This PR proposes a non-typed design built on top of the existing Commitments class, there is now a version field that is used to identify the type of commitment being used; when we serialize the STATE_DATA the version is translated into a byte and prepended to the serialized state. Summary of the changes:

  • There are two pushMe outputs of 1000sats each, both paid by the funder but one sends to the fundee
  • The option is sticky, once a channel is past FUNDING_SIGNED it can't be changed
  • There are no update_fee messages, the feerate is set to be 253 sat/kw
  • HTLCs transactions are signed using SIGHASH_SINGLE | SIGHASH_ANYONECANPAY and using feerate = 0, we'll have to bring our own inputs here as well.
  • The negotiation to close the channels is started by the fundee
  • to_remote output is delayed and the pubkey is not rotated
  • [WIP] To close the channel we must CPFP the commitment TX by attaching new inputs (bring your own fee)

At the time of this writing there are still some open questions on the BOLTs themselves regarding option_simplified_commitment.

sstone and others added 30 commits January 16, 2019 16:51
We don't use `signrawtransaction` anymore, which was deprecated in Bitcoin Core 0.17
and will be removed in 0.18.

This means that we don't support 0.16.3 and older.
araspitzu and others added 24 commits March 4, 2019 08:58
Check that we handle errors properly when signrawtransactionwithwallet returns multiple errors.
# Conflicts:
#	eclair-core/src/main/scala/fr/acinq/eclair/channel/Channel.scala
#	eclair-core/src/main/scala/fr/acinq/eclair/channel/ChannelExceptions.scala
#	eclair-core/src/main/scala/fr/acinq/eclair/channel/ChannelTypes.scala
#	eclair-core/src/main/scala/fr/acinq/eclair/channel/Commitments.scala
#	eclair-core/src/main/scala/fr/acinq/eclair/channel/Helpers.scala
#	eclair-core/src/main/scala/fr/acinq/eclair/crypto/KeyManager.scala
#	eclair-core/src/main/scala/fr/acinq/eclair/crypto/LocalKeyManager.scala
#	eclair-core/src/main/scala/fr/acinq/eclair/io/Peer.scala
#	eclair-core/src/main/scala/fr/acinq/eclair/transactions/Scripts.scala
#	eclair-core/src/main/scala/fr/acinq/eclair/transactions/Transactions.scala
#	eclair-core/src/main/scala/fr/acinq/eclair/wire/ChannelCodecs.scala
#	eclair-core/src/test/scala/fr/acinq/eclair/channel/states/b/WaitForFundingCreatedStateSpec.scala
#	eclair-core/src/test/scala/fr/acinq/eclair/channel/states/b/WaitForFundingSignedStateSpec.scala
#	eclair-core/src/test/scala/fr/acinq/eclair/channel/states/e/NormalStateSpec.scala
#	eclair-core/src/test/scala/fr/acinq/eclair/channel/states/g/NegotiatingStateSpec.scala
#	eclair-core/src/test/scala/fr/acinq/eclair/channel/states/h/ClosingStateSpec.scala
#	eclair-core/src/test/scala/fr/acinq/eclair/db/ChannelStateSpec.scala
#	eclair-core/src/test/scala/fr/acinq/eclair/db/SqliteAuditDbSpec.scala
#	eclair-core/src/test/scala/fr/acinq/eclair/transactions/TestVectorsSpec.scala
#	eclair-core/src/test/scala/fr/acinq/eclair/transactions/TransactionsSpec.scala
To reconstruct the tx commit number we need to take the lower 24 bits of the locktime field.
…ied_commitmeint_more_simplified

# Conflicts:
#	eclair-core/src/test/scala/fr/acinq/eclair/transactions/TransactionsSpec.scala
@pm47 pm47 added the WIP label Apr 10, 2019
@araspitzu araspitzu changed the title [WIP] Support option_simplified_commitment Support option_simplified_commitment Apr 10, 2019
@pm47 pm47 removed the WIP label Apr 12, 2019
@araspitzu
Copy link
Copy Markdown
Contributor Author

Closing because option_simplified_commitment has been replaced by option_static_remotekey lightning/bolts#642

@araspitzu araspitzu closed this Sep 10, 2019
@araspitzu araspitzu deleted the simplified_commitmeint_more_simplified branch April 8, 2020 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants