Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1169

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176
8000 GitHub - sonr-io/motr: 🚧 Under Construction | JS Light Node for the Sonr Network
Nothing Special   »   [go: up one dir, main page]

Skip to content

sonr-io/motr

Repository files navigation

Motor (motr)

Multi-purpose WebAssembly service providing secure cryptographic vault operations and payment processing for the Sonr ecosystem.

License: MIT Go Version TinyGo TypeScript

Overview

Motor (motr) is a comprehensive WebAssembly-based service that provides:

  1. Worker: WASM-based cryptographic vault operations (formerly "vault")
  2. Vault: Extism plugin for secure key management and multi-party computation
  3. TypeScript SDK: Browser and Node.js client libraries
  4. Frontend App: TanStack-based web application

The name "Motor" reflects its role as the execution engine powering secure operations in the Sonr ecosystem.

Repository Structure

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

Quick Start

Prerequisites

Installation

# 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

Development

# 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

Components

1. Worker (WASM)

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

2. Vault (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 enclave
  • sign: Sign transactions/messages
  • verify: Verify signatures
  • export/import: IPFS vault management
  • sign_cosmos_transaction: Cosmos SDK signing
  • sign_evm_transaction: Ethereum/EVM signing

3. Crypto Library

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

4. TypeScript SDK

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,
});
< 8000 div class="markdown-heading" dir="auto">

5. Frontend App

Modern web application with TanStack:

# Start dev server
make dev

# Build for production
cd apps/frontend && pnpm build

# Deploy to Cloudflare
make dev-deploy

Tech Stack:

  • React 19
  • TanStack Router, Query, DB, Form
  • Vite
  • Tailwind CSS
  • Cloudflare Workers

Build System

Makefile Targets

make help              # Show all targets
make build             # Build all Go/WASM components
make build-worker      # Build worker WASM
make build-vault       # Build vault WASM
make test              # Run all Go tests
make test-crypto       # Run crypto tests
make fmt               # Format Go code
make lint              # Lint Go code
make clean             # Clean build artifacts
make dev               # Start frontend dev server
make version           # Display version info

pnpm Scripts

pnpm build             # Build all TypeScript packages
pnpm test              # Run all tests
pnpm lint              # Lint with oxlint
pnpm format            # Format and lint with oxlint
pnpm typecheck         # Type check all packages
pnpm gen:protobufs     # Generate protobuf types

Testing

Go Tests

# All tests
make test

# Specific components
make test-worker
make test-vault
make test-crypto

# With coverage
make test-coverage

# Benchmarks
make bench

TypeScript Tests

# All packages
pnpm test

# Specific package
pnpm --filter '@sonr.io/sdk' test

# With UI
pnpm test --ui

Deployment

Release with GoReleaser

# Test configuration
goreleaser check

# Create snapshot (no git tag required)
goreleaser release --snapshot --clean

# Create production release
git tag v0.1.0
git push origin v0.1.0
goreleaser release --clean

Artifacts:

  • motr_worker_*.tar.gz - Worker WASM
  • motr_vault_*.tar.gz - Vault WASM
  • motr_*.tar.gz - Combined archive
  • motr_checksums.txt - SHA256 checksums

NPM Packages

# Publish to npm
cd packages/es
pnpm publish

cd ../ui
pnpm publish

Documentation

Security

Cryptographic Operations

  • All cryptographic operations run in sandboxed WASM
  • Keys never leave the secure enclave
  • Multi-party computation for threshold operations
  • Zero-knowledge proofs for privacy

Reporting Security Issues

DO NOT open public issues for security vulnerabilities.

Email: security@sonr.io

Contributing

Contributions are welcome! Please read our contributing guidelines before submitting PRs.

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests and linting
  5. Submit a pull request

License

MIT License - see LICENSE for details

Links

Acknowledgments

Built with:


Made with ❀️ by the Sonr Team

About

🚧 Under Construction | JS Light Node for the Sonr Network

Topics

Resources

Stars

Watchers

Forks

4D01

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
0