Conversation
hiletmis
left a comment
There was a problem hiding this comment.
LGTM. Thanks for the seamless integration.
I have run a test with keycard on bsc-testnet using a config from airseeker-admin by just changing managed to keycard and providing a PIN.
As PIN is mentioned, it can be optional either by not providing on config (N/A ATM) or not defining in secrets.env. Either way it will work with keycard as keycard-manager will eventually asks for PIN to proceed.
Ofc to avoid delays or allow auto-restarts PIN can be hardcoded.
Hope keycard bring peace and happiness to Airseeker
| The PIN for the Keycard hardware wallet. Required only when `type` is set to `keycard`. For example: | ||
|
|
||
| ```jsonc | ||
| "walletDerivationScheme": { "type": "keycard", "pin": "${KEYCARD_PIN}" }, |
There was a problem hiding this comment.
Adding following line to secrets.example.env can be considered
KEYCARD_PIN=000000
There was a problem hiding this comment.
I intentionally didn't include this environment variable (afbe354) because it isn't included in the airseeker.example.json template.
That’s a good point. I hadn't considered the interactive prompt since the goal was to run this in a detached Docker container. I’ll update the schema now to support cases where the PIN isn't defined. |
Summary
This PR adds support for Keycard hardware wallet as a wallet derivation scheme option, enabling secure transaction signing using a physical smart card.
Breaking changes⚠️
This should be released as a major due to schema changes.
The configuration schema has been restructured:
sponsorWalletMnemonichas been moved from a top-level config field intowalletDerivationSchemeself-funded,managed,fixed) now includes its ownsponsorWalletMnemonicfieldkeycardtype added which usespininstead of mnemonicBefore:
{ ... "sponsorWalletMnemonic": "test test test...", "walletDerivationScheme": { "type": "managed" } ... }After:
{ ... "walletDerivationScheme": { "type": "managed", "sponsorWalletMnemonic": "test test test..." } ... }This restructuring improves the schema design as
sponsorWalletMnemonicandwalletDerivationSchemewere inherently related and are now logically grouped together.Changes
keycardwallet derivation scheme type that accepts a PIN for hardware wallet authenticationkeycard.tsas a plug-in component (similar to env.ts) for clean separation of concerns. This design makes it easier to understand the flow and serves as a reference implementation for usingkeycard-managerwithin the organizationkeycard-manageris dynamically imported only when needed to avoid loading it for non-keycard deploymentsDesign decisions
Heartbeat logging: Heartbeat logging is disabled when keycard is the
walletDerivationScheme. This is intentional as heartbeat logging is designed to monitor Cloud deployments, while keycard-based deployments are intended for local use. Open to discussion if heartbeat logging should also be supported for keycard deployments.State management: The keycard wallet is managed in
keycard.tsas a module-level variable rather than instate.ts. This plug-in approach was preferred for clarity, though moving it tostate.tsis also a viable alternative.Tested scenarios
self-funded,managed,fixed) work with new schema structure