Skip to content

willyrgf/mfm

Repository files navigation

MFM

Experimental, WIP toolkit for on-chain operations built around an event-sourced state machine runtime.

WARNING: Not production-ready. Do not use on mainnet.

Architecture at a glance

flowchart TD
    B["bin/cli<br/>bin/rest-api<br/>(transport only)"] --> A["crates/app<br/>(typed assembly)"]
    A --> O["crates/ops/*-op<br/>(typed program planning)"]
    O --> SH["crates/states/*<br/>(typed executable states)"]
    SH --> AD["crates/adapters/*<br/>(runner bindings)"]
    AD --> CAP["capability + signer contracts<br/>(typed authority)"]
    CAP --> TP["crates/transports/*<br/>(live protocol backends)"]
    CAP --> SG["crates/signers/*<br/>(signer providers)"]
    A --> R["crates/kernel/runtime<br/>(typed scheduler)"]
    R --> K["crates/kernel/*<br/>(ids, values, spec, events, store, replay)"]
    R --> ST["crates/storages/*<br/>(mfm-store implementations)"]

    classDef transport fill:#e8f0ff,stroke:#2f5aa8,color:#0f2d63,stroke-width:1px;
    classDef orchestration fill:#eefbe7,stroke:#3a7a2a,color:#1d4d12,stroke-width:1px;
    classDef statecore fill:#ffe8cf,stroke:#a84b00,color:#5a2b00,stroke-width:3px;
    classDef engine fill:#fff3df,stroke:#a66a00,color:#5a3a00,stroke-width:1px;
    classDef storage fill:#f3ebff,stroke:#6d3da8,color:#39136b,stroke-width:1px;
    classDef adapter fill:#e9f8f7,stroke:#0d7a77,color:#084645,stroke-width:1px;

    class B transport;
    class A,O orchestration;
    class SH statecore;
    class R,K engine;
    class ST storage;
    class AD adapter;
    class CAP,TP,SG transport;
Loading

Typed state programs are the semantic executable surface. Ops plan typed programs, the certified typed execution spec is the runtime contract, states declare reusable semantics, adapters bind state intent to capability contracts, transports/signers provide reusable platform implementations, and binaries stay transport-only.

Core capabilities

  • Event-sourced certified typed runs with append-only execution history.
  • Crash-resume and replay-aware typed execution semantics.
  • Certified saga remediation with signed manual authorization decisions.
  • Content-addressed manifests, snapshots, facts, and outputs.
  • Deterministic typed-state orchestration for ops/pipelines.
  • Thin CLI and REST transport layers for typed automation surfaces.
  • Security-hardened Ethereum keystore (tamper checks + signing utilities).
  • Typed storage backends for run events and artifacts.

Current workflow surface

The compiled application exposes exactly one public run objective: mfm.portfolio/snapshot@1. Its root composes reusable Bitcoin and EVM collector operations, then passes their typed receipts to one store-backed portfolio report operation. EVM contract validation and transaction submission remain reusable library/test foundations, but production app certification, runner, and replay assembly does not register them.

Documentation

Start here:

User-facing docs:

Crate docs:

Development and operations:

Development

Use the pinned default Nix shell for Rust development. The build and verification contract owns the focused commands, task selection, gate composition, and artifact policy.

Discover runnable flake apps and run binaries locally:

nix run .#help
nix run .#mfm -- --help
nix run .#mfm -- ops list
nix develop -c cargo run -p mfm -- --help
nix develop -c cargo run -p mfm-rest-api

The CLI reference owns commands, output behavior, and the custom .#mfm app's managed PostgreSQL lifecycle.

License

MIT (see LICENSE).

About

WIP: a platform for on-chain operations

Topics

Resources

Stars

Watchers

Forks

Used by

Contributors

Languages