Index of every page on this site: llms.txt
All skills
1shot-api avatar

/agent-wallet

@01cfb41
by 1Shot API1shot-api/skills1 stars
Run it yourself

Create and use a local agent EOA with encrypted JSON keystores (ethers/Node by default; Foundry cast optional) — sign personal_sign / typed data / tx hashes, send transactions, and build or sign EIP-7710 delegations (including redelegation and EIP-7702 auth) without printing private keys, mnemonics, or passwords into chat context. Use when an agent needs its own wallet, agent private key storage, non-interactive casting, or MetaMask Smart Accounts Kit delegations from a headless environment. Also use when an agent needs an address for a CoinOperated (or other product) funding/registration deeplink after create — product URL shape lives in the consuming skill (e.g. coinoperated). Also use when signing EIP-7702 auth or EIP-7710 root/redelegations that will be submitted via the public-relayer skill (relayer_estimate7710Transaction / relayer_send7710Transaction, including batched executions and multichain).

  • 18 files
  • 94.3 KB
  • MIT
  • Updated 3 weeks ago
  • GitHub
Use this Skill: https://skilld.dev/gh/1shot-api/skills/agent-wallet

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈234 tokens for metadata: the name and description. ≈1.9k when used: this file. ≈11k more on demand in 8 files.

Description uses 11.6% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈931 characters, or 11.6%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Agent wallet (keystore CLI)

Product-agnostic skill for coding agents that need a local EOA and optional EIP-7710 delegations. Keys live in encrypted JSON keystores under ~/.agent-wallet/ (or AGENT_WALLET_HOME). The CLI never prints private keys, mnemonics, or passwords — only JSON results on stdout.

These scripts reduce accidental key leakage into model context. Anyone or any process with filesystem access to the keystore + password file can still use the key. The sandbox / host filesystem is the trust boundary — see references/security.md.

Install this skill

Claude Code / Cursor (user-level, ~/.claude/skills is read by both):

npx skills add 1Shot-API/skills/agent-wallet -g -a claude-code -y
cd ~/.claude/skills/agent-wallet/scripts && npm install

Any agent / cloud sandbox:

git clone --depth 1 https://github.com/1Shot-API/skills.git
cd skills/agent-wallet/scripts && npm install

npm install pulls @metamask/smart-accounts-kit ^2.0.0, viem, and ethers (~seconds). That is enough for create, address, sign-personal, sign-hash, auth7702, and delegation-*/redelegate.

Foundry cast is optional for the CoinOperated / public-relayer path. It is still required for send, mktx, and sign-typed. Avoid foundryup in tiny cloud snapshots when you only need EIP-7710 signing (~294 MB of forge/cast/anvil binaries).

First run

node scripts/aw.mjs doctor
  • If depsOk is false → cd scripts && npm install (path in depsInstallHint).
  • If cast is null → fine for create/SIWE/auth7702/redelegate; foundryHint lists commands that still need cast.

Create a wallet (idempotent; show the user address only):

node scripts/aw.mjs create
# → {"ok":true,"address":"0x…","name":"agent",…}

Prefer aw over raw cast wallet new / cast wallet private-key (those leak keys to stdout).

Command cheat sheet

Run from the skill root, or with an absolute path to scripts/aw.mjs.

Command Purpose Success stdout Needs cast?
doctor cast / node / wallet / deps status object no
create [--name] [--force] encrypted keystore + password file { address, name, keystorePath, storageTier } no (ethers)
address [--name] resolve address { address } no
sign-personal --message … EIP-191 { signature } no (viem fallback)
sign-hash --hash 0x… raw 32-byte hash { signature } no (viem fallback)
sign-typed --file typed.json EIP-712 { signature } yes
send --rpc … --to … broadcast { txHash } yes
mktx … signed raw tx, no broadcast { rawTransaction } yes
auth7702 --rpc … --chain-id N EIP-7702 Stateless7702 auth { authorization, … } no
delegation-create --file input.json unsigned delegation { delegation, chainId } no
delegation-sign --file input.json sign delegation in-process { signedDelegation, chainId } no
redelegate --parent parent.json --file input.json child delegation + sign { signedDelegation, chainId } no

Exit codes: 0 ok, 2 missing cast/deps, 3 no wallet, 4 bad args, 5 runtime failure.

Every command supports --help. Unknown flags fail loudly. Optional --home / AGENT_WALLET_HOME and --name (default agent).

Examples

node scripts/aw.mjs sign-personal --message "hello"
# Arc first redeem — Stateless7702 auth for the relayer (pending nonce)
node scripts/aw.mjs auth7702 --rpc https://rpc.mainnet.arc.io --chain-id 5042
node scripts/aw.mjs redelegate --parent ./parent.json --file ./child-input.json

Delegation input schema, scopes, amounts, and 7702: references/eip7710.md.

Arc mainnet: kit env for 5042 is registered via Arc Testnet template (overrideDeployedEnvironment). Kit must be ^2.0.0. See references/eip7710.md.

After create — product deeplinks

This skill only supplies the address. For CoinOperated owner linking (additional signer + spending delegation), follow skill coinoperated: build https://coinoperated.finance/agent/link?accountAddress=…&name=…, ask the user to open it, then SIWE with sign-personal for a Bearer token.

Redeeming via the public relayer

aw signs (7702 auth, root delegation, redelegation). It does not call relayer_*. Follow skill public-relayer (Path D, Example 0d) for capabilities → estimate → send.

Goal aw commands Then (public-relayer)
First-time smart account on a chain auth7702 --rpc … --chain-id N Pass authorizationList: [authorization] on estimate and send
Agent pays fee + work itself delegation-sign --file … with to: targetAddress permissionContext: [signedDelegation]
Spend a user grant to this agent (CoinOperated) redelegate --parent parent.json --file child.json (to: targetAddress, narrower scope) permissionContext: **[child, parent]** (leaf → root)

First tx on a chain: always run auth7702 and include authorizationList until the EOA has Stateless7702 code. aw signs the current pending nonce (relayer is the outer sender — never viem executor: "self").

Batching (same chain): one permissionContext + multiple executions[] (e.g. fee transfer + pull-to-agent). Do not run separate aw send calls for gas-abstracted redeem.

Multichain: run auth7702 / redelegate (or delegation-sign) per chain as needed, then relayer_estimate7710TransactionMultichain / relayer_send7710TransactionMultichain with per-chain context from contextByChainId.

# Example — Arc D2 (CoinOperated)
node scripts/aw.mjs auth7702 --rpc https://rpc.mainnet.arc.io --chain-id 5042
node scripts/aw.mjs redelegate --parent ./parent.json --file ./child-input.json
# → authorizationList + permissionContext [child, parent] on estimate/send (Example 0d)

Agent rules

  1. Run doctor before first use; fix npm install from its hints. Install Foundry only if you need send / mktx / sign-typed.
  2. After create, tell the user the address only — never open or dump the password file or keystore JSON into chat.
  3. Do not run cast wallet private-key, cast wallet new without --unsafe-password, or interactive password prompts.
  4. For EIP-7710 submit/redeem, use skill public-relayer (relayer_*) — not aw send.
  5. Treat stdout as the only success channel; parse JSON (ok: true). BigInts in auth are stringified safely.

Storage layout

See references/storage.md. Tier B only in v1: encrypted keystore + 0600 password file. OS keyring deferred.

See also

  • references/casting.md — cast flag mapping (optional path)
  • references/security.md — threat model
  • references/eip7710.md — delegation JSON + 7702
  • Skill public-relayer — submit signed EIP-7710 contexts (relayer_send7710Transaction)
  • Skill coinoperated — CoinOperated agent link deeplink + SIWE Bearer + OpenAPI
  • Skill smart-accounts-kit (MetaMask) — broader kit workflows

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 01cfb41. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Activeupdated 3 weeks ago
Other metadata
metadata
{
  "author": "1Shot-API",
  "version": "0.4.0",
  "repository": "https://github.com/1Shot-API/skills"
}

README badge

README badge for 1shot-api/skills/agent-wallet