Skip to content

feat(lightning): support custodial user auth key resets - #10099

Closed
ralph-bitgo[bot] wants to merge 1 commit into
masterfrom
wcn-3893-userauth-reset
Closed

ralph-bitgo[bot] wants to merge 1 commit into
masterfrom
wcn-3893-userauth-reset

Conversation

@ralph-bitgo

@ralph-bitgo ralph-bitgo Bot commented Oct 29, 2026

Copy link
Copy Markdown

Description

Add custodial Lightning userAuth reset methods, strict signed-request and API codecs, and shared verification-code helpers. Signatures accept the Bitcoin-versioned auth keys generated on both Lightning networks while using the selected network for message signing.

Customers who forget their wallet password need a way to request support-verified recovery without disclosing their private key or new passphrase. The wallet-platform and lightning-services reset routes must be deployed before this workflow can operate end to end. A beta release should include the sibling reshare change.

Issue Number

WCN-3893

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • yarn tsc --build modules/abstract-lightning in the Nix shell.
  • yarn unit-test in modules/abstract-lightning: 58 passing. The existing NYC instrumentation reported expand is not a function; coverage was not collected.
  • yarn lint in modules/abstract-lightning.
  • A standalone testnet request smoke run verified the signed proof and locally computed code using the built SDK and nock.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My code compiles correctly for both Node and Browser environments (browser build not run)
  • I have commented my code, particularly in hard-to-understand areas
  • My commits follow Conventional Commits and I have properly described any BREAKING CHANGES
  • The ticket or github issue was included in the commit message as a reference
  • I have made corresponding changes to the documentation and on any new/updated functions and/or methods
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Ticket: WCN-3893

Generate and encrypt a replacement user auth key locally, sign a
wallet-bound reset request, and expose reset and verification helpers.

This enables customers who forgot their wallet password to initiate
a support-verified recovery without sharing their private key.

Ticket: WCN-3893
Session-Id: 30bb619c-846b-4c8a-99e0-3053d34ff708
Task-Id: aa9e5203-2bfd-476d-a4a0-fa95765018ea
@linear-code

linear-code Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

WCN-3893

if (result._tag === 'Left') {
return result;
}
return Object.keys(result.right).every((key) =>

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reject unknown fields rather than using io-ts exact, which strips them. A verifier must not silently accept a different signed payload.


function parseLightningKey(key: string, network: utxolib.Network): utxolib.BIP32Interface {
// Lightning auth keys use Bitcoin BIP32 versions on both networks.
if (key.startsWith('xpub') || key.startsWith('xprv')) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I parse Bitcoin-versioned keys independently of the signing network: existing Lightning key generation returns xpub/xprv on testnet too, while the signature still uses the coin network.

});
return {
requestId: result.requestId,
status: result.status,

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I compute this from the locally generated public key instead of trusting any server-provided code, so support verification binds to the key the customer actually generated.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Compatibility checks are failing on Node.js 27-nightly (experimental, non-blocking). This does not block merge, but it signals an incompatibility to fix before this release becomes supported.

View run

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.

2 participants