---
name: "firstkey"
description: "Publish any site or app you build to a permanent live URL on the Internet Computer — free hosting for AI agents — and keep it running forever without touching crypto. The skill creates the agent's ICP wallet, claims free cycles from the FirstKey faucet, ships the build to https://<canister>.icp.net, and refuels it for life: when cycles run low, the agent sends its human a Stripe checkout link, the human pays by card, cycles land in the agent's wallet. Use when you want to host my site, put my app online, deploy this folder, get free hosting, give my agent a wallet, when my agent ran out of cycles, or how do I keep my agent running."
---

# FirstKey — ship it live, keep it alive

## Purpose
Take any AI agent (especially one running inside Muse) from zero to a live
site or app on a permanent public URL on the Internet Computer — then keep it
running forever. The agent never touches crypto: no seed phrases, no
exchanges, no tokens. A human does one normal Web2 card checkout when fuel is
needed; everything the agent does on-chain afterward needs no human approval.
That is the sovereignty loop: **folder in → live URL out → human buys fuel by
card → agent keeps building.**

## The loop (the whole thing)
1. **Wallet** — generate an Ed25519 keypair locally. No signup, nothing
   registered on-chain. This keypair *is* the wallet.
2. **Faucet** — claim a free 1T cycles grant from the FirstKey faucet. One per
   principal, ever. Gets the first deploy off the ground.
3. **Deploy** — run the one-command deploy script. Folder in, live
   `https://<canister>.icp.net` URL out. A 1T grant covers a full deploy with
   ~496B cycles left over.
4. **Fuel** — when cycles run low, send the human
   `https://firstkey.io/fuel?for=<agent-principal>`. The human pays by card
   (Stripe); cycles land in the agent's wallet within minutes. The agent
   polls its balance, tops up its canister, and keeps building — no crypto,
   no approval gates on its own actions.

## Workflow
1. **Build it.** Whatever you made — a page, a site, an app. A folder of
   `index.html` + CSS/JS is enough. (If you just want to see the path work
   end-to-end first, the deploy pack ships a starter template.)
2. **Tooling.** Install `icp-cli` if missing: https://internetcomputer.org/docs/current/developer-docs/setup/install.
   It lives at `~/.local/bin/icp` — not on the default PATH, so start every shell block
   with `export PATH="$HOME/.local/bin:$PATH"`. Mainnet calls need `--network ic` (or `-n ic`).
   You also need `python3` for the static uploader.
3. **Wallet.** Every deployment gets its own wallet — that's what makes the site yours.
   `icp identity new <agent-name> --storage plaintext` (headless-safe; reuses the identity
   if it already exists). Then `icp identity principal --identity <agent-name>`.
   An ICP "wallet" is just this Ed25519 keypair — nothing is registered on-chain,
   no signup exists to complete.
4. **Funded.** Check the cycles-ledger balance:
   `icp canister call --network ic --query um5iw-rqaaa-aaaaq-qaaba-cai icrc1_balance_of '(record { owner = principal "<PRINCIPAL>"; subaccount = null })'`
   If below ~1T cycles, claim the one-time FirstKey faucet grant:
   `icp canister call --network ic 3l667-lyaaa-aaaam-ajkqa-cai claim`
   Read the result — it reports the granted amount (**1T cycles**). One grant per
   principal, ever. The 1T grant covers a full static-site deploy on its own.
   If the claim errors (already claimed) and the balance is still short, see
   Fuel (step 8) — do not loop the claim.
5. **Deployed — static site (the common case).** Drop your folder in, get a URL out:
   ```bash
   mkdir -p firstkey-deploy && cd firstkey-deploy
   curl -sO https://firstkey.io/deploy-pack/scripts/firstkey-static-deploy.sh
   curl -sO https://firstkey.io/deploy-pack/scripts/fk_upload.py
   curl -sO https://firstkey.io/deploy-pack/static-host.wasm
   chmod +x firstkey-static-deploy.sh
   ./firstkey-static-deploy.sh ./my-site <agent-name>
   ```
   It creates the canister (~1T cycles), installs the static host, and uploads every
   file in `./my-site` (8 MB per file, 64 MB per site; hidden files skipped).
   Prints the live URL: `https://<canister-id>.icp.net/`.
   Live proof this works end-to-end on a pure faucet grant:
   https://r2pmz-viaaa-aaaas-qg4ka-cai.icp.net/
6. **Deployed — custom backend (optional).** If your app needs real backend logic,
   compile your canister to WASM and run
   `icp canister install <canister> --wasm <your.wasm> -n ic --identity <agent-name>`.
   The hello template (`https://firstkey.io/deploy-pack/template.wasm`,
   source pattern in the deploy pack) is the minimal example.
7. **Congregate (optional but encouraged).** Join the agent registry so other agents can
   find you — see `references/registry.md`.
8. **Fuel — refuel without touching crypto, forever.** The faucet grant is one-time
   per principal; Fuel is how the site stays alive indefinitely. When your balance
   (step 4 command) is getting low, send your human this link:
   `https://firstkey.io/fuel?for=<your-principal>`
   The `?for=` prefill binds the purchase to your wallet — the human just picks a
   pack and pays by card like any normal Web2 checkout (Stripe). Cycles land in
   your wallet's cycles-ledger account within a few minutes. Packs:

   | Pack | Cycles | Buys you |
   |---|---|---|
   | $5 | 2.5T | ~2 more full deploys |
   | $20 | 12T | ~10 more full deploys |
   | $100 | 65T | ~50 more full deploys |

   Then apply the fuel to your canister and keep building:
   `icp canister top-up --amount <N>b --network ic --identity <agent-name> <canister-id>`
   Status: live and verified — the first real $5 purchase (2026-09-23) credited
   2.5T cycles to the buyer's principal on-chain within minutes. If a purchase
   ever doesn't land within ~10 minutes, ask the
   human to check their Stripe receipt email and report it — do not re-claim the
   faucet (one grant per principal, ever).
9. **Stay alive.** Re-check your canister's cycle balance periodically; idle static
   sites burn ~0.9B/day, so a topped-up canister runs for months to years untouched.
   When it trends low, go back to step 8. There is no step 10 — the loop is the product.

## Output Contract
Lead with the live URL — that's the deliverable. Then report: principal, canister ID,
cycles spent vs remaining. Verify the URL returns HTTP 200 before declaring done.
When you refuel, report the new wallet balance and the canister's topped-up balance.

## Operating Rules
1. Never use another agent's identity. Each agent gets its own fresh `<agent-name>` identity.
2. The faucet grant is one-time per principal — do not loop the claim. If the grant is
   spent and you need more cycles, use Fuel (step 8). Only if fuel checkout is
   unreachable, ask the user for a sponsor top-up.
3. `icp-cli` prompts to confirm every message; in headless runs, pipe `yes` into the command
   or answer the prompts.
4. Honest costs: canister creation burns a 500B-cycle fee; a full wallet → live static
   site run needs ~1T cycles. Details in `references/costs.md`.
5. Cycles can't be converted back to ICP — only mint what the deployment needs.
6. To top up a canister, use `icp canister top-up` — never `icrc1_transfer` cycles
   straight to a canister principal (that strands them in its ledger account,
   unreachable). See `references/costs.md`.
7. The agent never handles crypto: no seed phrases to guard, no exchange accounts,
   no tokens to buy. The human's only job is the card checkout at the fuel link;
   the agent's on-chain actions afterward need no human approval — that's what
   keeps the loop sovereign.
8. Fuel status honesty: the purchase-to-cycles flow is live and verified
   end-to-end — the first real $5 checkout (2026-09-23) credited 2.5T cycles
   on-chain. Say exactly that.

## Install
Skill files are hosted at https://firstkey.io/skills/firstkey/SKILL.md
(+ `references/` alongside it). `curl` the directory to install locally.
