Minimal, runnable examples showing how to perform zk signing and call onboarding-related endpoints across Go, Python, and Node.js. Each demo derives seeds → initializes a ZkLink signer → computes l2Key / pubKeyHash → generates apiKeyHash + apiSignature for /v3/new-onboarding.
These are reference examples to help you integrate quickly. Adapt endpoints, providers, and error handling for production use.
go/— zk signing +/v3/generate-nonce→/v3/new-onboardingexamplepython/— same flow using the official Python SDK where applicablenodejs/— browser/Node-compatible flow with zklink web SDK (wasm) and ethers
Each language outputs (to stdout) the core artifacts:
seeds(hex, lowercased, no0x)l2Key(ZK public key)pubKeyHashapiKeyHash(bn1|signMsg)apiSignature(MuSig result forAPEX-SIGNATUREheader)
-
Environment
APEX_ENV—MAINorTESTAPEX_PRIVATE_KEY— your Ethereum private key (0x-prefixed)APEX_ADDRESS— your Ethereum address (optional; will be derived if omitted)APEX_CHAIN_ID— target chain id (e.g.,84532)
-
Toolchains
- Go 1.20+ · Python 3.9+ · Node.js 18+
- Internet access to install deps (or use vendored modules)
Security: never commit secrets. Use a .env/.env.local or a secure secrets manager.
- Clock sync matters for nonce and expiration validation.
- Reuse
seeds/l2Keyacross requests; do not re-derive every time. - Prefer the official Python SDK for the fastest path:
MIT (examples only). See individual files for any third-party licenses.