Multi-purpose WebAssembly service providing secure cryptographic vault operations and payment processing for the Sonr ecosystem.
Motor (motr) is a comprehensive WebAssembly-based service that provides:
- Worker: WASM-based cryptographic vault operations (formerly "vault")
- Vault: Extism plugin for secure key management and multi-party computation
- TypeScript SDK: Browser and Node.js client libraries
- Frontend App: TanStack-based web application
The name "Motor" reflects its role as the execution engine powering secure operations in the Sonr ecosystem.
sonr-io/motr/
βββ cmd/ # Go commands
β βββ worker/ # WASM worker (HTTP server, payment gateway)
β βββ vault/ # WASM vault (Extism plugin, crypto operations)
β
βββ crypto/ # Cryptographic library (Go)
β βββ core/ # Core primitives
β βββ signatures/ # BLS, BBS+, Schnorr
β βββ sharing/ # Shamir, Feldman VSS
β βββ mpc/ # Multi-party computation
β βββ tecdsa/ # Threshold ECDSA
β βββ zkp/ # Zero-knowledge proofs
β
βββ packages/ # TypeScript packages
β βββ es/ # @sonr.io/sdk - Core SDK
β βββ ui/ # @sonr.io/ui - UI components
β βββ do/ # @sonr.io/do - Durable Objects
β
βββ apps/ # Applications
β βββ frontend/ # TanStack React frontend
β
βββ docs/ # Documentation
βββ Makefile # Build automation
βββ package.json # Root package config
βββ turbo.json # Turborepo config
βββ .goreleaser.yml # Release automation
# Clone the repository
git clone https://github.com/sonr-io/motr.git
cd motr
# Install dependencies
pnpm install
# Build all components
make build # Build Go/WASM components
pnpm build # Build TypeScript packages
# Start frontend development server
make dev
# Build worker WASM
make build-worker
# Build vault WASM
make build-vault
# Run tests
make test # Go tests
pnpm test # TypeScript tests
# Format and lint
make fmt # Format Go code
pnpm format # Format and lint TypeScript with oxlint
HTTP server and payment gateway running as WebAssembly:
- Technology: Go β WASM via TinyGo
- Runtime: Browser service worker or Node.js
- Features:
- W3C Payment Handler API
- OIDC authorization server
- HTTP request handling
- Secure payment processing
# Build worker
make build-worker
# Output: dist/worker/worker.optimized.wasm
Cryptographic vault operations with Extism plugin:
- Technology: Go β WASM via TinyGo + Extism
- Runtime: Extism (cross-platform)
- Features:
- MPC enclave management
- Multi-chain transaction signing
- WebAuthn integration
- IPFS import/export
# Build vault
make build-vault
# Output: dist/vault/vault.plugin.wasm
Key Exports:
generate
: Create new MPC enclavesign
: Sign transactions/messagesverify
: Verify signaturesexport
/import
: IPFS vault managementsign_cosmos_transaction
: Cosmos SDK signingsign_evm_transaction
: Ethereum/EVM signing
Comprehensive cryptographic primitives in Go:
- Curves: Ed25519, Secp256k1, P-256, BLS12-381, Pallas/Vesta
- Signatures: BLS, BBS+, Schnorr, ECDSA, EdDSA
- Secret Sharing: Shamir, Feldman VSS, Pedersen VSS
- MPC: Threshold ECDSA, Threshold Ed25519 (FROST)
- Advanced: Accumulators, Bulletproofs, Paillier, VRF, ZKP
# Test crypto library
make test-crypto
Browser and Node.js integration:
# Install
pnpm add @sonr.io/sdk
# Build SDK
pnpm --filter '@sonr.io/sdk' build
Usage:
import { createVaultClient } from '@sonr.io/sdk';
// Initialize vault client
const client = await createVaultClient({
rpcUrl: 'http://localhost:26657',
restUrl: 'http://localhost:1317',
});
// Generate vault
const vault = await client.generate({ id: 'my-vault' });
// Sign message
const signature = await client.sign({
message: new Uint8Array([1, 2, 3]),
enclave: vault.data,
});