dca8ac95b9ed7e146c20080f7f68abf75704fcad
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:
- Installs dependencies (Go, Bun)
- Builds the WASM plugin
- Builds the TypeScript SDK
- 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 |
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
Languages
Go
73.3%
TypeScript
12.2%
HTML
7%
JavaScript
6.4%
Makefile
0.8%
Other
0.3%