Repository navigation
feat(lightning): support custodial user auth key resets - #10099
ralph-bitgo[bot] wants to merge 1 commit into
Conversation
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
| if (result._tag === 'Left') { | ||
| return result; | ||
| } | ||
| return Object.keys(result.right).every((key) => |
There was a problem hiding this comment.
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')) { |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
|
|
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
How Has This Been Tested?
yarn tsc --build modules/abstract-lightningin the Nix shell.yarn unit-testinmodules/abstract-lightning: 58 passing. The existing NYC instrumentation reportedexpand is not a function; coverage was not collected.yarn lintinmodules/abstract-lightning.Checklist:
Ticket: WCN-3893