Skip to content

feat: add zcash wallet and mediator services#517

Open
macterra wants to merge 7 commits into
mainfrom
zcash-wallet-service
Open

feat: add zcash wallet and mediator services#517
macterra wants to merge 7 commits into
mainfrom
zcash-wallet-service

Conversation

@macterra
Copy link
Copy Markdown
Collaborator

@macterra macterra commented May 12, 2026

Summary

Adds transparent-only Zcash wallet and mediator services. The wallet matches the satoshi-wallet HTTP contract as closely as practical while using Zebra for chain/address-index/broadcast RPCs and Keymaster for mnemonic-backed local signing. The mediator mirrors the satoshi-mediator import/export flow for ZEC:* registries.

What changed

  • Added services/mediators/zcash-wallet with deterministic transparent derivation, Zebra RPC support, wallet routes, local transaction signing, send/anchor support, and explicit unsupported fee bumping.
  • Added services/mediators/zcash to scan Zebra blocks for OP_RETURN batch DIDs, import discovered batches, export Gatekeeper queues through zcash-wallet, and publish block metadata.
  • Added Docker/compose wiring, sample env entries, docs, ZEC registry support in TypeScript/Rust Gatekeeper validators, and focused registry/wallet tests.
  • Added repo guidance documenting Zebra-backed transparent-only wallet behavior and ZEC registry naming.

Validation

  • npm run build in services/mediators/zcash-wallet
  • npm run build in services/mediators/zcash
  • npm test -- --runTestsByPath tests/gatekeeper/utils.test.ts tests/wallet/zcash-derivation.test.ts tests/wallet/zcash-wallet.test.ts --runInBand
  • cargo check --manifest-path rust/services/gatekeeper/Cargo.toml
  • git diff --check
  • Live read-only Zebra smoke against http://100.70.86.134:8232/: getblockcount, address-index RPCs, and verbosity-2 block shape for mediator scanning.

No broadcast was attempted. cargo fmt --check --manifest-path rust/services/gatekeeper/Cargo.toml still reports pre-existing formatting drift across the Rust service beyond this change.

@macterra macterra changed the title [codex] add zcash wallet service [codex] add zcash wallet and mediator services May 12, 2026
@macterra macterra changed the title [codex] add zcash wallet and mediator services feat: add zcash wallet and mediator services May 12, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Zcash (transparent-only) support to Archon by introducing a Zebra-backed wallet service (Keymaster mnemonic + local signing) and a companion mediator that scans/anchors OP_RETURN batch DIDs, plus wiring/testing/docs to integrate ZEC:* registries end-to-end.

Changes:

  • Introduces new zcash-wallet HTTP service (Zebra RPC + local transparent signing) and new zcash mediator (scan/import/export + metrics).
  • Extends Gatekeeper registry validation to include ZEC:mainnet and ZEC:testnet (TypeScript + Rust) and updates sample configuration.
  • Adds Dockerfiles/compose integration and Jest tests covering derivation and RPC-backed wallet behavior.

Reviewed changes

Copilot reviewed 33 out of 37 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/wallet/zcash-wallet.test.ts New Jest coverage for RPC-backed wallet flows (setup, balance/UTXO normalization, anchoring).
tests/wallet/zcash-derivation.test.ts New tests for derivation, coin type selection, and OP_RETURN size validation.
tests/gatekeeper/utils.test.ts Updates registry listing tests to include ZEC:* registries.
services/mediators/zcash/tsconfig.json TypeScript build config for the Zcash mediator package.
services/mediators/zcash/src/zcash-mediator.ts New mediator service: scans Zebra blocks for OP_RETURN batch DIDs; imports/exports via Gatekeeper/Keymaster and zcash-wallet; exposes metrics.
services/mediators/zcash/src/types/bitcoin-core/index.d.ts Local bitcoin-core type shim for the mediator’s RPC usage.
services/mediators/zcash/src/types.ts Shared mediator DB/types (discovered items, registry block verbosity, etc.).
services/mediators/zcash/src/db/sqlite.ts SQLite persister backend for mediator state.
services/mediators/zcash/src/db/redis.ts Redis persister backend for mediator state.
services/mediators/zcash/src/db/mongo.ts MongoDB persister backend for mediator state.
services/mediators/zcash/src/db/jsonfile.ts JSON-file persister backend for mediator state.
services/mediators/zcash/src/db/abstract-db.ts Shared locking updateDb implementation for persisters.
services/mediators/zcash/src/config.ts Env-driven configuration for the Zcash mediator.
services/mediators/zcash/README.md Mediator documentation: responsibilities, env vars, notes on fee bumping behavior.
services/mediators/zcash/package.json Package metadata/deps for the Zcash mediator.
services/mediators/zcash/data/.gitignore Ignores persisted mediator state in services/mediators/zcash/data.
services/mediators/zcash-wallet/tsconfig.json TypeScript build config for the Zcash wallet service package.
services/mediators/zcash-wallet/src/zcash-wallet.ts New wallet core: address tracking, balance/UTXO views, local tx building/signing/broadcast, OP_RETURN anchoring.
services/mediators/zcash-wallet/src/zcash-rpc.ts Zebra JSON-RPC client wrapper.
services/mediators/zcash-wallet/src/wallet-api.ts New Express HTTP API matching satoshi-wallet contract (admin-key gated) + metrics.
services/mediators/zcash-wallet/src/derivation.ts BIP44 transparent derivation and address generation for Zcash (mainnet/testnet).
services/mediators/zcash-wallet/src/config.ts Env-driven configuration for the Zcash wallet service.
services/mediators/zcash-wallet/package.json Package metadata/deps for the Zcash wallet service.
services/mediators/zcash-wallet/package-lock.json Lockfile for the Zcash wallet service dependencies.
sample.env Adds ZEC-related env examples and includes ZEC:mainnet in Gatekeeper registries.
rust/services/gatekeeper/src/api.rs Allows ZEC:mainnet/ZEC:testnet in Rust Gatekeeper registry validation.
packages/gatekeeper/src/gatekeeper.ts Allows ZEC:mainnet/ZEC:testnet in TS Gatekeeper registry validation.
package.json Adds @bitgo/utxo-lib dependency at repo root (needed for shared/test builds).
package-lock.json Updates lockfile for new root dependency graph.
docs/services/mediators/zcash-wallet/README.md Wallet documentation: scope, routes, config, Zebra RPC requirements.
docs/services/gatekeeper/README.md Documents ZEC:* as supported registries.
Dockerfile.zcash-wallet Container build for the wallet service.
Dockerfile.zcash Container build for the mediator service.
docker-compose.zcash-mainnet.yml Compose stack for Zcash wallet + mediator on mainnet.
docker-compose.yml Includes Zcash compose and adds ZEC:mainnet to explorer networks.
AGENTS.md Adds repo guidance for Zebra-backed transparent-only wallet behavior and registry validator updates.
Files not reviewed (1)
  • services/mediators/zcash-wallet/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread services/mediators/zcash-wallet/src/zcash-wallet.ts Outdated
Comment thread services/mediators/zcash/src/db/sqlite.ts
Comment thread services/mediators/zcash/data/.gitignore
@macterra macterra marked this pull request as ready for review May 12, 2026 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants