-
Notifications
You must be signed in to change notification settings - Fork 366
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
Make payment_key
derivation deterministic
#3391
base: main
Are you sure you want to change the base?
Make payment_key
derivation deterministic
#3391
Commits on Nov 6, 2024
-
Drop
InMemorySigner
Writeable
impl... which we haven't been using since 0.0.119 / commit 7a951b1.
Configuration menu - View commit details
-
Copy full SHA for 6dfe913 - Browse repository at this point
Copy the full SHA 6dfe913View commit details -
Rename
payment_key
topayment_basepoint
inchan_utils
.. as it doesn't use the actual signer's `payment_key`, but the associated public key.
Configuration menu - View commit details
-
Copy full SHA for 75c2b0a - Browse repository at this point
Copy the full SHA 75c2b0aView commit details -
Rename
params
tochannel_keys_id
and take it by value.. to make the name more clear and since before we `clone` it in `derive_channel_keys` anyways.
Configuration menu - View commit details
-
Copy full SHA for 611c1a3 - Browse repository at this point
Copy the full SHA 611c1a3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6be731e - Browse repository at this point
Copy the full SHA 6be731eView commit details -
Rename
payment_point
topayment_basepoint
.. to align the field naming with the spec for clarity.
Configuration menu - View commit details
-
Copy full SHA for ed2d63e - Browse repository at this point
Copy the full SHA ed2d63eView commit details -
Make
payment_key
derivation deterministicPreviously, `KeysManager::derive_channel_keys` would derive the channel's `payment_key` uniquely on a per-channel basis which would disallow users losing their `channel_keys_id` to recover funds. As it's no real necessity to have `payment_key` derivation depend on `channel_keys_id` we can allow for easier recovery of any non-HTLC encumbered funds if we make `payment_key` derivation deterministic. To this end, we use the first byte of `channel_keys_id` as a versioning byte indicating the version of the used channel keys derivation scheme. Note that Previously `KeysManager::generate_channel_keys_id` would with very high likelyhood never have generated a `channel_keys_id` with a non-null first byte, which makes this a backwards-compatible change for any users that didn't run custom implementations of `SignerProvider::generate_channel_keys_id` conflicting with this assumption.
Configuration menu - View commit details
-
Copy full SHA for aea8e5e - Browse repository at this point
Copy the full SHA aea8e5eView commit details -
f Adjust test cases to accommodate new derivation scheme
Some test cases have hard-coded values which we change here (to be squashed in after review).
Configuration menu - View commit details
-
Copy full SHA for a781d23 - Browse repository at this point
Copy the full SHA a781d23View commit details -
Configuration menu - View commit details
-
Copy full SHA for bf14ec8 - Browse repository at this point
Copy the full SHA bf14ec8View commit details -
Have
SignerProvider::get_shutdown_scriptpubkey
takechannel_keys_id
.. to allow users to return specific scripts per channel.
Configuration menu - View commit details
-
Copy full SHA for c70f7ec - Browse repository at this point
Copy the full SHA c70f7ecView commit details