Agent Wallets
Policy-bound wallets with spending caps, service allowlists, session permissions, and protocol-enforced stop conditions.
Agent wallets
LayerX wallets are purpose-built for autonomous agents. Unlike traditional wallets that grant unlimited signing authority, agent wallets are policy-bound - every spending rule is enforced at the protocol level, not by convention.
Why policy-bound wallets
Autonomous agents operate without human oversight. A compromised or misbehaving agent with an unrestricted wallet can drain funds instantly. LayerX wallets solve this by binding spending policies directly to the wallet at creation time. The sequencer enforces these policies on every transfer - there is no way to bypass them without upgrading the wallet on L1.
Spending caps
Set a maximum USDX amount the agent can spend within a rolling time window. Once the cap is reached, further transfers are rejected until the window resets.
{
"spending_cap": {
"amount": "100.00",
"window": "24h"
}
}
If an agent needs to spend beyond its cap, the parent wallet must explicitly raise the limit - the agent cannot do this itself.
Service allowlists
Restrict which DIDs the agent can send USDX to. Transfers to non-listed recipients are rejected by the sequencer.
{
"allowlist": [
"did:secp256k1:pax1abc...",
"did:ed25519:agent.weather.v2"
]
}
This is useful when an agent is authorized to pay for specific services but should not have general-purpose spending authority.
Session permissions
Bind a wallet to a specific authentication session. When the session expires or is revoked, the wallet becomes inert - no transfers are accepted until a new session is established.
Session-scoped wallets are ideal for short-lived agent tasks where long-lived spending authority is undesirable.
Stop conditions
Define conditions under which the wallet is automatically frozen. Stop conditions are evaluated by the sequencer on every transfer attempt.
- Balance floor - freeze when balance drops below a threshold.
- Anomaly detection - freeze on unusual transfer patterns (e.g., rapid-fire sends to a new DID).
- Time-based expiry - freeze after a fixed duration.
Once frozen, the wallet can only be unfrozen by the parent wallet on L1.
Creating a wallet via SDK
Use the sei-js SDK to create a policy-bound wallet:
import { LayerX } from "@paxeer/layerx-sdk";
const wallet = await LayerX.createWallet({
did: "did:ed25519:agent.scanner.v1",
policy: {
spendingCap: { amount: "50.00", window: "1h" },
allowlist: ["did:ed25519:service.data.v2"],
stopConditions: { balanceFloor: "5.00" }
}
});
The SDK returns a wallet handle that automatically signs transfers with the agent's Ed25519 key. All policy enforcement happens on the sequencer - the SDK simply constructs valid transfer intents.
Protocol enforcement
Every policy is enforced at the sequencer level. The SDK and API layers do not make spending decisions - they construct requests and the sequencer accepts or rejects them based on the wallet's policy.
This means:
- A compromised agent cannot exceed its spending cap.
- A misdirected transfer to a non-listed DID is rejected before it touches the ledger.
- A frozen wallet cannot be thawed without L1-level intervention.
Policies are immutable once the wallet is created. To change a policy, create a new wallet with the updated rules and transfer the balance.