Milestone 2: Middleware Service (Ethereum JSON-RPC API + supporting libraries)
- Scope:
- Ethereum JSON-RPC API Server (
pkg/ethrpc/,cmd/api-server/): MetaMask-compatible JSON-RPC server implementing theeth_*,net_*, andweb3_*method namespaces required for EVM wallet, dapp, indexer, and explorer interoperability. - Transaction Orchestration Engine: EVM-calldata → Canton-command translation, executed via Interactive Submission (PrepareSubmission → sign → ExecuteSubmission).
- Identity, Auth, and Onboarding: user registration via EIP-191 signatures, external-party allocation, JWT session management, EVM-signature verification (
pkg/auth/,pkg/registration/). - Pluggable Signer interface (
pkg/cantonsdk/token/types.go) with signatureSignDER(message []byte) ([]byte, error)andFingerprint() (string, error), wired through aKeyResolvercallback inpkg/app/api/server.goso signer implementations are selected at API server initialization time. This milestone ships one concrete implementation (CantonKeyPairinpkg/keys/canton_keys.go) backed by custodial secp256k1 keys with AES-256-GCM encryption at rest. The interface is designed to accept additional implementations without orchestrator changes: Milestones 5–6 add Snap-backed and institutional-custody-backed signers behind the same interface, selectable per deployment, per tenant, or per user. - Splice Registry client (
pkg/registry/) for wallet TransferFactory discovery. - Contract State Resolver: token + holding + bridge state resolution for transaction construction and EVM-shaped receipts.
- Indexer Integration Adapter: balance, holdings, and event queries served from the indexer backend.
- Infrastructure as Code: containerisation (Docker), Kubernetes manifests, configuration, observability.
- Ethereum JSON-RPC API Server (
| Field | Details |
|---|---|
| Estimated Resources | Engineering: 14 weeks; DevOps: 1 week; Project Management: 2 weeks |
| Estimated Duration | 7 weeks |
| Amount | 2,500,000 CC |
| Acceptance Criteria 1 | A stock MetaMask wallet connects to the middleware and completes an ERC-20 transfer against a CIP-56 token (USDCx) on MainNet through the eth_* surface, with no bespoke client integration. |
| Acceptance Criteria 2 | The documented eth_* / net_* / web3_* methods return EVM-shaped responses, and end-to-end onboarding (EIP-191 registration → external-party allocation → JWT session) works against a live endpoint. |