-
Notifications
You must be signed in to change notification settings - Fork 266
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
Add bech32 support for electrum wallet #1170
Conversation
94cdab9
to
1cba855
Compare
Codecov Report
@@ Coverage Diff @@
## master #1170 +/- ##
==========================================
+ Coverage 76.38% 76.61% +0.23%
==========================================
Files 140 141 +1
Lines 9545 9601 +56
Branches 378 384 +6
==========================================
+ Hits 7291 7356 +65
+ Misses 2254 2245 -9
|
eclair-core/src/main/scala/fr/acinq/eclair/blockchain/electrum/ElectrumWallet.scala
Outdated
Show resolved
Hide resolved
a09a78c
to
f8e7ac2
Compare
eclair-core/src/main/scala/fr/acinq/eclair/blockchain/electrum/ElectrumAddressStrategy.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/blockchain/electrum/ElectrumEclairWallet.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/blockchain/electrum/ElectrumWallet.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/blockchain/electrum/ElectrumAddressStrategy.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/blockchain/electrum/ElectrumWallet.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/blockchain/electrum/ElectrumWallet.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/blockchain/electrum/ElectrumAddressStrategy.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/blockchain/electrum/ElectrumWalletBasicSpec.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/blockchain/electrum/ElectrumWalletBasicSpec.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/blockchain/electrum/ElectrumWalletBasicSpec.scala
Outdated
Show resolved
Hide resolved
3dd0c39
to
4f25551
Compare
@araspitzu for reference I've implemented some of the proposed changes in branch https://github.com/ACINQ/eclair/tree/native_segwit_support_fd, including a different way of having specific BIP49/BIP84 tests. |
462170a
to
477a10c
Compare
eclair-core/src/main/scala/fr/acinq/eclair/blockchain/electrum/ElectrumWallet.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/blockchain/electrum/db/sqlite/SqliteWalletDb.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/blockchain/electrum/db/sqlite/SqliteWalletDb.scala
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/blockchain/electrum/ElectrumWalletSpec.scala
Show resolved
Hide resolved
…dd wallet type to test names
… force a full sync from the electrum server.
bf6d7ba adds the clear cache functionality to the electrum wallet, this can be used by eclair-mobile to trigger a full resync with the electrum server by sending a |
… data, otherwise use the one passed from the parameters.
Eclair-mobile integration with this PR needs to handle wallet restore in a special case. On restore the user will be asked whether he's restoring a bech32 or p2sh wallet, to avoid errors eclair-mobile can use special naming for the backup, this will avoid consistency issue because it forces the channel backup to match the electrum wallet type. However this still leaves room for user errors: if the user selects the wrong type then when eclair-mobile reconnects (i.e to ACINQ node) it will trigger the DLP and the remote will force close the channels. A potential solution to avoid that is to pair the wallet type with the |
eclair-core/src/main/scala/fr/acinq/eclair/blockchain/electrum/ElectrumWallet.scala
Outdated
Show resolved
Hide resolved
High level interaction between eclair-mobile and eclair-core in the restore scenarioDuring the restore scenario the user is prompted to choose a
|
The restore scenario for eclair mobile can be tricky and it would be nice to avoid any consistency issues. When you say I'm not sure I understand why changing the node id would cause any technical issues, since it's virtually the same thing as using a different seed? However I understand that we would have to write a special case in the code generating the node id and maintain it for a long time, just to prevent a onetime issue in bech32 migration for eclair mobile. |
The argument against changing the nodeid is that it's often used as identifier in authentication prototocols and/or signature schemes, for example both c-lightning and lnd support signing a message with your node key (note that eclair don't support that at the moment); there might be other integrations of which we're aren't aware now. On the other hand if changing the nodeid won't break any existing service/integration then i'm in favor of it. |
2ee9b13 adds the exception to use a different derivation path for the node key if the wallet is electrum in bech32 mode. |
# Conflicts: # eclair-core/src/test/scala/fr/acinq/eclair/StartupSpec.scala
e407530
to
84bbbd7
Compare
We've removed support for Electrum entirely, so this PR is now obsolete. |
Add support for
p2wpkh
scriptPubKeys in our electrum wallet, this will enable eclair-mobile to receive to bech32 addresses. The electrum wallet now accepts aWalletType
parameter that is used to decide whether the wallet creates outputs of typep2sh-of-p2wpkh
(current type) or the newp2wpkh
, the wallet only supports one of the two and they can't be mixed, if started withp2wpkh
it won't find unspent outputs of the other type.