-
Notifications
You must be signed in to change notification settings - Fork 114
feat: add vibenet skill for EIP-8130 devnet, verified against live behaviour #149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
soheimam
wants to merge
3
commits into
master
Choose a base branch
from
feat/8130-skill
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| 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/*`) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
| ``` | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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