-
Notifications
You must be signed in to change notification settings - Fork 23
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
Rotate taproot swap-in addresses #584
Conversation
e8640e4
to
8c2197c
Compare
src/commonMain/kotlin/fr/acinq/lightning/blockchain/electrum/SwapInWallet.kt
Outdated
Show resolved
Hide resolved
2f2b29c
to
d22dfd1
Compare
8c2197c
to
1c17d26
Compare
src/commonMain/kotlin/fr/acinq/lightning/blockchain/electrum/ElectrumMiniWallet.kt
Outdated
Show resolved
Hide resolved
8fa7fea
to
c865b24
Compare
16af706
to
5c4cbcb
Compare
91ea457
to
361faa9
Compare
src/commonMain/kotlin/fr/acinq/lightning/blockchain/electrum/ElectrumMiniWallet.kt
Outdated
Show resolved
Hide resolved
src/commonTest/kotlin/fr/acinq/lightning/blockchain/electrum/ElectrumMiniWalletTest.kt
Outdated
Show resolved
Hide resolved
LGTM! There is yet no limit on the number of address that can be generated (it could be set explicitly in the wallet, or implicitly by the generator which could return |
6387515
to
6eba0f8
Compare
02d89fb
to
962efbb
Compare
7bd0e8a
to
42ec19c
Compare
ecbc4c6
to
f963c21
Compare
5e18d0b
to
7d17663
Compare
7ea242e
to
57ee3a4
Compare
57ee3a4
to
38e3e97
Compare
Rebased on master. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a nit.
There is no cap on the number of addresses that can be generated. I don't think it's a problem: eletrum servers will add a 30 seconds delay when the "cost" of a connection becomes too expensive (only if a user has 100s of addresses).
src/commonMain/kotlin/fr/acinq/lightning/blockchain/electrum/ElectrumMiniWallet.kt
Outdated
Show resolved
Hide resolved
I think that it's better than worrying about unintentional address reuse, and it will be regulated by increasingly slow sync times anyway. |
This meta notably contains the index if the address was deterministically generated.
We create and monitor a fixed number of different swap-in addresses. Peer will choose an empty swap-in addresses if there is one, or a random address if there are none. We limit the number of monitored swap-in addresses to avoid hitting resource limits on Electrum servers. A few hundred addresses (100 or 200) is a safe limit.
We keep the core logic for watching individual addresses, and just generate more when needed.
It's not really synchronous, but we rely the least possible on the mailbox. This makes the `window` disappear because we are scanning addresses one by one. Suggested by @sstone.
It's more consistent with Utxo and makes jvm interop easier.
38e3e97
to
82c0d22
Compare
It uses groundwork made in branch swap-in-potentiam-taproot-rotate, but replaces hardcoded addresses by proper unbounded rotation.
Some cleanup is done at the end, by extracting wallets outside of
Peer
.Best reviewed commit-by-commit.