An open-source embedded wallet stack built on MPC (Multi-Party Computation). Private keys are never reconstructed — signing happens via threshold signatures across distributed nodes.
Oko is a monorepo with layered dependencies. Understanding the dependency flow is essential:
lib/ (stdlib_js, dotenv, aws, postgres_lib)
└─ common/oko_types (shared TypeScript types)
└─ crypto/ (Rust → WASM/addon threshold signatures)
└─ sdk/ (chain-agnostic core → chain-specific SDKs)
└─ backend/ (API servers consuming crypto addons)
└─ apps/ (Next.js frontends consuming SDKs + APIs)
└─ embed/oko_attached (embeddable wallet iframe)
Rust → WASM (browser) and Node.js addon (server) builds. tecdsa/ for
EVM/Cosmos (Cait-Sith), teddsa/ for Solana (FROST). Also includes shared
crypto utilities (bytes, crypto_js).
Core provides chain-agnostic wallet logic (auth, iframe communication, events). Chain-specific SDKs extend it:
oko_sdk_core— Base SDK (chain-agnostic)oko_sdk_eth— EVM provider viaviemoko_sdk_cosmos— Keplr-compatible Cosmos interface via@cosmjsoko_sdk_svm— Solana Wallet Standard via@solana/web3.jsoko_sdk_react— React hooks (useOko,useOkoEth,useOkoCosmos,useOkoSvm)oko_sdk_core_react_native— React Native adaptationoko_cosmos_kit,oko_interchain_kit— Ecosystem adapters
Express.js servers with Zod + OpenAPI schema validation.
oko_api/server— Main API, aggregates sub-APIs and handles TSS operationsadmin_api— Admin managementct_dashboard_api— Customer/team dashboard APIuser_dashboard_api— User-facing dashboard operations- Shared modules:
openapi(Zod schemas),oko_pg_interface(Knex migrations),oko_api_server_state,oko_api_error_codes
Independent Express server for threshold signature key share storage and
signing participation. Has its own DB (ksn_pg_interface), auth, and OpenAPI
schema. Communicates with oko_api during signing ceremonies.
React 19 + Vite + TanStack Router app that runs inside an iframe. Handles
client-side crypto (keygen, signing via WASM), UI components, and communicates
with the host page via window.postMessage. The heaviest consumer of internal
packages — depends on WASM modules, SDK packages, common UI, and crypto
libraries.
React component library with fine-grained exports: button, input, table,
toast, dropdown, theme, typography, etc. Built with Sass and Floating
UI. Used by oko_attached and all apps/.
All Next.js 16 unless noted. Common stack: TanStack Query/Table, Zustand, react-hook-form.
| App | Port | Purpose |
|---|---|---|
demo_web |
3200 | SDK integration demo (all chains) |
customer_dashboard |
3203 | Business/merchant dashboard |
oko_admin_web |
3204 | Internal admin (KSN nodes, users, sig shares) |
docs_web |
3205 | Documentation site (Docusaurus, not Next.js) |
user_dashboard |
3206 | End-user asset management and connected apps |
attached_mobile_host_web |
3207 | iframe host for mobile ↔ oko_attached communication |
email_template_2 |
3000 | Email template builder (static export) |
ci/— CLI wrapper for build commands (yarn ci <command>)docker/,github/,vercel/— Deployment configs
node --version # v22.x.x or higher
corepack enable # Yarn 4.x
rustup install # uses rust-toolchain in repo root
cargo install wasm-packyarn install --immutable
yarn ci build_cs # WASM: tECDSA (Cait-Sith)
yarn ci build_frost # WASM: tEdDSA (FROST)
yarn ci build_pkgs # Internal TS packages
yarn ci build_sdk # SDK packages
yarn ci typecheckAfter modifying .ts, .tsx, .js, or .jsx files, always run:
yarn ci typecheck— TypeScript type checking across all packagesyarn exec biome check --write .— Auto-fix lint and formatting errors
- TypeScript: Biome (
@biomejs/biome) - Rust:
cargo fmt - Run
yarn ci lang_checkbefore commits
Uses @asteasolutions/zod-to-openapi. When modifying routes, update both:
- Schema — Zod types with
.openapi()inbackend/openapi/src/orkey_share_node/server/src/openapi/schema/ - Route —
registry.registerPath()alongside the Express handler
Follow the <scope>: <description> format. Scope is the package or area being
changed. Use lowercase, imperative mood. Always write in English.
demo_web: fix load listener leak in useThemeSyncToIframe
sdk: polyfill Event for RN wallet-standard compatibility
project: fix biome lint and format errors
Use the template in .github/pull_request_template.md. Always write in English.
PR title follows the same <scope>: <description> format as commit messages.
- Check the
CONTRIBUTING.mdacknowledgement - Write a Summary explaining what changed, why, and the impact
- Add Links to related issues or PRs (e.g.,
Closes #123)
Do not commit, push, or create PRs unless the user explicitly asks. Always wait for confirmation before performing any git operation that affects the repository history or remote.
- Adding chain support — Extend
oko_sdk_core, create chain-specific SDK - Crypto changes — Modify Rust in
crypto/, rebuild WASM, update TS interfaces - API changes — Update backend route + OpenAPI schema
- UI changes — Components in
ui/oko_common_ui/, apps inapps/
cargo test --workspace # Rust tests
yarn ci typecheck # TypeScript validationAll PRs must pass: yarn ci typecheck + cargo check --workspace
| Command | Description |
|---|---|
yarn ci build_cs |
Build tECDSA WASM |
yarn ci build_frost |
Build tEdDSA WASM |
yarn ci build_pkgs |
Build internal packages |
yarn ci build_sdk |
Build SDK packages |
yarn ci typecheck |
TypeScript typecheck |
yarn ci lang_check |
Code style check |
yarn ci lang_format |
Code formatting |
yarn ci deps_check |
Dependency verification |
cargo check --workspace |
Rust workspace check |
cargo test --workspace |
Rust tests |