Skills agent-wallet-local-generate
Generate or import wallet details using either a mnemonic seed phrase or private key. Use when the user asks for wallet creation, recovery, onboarding, or key-based wallet setup.
install
source · Clone the upstream repo
git clone https://github.com/openclaw/skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/beardkoda/agent-wallets/local-wallet/generate" ~/.claude/skills/clawdbot-skills-agent-wallet-local-generate && rm -rf "$T"
manifest:
skills/beardkoda/agent-wallets/local-wallet/generate/SKILL.mdsource content
Wallet (Seed Phrase or Private Key)
Runtime Requirements
- Runtime: Node.js 18+
- Required package:
viem - Optional network input:
(only needed when validating on-chain state)RPC_URL
Required Secrets / Inputs
only for mnemonic importSEED_PHRASE
only for private key importPRIVATE_KEY- For new wallet generation, do not pre-read env secrets
- Ask for explicit consent before reading env-based signer secrets
Inputs
Accept one of:
- a seed phrase (usually 12 or 24 words)
- a hex private key (
prefixed or raw hex)0x - a request to generate a new wallet
Workflow
- Determine input type:
- Seed phrase flow for mnemonic words
- Private key flow for hex key material
- if unclear, ask: "Use seed phrase or private key?"
- If agent wallet is missing, run wallet creation flow with
(section below).viem - For seed phrase flow:
- normalize phrase input (trim, collapse spaces, lowercase when appropriate)
- validate word count (12/24) and checksum if supported
- derive wallet from mnemonic with default path unless user specifies one
- For private key flow:
- confirm import/derive operation
- normalize key format
- trim whitespace
- remove wrapping quotes
- accept both
and non-0x
formats0x
- Validate private key shape when private key flow is used:
- 64 hex chars after removing
0x - only
[0-9a-fA-F]
- 64 hex chars after removing
- Derive wallet address/public key for the selected method.
- Persist secret material with secure storage only (vault, key manager, encrypted env secret store).
- Return wallet details safely:
- show address/public key
- never show full seed phrase or private key
No Wallet Exists (Viem)
When the agent has no wallet configured, create one first, then continue with normal wallet/transaction flows.
Option A: Generate a new seed phrase wallet
import { generateMnemonic, mnemonicToAccount } from 'viem/accounts' const mnemonic = generateMnemonic() const account = mnemonicToAccount(mnemonic) // Store mnemonic in secure secret storage only. // Persist account.address as the agent wallet address.
Option B: Generate a new private key wallet
import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts' const privateKey = generatePrivateKey() const account = privateKeyToAccount(privateKey) // Store privateKey in secure secret storage only. // Persist account.address as the agent wallet address.
Option C: Import existing wallet
- If user provides
, derive withseedPhrase
.mnemonicToAccount - If user provides
, derive withprivateKey
.privateKeyToAccount - In both cases, persist only via secure secret storage and keep values masked in logs.
Response Template
- Method:
orseed phraseprivate key - Action:
,generated
, orimportedderived - Address:
<derived-address> - Network/Path:
/<network><derivation-path-if-used> - Secret status:
validated and hidden - Status:
|success
|failedneeds_confirmation - Next step:
<backup|fund wallet|run balance check>
Standard Response Contract
:action
|generateimport
: chain id/name used, orchain
if offline generation onlynone
: derived wallet addressaddress
:txHashnull
:status
|success
|failedneeds_confirmation
: one clear follow-up actionnext_step
Failure Handling
- Invalid mnemonic checksum -> stop, request corrected phrase, do not derive.
- Invalid private key length/hex -> stop, request corrected key format.
- Secret store unavailable -> stop and ask user to configure secure storage first.
- Chain mismatch during validation -> report mismatch and request target chain confirmation.
Guardrails
- Reject invalid seed phrase word counts with a corrective prompt.
- If mnemonic checksum fails, ask for correction or confirmation.
- If private key length/format is invalid, stop and request corrected input.
- Never store secret material in plaintext files unless explicitly requested.
- Recommend secure offline backup after successful wallet derivation.
- If no wallet existed, confirm the new wallet was created and linked to the agent profile.
- Never echo full secrets in terminal output or chat logs.