# krypco **krypco** is a hybrid blockchain: a private permissioned layer anchored to a public chain. This monorepo holds the marketing site, portal, and Phase 5 local hybrid prototype. ## Structure ``` krypco/ ├── apps/ │ ├── portal/ # Next.js 15 — marketing + /portal │ ├── indexer/ # Phase 5 hybrid sim API (:4091) │ └── relayer/ # Watches anchors, logs public posts ├── packages/ │ ├── config │ └── mavi-core # shared create/encrypt for mavi (portal + future extension) ├── docker-compose.yml # optional anvil private :8545 + public :8546 └── docs/ ``` ## Requirements - [bun](https://bun.sh) 1.x - Node.js 22 (Next tooling) - Optional: Docker for two local anvil chains ## Quick start ```sh bun install bun run dev # portal → http://localhost:3000 ``` ### Hybrid stack (stronger local prototype) ```sh # optional: real local private + public EVM (anvil) bun run chains:up # private http://127.0.0.1:8545 public http://127.0.0.1:8546 # terminal A — private sim + explorer API bun run dev:indexer # terminal B — posts real public commitment txs when public anvil is up bun run dev:relayer # terminal C — portal bun run dev ``` - Explorer: http://localhost:3000/portal/explorer — **source: live** when indexer is up - Hybrid status: http://localhost:3000/portal/hybrid — private/public RPC + anchor queue Without Docker, the indexer still runs a private-layer sim; anchors wait for the relayer until public RPC is available. ## Auth & machine keys (Briven) Secrets live in `apps/portal/.env.local` (gitignored). Never put `m2ms_…` or `brai_…` in `NEXT_PUBLIC_*`. | Kind | Shape | Where | |------|--------|--------| | User auth (browser) | `pk_briven_auth_…` | `NEXT_PUBLIC_BRIVEN_AUTH_KEY` | | AI agent | `brai_…` | `BRIVEN_AI_AGENT_KEY` (server) | | Machine client (M2M) | `m2m_…` + `m2ms_…` | `BRIVEN_M2M_CLIENT_ID` / `BRIVEN_M2M_CLIENT_SECRET` | Status page: `/portal/machine-auth`. OTP / magic email needs a working Briven **sender domain** before login codes arrive in the inbox. ## Wallet - **MetaMask** (and other injected wallets): **wagmi** + **viem** connect. - **mavi** (always lowercase): krypco’s own wallet — create / import, 24-word backup with 6-blank confirm, encrypted browser vault, balance + send on local anvil, network switcher, activity. Shared logic: `packages/mavi-core`. Portal UI: http://localhost:3000/portal/mavi - Create · Import · Send · Receive · Activity under `/portal/mavi/*` - Browser **extension** with real keys: `apps/mavi-extension` (create/import/unlock vault). Load unpacked after `bun run --cwd apps/mavi-extension build`. Pack: `bun run ext:pack` Secrets never leave the browser unencrypted; not a fork of MEW. ## Scripts ```sh bun run dev # portal bun run dev:indexer bun run dev:relayer bun run build bun run typecheck ``` ## Conventions - Brand name **krypco** (lowercase) in copy. - Theme tokens in `apps/portal/app/globals.css`. - Specs under `docs/superpowers/specs/`.