2026-01-07 21:10:00 -05:00

Motr Enclave

Extism WASM plugin providing encrypted key storage for Nebula wallet. Built with Go 1.25+ for wasip1.

Quick Start

make start

This single command:

  1. Installs dependencies (Go, Bun)
  2. Builds the WASM plugin
  3. Builds the TypeScript SDK
  4. Starts the dev server at http://localhost:8080

Manual Setup

make deps      # Install tooling
make build     # Build WASM plugin
make sdk       # Build TypeScript SDK
make dev       # Start dev server

Usage

TypeScript/ESM

import { createEnclave } from '@sonr/motr-enclave';

const enclave = await createEnclave('/enclave.wasm');

const { did, database } = await enclave.generate(credential);

await enclave.load(database);

const accounts = await enclave.exec('resource:accounts action:list');

const didDoc = await enclave.query();

CLI

make test-plugin

Plugin Functions

Function Input Output
generate WebAuthn credential (base64) DID + database buffer
load Database buffer Success status
exec Filter string + optional UCAN Action result
query DID (optional) DID document

Database Schema

The database schema is defined in db/schema.sql.

!.github/db-schema.png

Project Structure

motr-enclave/
├── main.go           # Go plugin source
├── src/              # TypeScript SDK
├── dist/             # Built SDK
├── example/          # Browser test app
├── db/               # SQLite schema
└── Makefile

Development

make test      # Run Go tests
make lint      # Run linter
make clean     # Remove build artifacts
Description
No description provided
Readme 3 MiB
Languages
Go 73.3%
TypeScript 12.2%
HTML 7%
JavaScript 6.4%
Makefile 0.8%
Other 0.3%