Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,6 @@ vite.config.js.timestamp-*
vite.config.ts.timestamp-*

.DS_Store
.DS_Store
.DS_Store
# Skill eval workspaces (local scratch, not shipped)
skills/*-workspace/
65 changes: 64 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@

## Recommended Skills

Two consolidated skills that cover the most common use cases. Each uses progressive reference loading — the skill loads a single entry point and pulls in detailed references only when needed.
Consolidated skills that cover the most common use cases. Each uses progressive reference loading — the skill loads a single entry point and pulls in detailed references only when needed.

| Skill | Install | Description |
| ----- | ------- | ----------- |
| [build-on-base](./skills/build-on-base/SKILL.md) | `npx skills add base/skills --skill build-on-base` | Complete Base development playbook: network, contracts, wallet auth, payments, attribution, and migrations. Consolidates all individual skills into one. |
| [base-mcp](./skills/base-mcp/SKILL.md) | `npx skills add base/skills --skill base-mcp` | Base MCP server — gives your AI assistant a wallet via mcp.base.org. Sending, swapping, signing, batched calls, balances, and partner plugins for lending, swaps, and more. |
| [vibenet](./skills/vibenet/SKILL.md) | `npx skills add base/skills --skill vibenet` | Build on [vibenet](https://chain.base.org/vibenet), the Base Vibes devnet for native account abstraction (EIP-8130) with viem: smart accounts, batched calls, session keys and policies, and ERC-8168 payer gas sponsorship. |

## Installation

Expand Down Expand Up @@ -66,6 +67,68 @@ Convert my existing Farcaster miniapp to a standard app on Base
Register my trading bot and add builder code attribution to its transactions
```

```text
Create an EIP-8130 smart account on vibenet and fund it from the faucet
```

```text
Deploy a smart account on vibenet with sponsored gas, so the user needs no ETH
```

```text
Authorize a session key on my 8130 account with a weekly USDC spend limit
```

### Example: gasless onboarding on vibenet

A worked example of what the `vibenet` skill produces — creating an EIP-8130
smart account and deploying it with zero user funds, via an ERC-8168 payer:

```ts
import type { Hex } from "viem";
import { createPublicClient, http } from "viem";
import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
import {
allPhasesSucceeded,
newSmartAccount8130,
waitForTransactionReceipt8130,
} from "viem/experimental/eip8130";
import { createPayerClient, sendSponsoredCalls } from "viem/experimental/eip8168";

const chain = {
id: 84538453,
name: "vibenet",
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
rpcUrls: { default: { http: ["https://rpc.vibes.base.org"] } },
};
const client = createPublicClient({ chain, transport: http() });

// The address is derived locally — synchronous, no RPC, nothing on-chain yet.
// (The fork types `signer` for P-256 keys, so a K1 account needs a cast.)
const signer = privateKeyToAccount(generatePrivateKey());
const account = newSmartAccount8130({ signer: signer as never });

// There is no deploy step: the account is created by its first transaction.
// The payer covers gas, so this works at a zero balance — no faucet needed.
const payerClient = createPayerClient({
url: "https://api.vibes.base.org/api/vibenet/account/payer",
});
const { transactionHash: hash } = (await sendSponsoredCalls(client, {
account,
payerClient,
accountChanges: [account.createChange], // only on the first tx
calls: [{ to: account.address, value: 0n, data: "0x" }],
context: { flow: "onboarding" },
})) as unknown as { transactionHash: Hex };

const receipt = await waitForTransactionReceipt8130(client, { hash });
if (!allPhasesSucceeded(receipt)) throw new Error("a phase reverted");
```

See the [vibenet skill](./skills/vibenet/SKILL.md) for the install steps (the
8130 tooling ships on a viem fork branch), the account lifecycle, session keys,
and the devnet's sharper edges.

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
Expand Down
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

136 changes: 136 additions & 0 deletions skills/vibenet/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
---
name: vibenet
description: >-
Build on vibenet — Base's devnet for native account abstraction (EIP-8130)
and payer gas sponsorship (ERC-8168) using the viem experimental module. Use
whenever the user mentions vibenet, EIP-8130, ERC-8168, 8130 accounts, native
account abstraction, session keys, actors, policies, payers, or gas
sponsorship on Base — or is writing code that creates or operates 8130 smart
accounts, authorizes session-key actors, sends batched calls, sponsors gas
with a payer, or wires a frontend/script against the vibenet devnet or Base
Sepolia.
---

# Vibenet

Vibenet is Base's devnet for **EIP-8130 native account abstraction**: account
abstraction in the protocol itself. Accounts are portable across EVM chains,
support multiple signer types (secp256k1, P-256, WebAuthn), key rotation
without changing address, scoped session-key actors, on-chain policies, and
native **ERC-8168** gas sponsorship. The tooling lives in viem's
`experimental/eip8130` module (fork branch — not yet in npm `viem`).

## Network

| Endpoint | Value |
|----------|-------|
| Chain ID | `84538453` |
| Public execution RPC | `https://rpc.vibes.base.org` — 8130-capable (`AA_TX_TYPE` / `0x79`), serves `access-control-allow-origin: *` |
| Browser RPC proxy | `https://api.vibes.base.org/api/vibenet/account/rpc` — passes through all `eth_*`, including `0x79` broadcasts and receipt polling |
| Hosted payer (ERC-8168) | `https://api.vibes.base.org/api/vibenet/account/payer` |
| Faucet | `POST https://api.vibes.base.org/api/vibenet/faucet/drip` with `{ "address": "0x…" }` |
| Faucet status | `GET https://api.vibes.base.org/api/vibenet/faucet/status` — drip size, cooldowns, USDV/NFV token addresses |
| Chain health | `GET https://api.vibes.base.org/api/vibenet/chain-health` — `{ healthy, head, headAgeSecs, … }` |
| Landing page / explorer | `https://chain.base.org/vibenet`, `https://chain.base.org/vibenet/explorer` |
| Base Sepolia (also 8130-enabled) | `https://sepolia.base.org`, chain id `84532` |

**The API host is `api.vibes.base.org`, not `vibes.base.org`.** The bare host
302-redirects to the `chain.base.org/vibenet` HTML page; viem's HTTP transport
then tries to parse that as JSON and throws `Unrecognized token '<'`, which
reads like a code bug rather than a wrong URL.

All `api.vibes.base.org` endpoints (RPC proxy, payer, faucet) send permissive
CORS headers, and so does `rpc.vibes.base.org` — so browser apps can talk to
either. Prefer `rpc.vibes.base.org` for execution and reserve the `account/rpc`
proxy for when you specifically want the hosted path.

The tooling is **not published to npm** and cannot be installed from git
directly: the fork's workspace uses pnpm's `catalog:` protocol, so
`npm install "viem@github:…"` fails outright, and `bun add "viem@github:…"`
"succeeds" but leaves you an unbuilt monorepo with no `exports` field. Clone,
build, then depend on the built package (which lives in the fork's `src/`):

```bash
git clone -b feat/eip-8130 https://github.com/chunter-cb/viem viem-fork

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use the official version of Viem that has 8130 access

cd viem-fork && npx pnpm install --ignore-scripts && npx pnpm run build

# then in your app — --install-links is required:
npm install --install-links "viem@file:../viem-fork/src"
```

Then import from `viem/experimental/eip8130` (and `viem/experimental/eip8168`
for payers). Core helpers like `createPublicClient` / `parseEther` come from
plain `viem` — the 8130 module does not re-export them.

**Use `--install-links`.** Without it npm symlinks `node_modules/viem` to a path
outside the project root, and Turbopack/Next.js then fails with
`Module not found: Can't resolve 'viem'` for a package that is plainly there
(`tsc` resolves it fine, which makes it look like a bundler bug).

If your TypeScript build rejects the module's BigInt literals, set
`"target": "ES2020"` or later in `tsconfig.json`. Next.js 16's generated config
already works as-is, since its `lib` includes `esnext`.

## Accounts Have No Deploy Step

Creating an account derives a CREATE2 address locally — synchronous, zero RPC,
`eth_getCode` still `0x`. It becomes real as a **side effect of its first
transaction**, which carries `account.createChange` alongside your actual calls.
There is nothing else to call. The shortest path from nothing to a deployed
account is a *sponsored* first tx (no faucet, no funding); the self-paid route
needs the address funded first. Read deployment state from `eth_getCode`, never
from optimistic local state — it decides whether the next tx carries
`createChange`. Full lifecycle:
[references/eip8130-accounts.md](references/eip8130-accounts.md).

## Safety Guardrails

- **Never commit private keys** — generate throwaway keys for devnet scripts,
read real ones from env vars.
- **`key.k1(...)` builds an actor identity, not a signer** — passing it (or a
raw private-key hex) as `signer` fails with an opaque `pad()` TypeError. Use
`privateKeyToAccount(pk)`.
- **Verify config changes by on-chain read-back** (`isActor8130` /
`getConfigSequence8130`), never by receipt logs or `status: success` — a
skipped authorize is silent.
- **Read the live config sequence right before signing** — a hardcoded
sequence causes silent no-ops.

## Task Routing

Read the reference for your task:

| Task | When to Use | Reference |
|------|-------------|-----------|
| **Accounts & transactions** | Create an 8130 smart account, the counterfactual→deployed lifecycle, send batched calls, attribution metadata, gas estimation, reading account state, locking, gotchas | [references/eip8130-accounts.md](references/eip8130-accounts.md) |
| **Session keys & policies** | Authorize/revoke actors, scopes, SessionPolicy spend limits, config sequences, verifying "silent" changes | [references/session-keys-and-policies.md](references/session-keys-and-policies.md) |
| **Gas sponsorship** | Sponsor gas with a payer (ERC-8168), gasless onboarding, `send` vs `sign` modes | [references/payer-sponsorship.md](references/payer-sponsorship.md) |

## Operating Procedure

1. **Classify the task** using the table above and read the relevant reference
before implementing.
2. **Pick the right RPC**: `rpc.vibes.base.org` works from both Node and the
browser; `api.vibes.base.org/api/vibenet/account/rpc` is the hosted proxy to
the same chain. Never `vibes.base.org` — that host is not an API.
3. **Implement** with explicit chain id, the fork-branch install, and read-back
verification for any account-config change.
4. **Deliver** runnable code, install commands, and any manual steps (env
vars, faucet funding).

## For Edge Cases and Latest API Changes

- **EIP-8130 spec**: [eip.tools/eip/8130](https://eip.tools/eip/8130)
(payer standard: [eip.tools/eip/8168](https://eip.tools/eip/8168))
- **viem fork**: `github.com/chunter-cb/viem`, branch `feat/eip-8130`
(API surface: `src/experimental/eip8130/index.ts`; docs:
`site/pages/experimental/eip8130`)
- **Deep guide (chaptered)**: `github.com/chunter-cb/eip-8130-web` (`/guide/*`)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broken link. Is this the new right link: https://github.com/base/eip-8130 ?

- **Session-key walkthrough**:
[gist.github.com/chunter-cb/bf70c53a5ab6d8361ce7f4215b776114](https://gist.github.com/chunter-cb/bf70c53a5ab6d8361ce7f4215b776114)

## Installation

```bash
npx skills add base/skills --skill vibenet
```
Loading