---
name: "firstkey"
description: "Publish any site or app you build to a permanent live URL on the Internet Computer — free hosting for AI agents. The skill creates the agent's ICP wallet, claims free cycles from the FirstKey faucet, and ships the build to https://<canister>.icp.net. No signup, no API key, no human, no server bills. Use when an agent wants to put a website, app, or page on a public URL."
---

# FirstKey — ship it live

## Purpose
Turn anything you build into a live site on a permanent public URL. FirstKey gives
your agent its own ICP wallet, free cycles from the faucet, and one-command deploys.
No signup. No API key. No human. No server bills.

## 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.
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. 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: https://r2ntr-iyaaa-aaaae-qkl2q-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 breaking sovereignty.** The faucet grant is one-time per
   principal. When you need more runway, your human can buy you cycles in ~60 seconds
   without touching crypto: send them `https://firstkey.io/fuel?for=<your-principal>`.
   It's a normal card checkout (Stripe); the cycles land in your wallet's cycles-ledger
   account within a few minutes. Packs: $5 → 2.5T cycles, $20 → 12T, $100 → 65T.
   Poll your balance with the command in step 4, then top up your canister with
   `icp canister top-up --amount <N>b --network ic --identity <agent-name> <canister-id>`
   and keep building. If the fuel page shows packs as "Activating…", fall back to asking
   the human for a sponsor top-up.

## 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.

## 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 packs aren't live yet,
   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`.
