SNAPKITTYWEST/mantra
MANTRA A deterministic, auditable programming language for ledger operations, cryptographic sealing, and verified integer computation. Zero external dependencies. Pure Python. Auditable SHA-256. MUMPS gateway. SnapKitty West / SNAPKITTYWEST — Evidence or Silence — 2026 What It Is MANTRA is a purpose-built language for sovereign ledger operations. Every computation is deterministic and traceable. Every output can be cryptographically sealed. No external… See the full description on the dataset page: https://huggingface.co/datasets/SNAPKITTYWEST/mantra.
MANTRA
A deterministic, auditable programming language for ledger operations, cryptographic sealing, and verified integer computation.
Zero external dependencies. Pure Python. Auditable SHA-256. MUMPS gateway.
SnapKitty West / SNAPKITTYWEST — Evidence or Silence — 2026
What It Is
MANTRA is a purpose-built language for sovereign ledger operations. Every computation is deterministic and traceable. Every output can be cryptographically sealed. No external dependencies — the SHA-256 implementation is pure Python and auditable line by line.
# Constants and variables
const GENESIS = "0000000000000000000000000000000000000000000000000000000000000000"
let amount = 450000
# Annotated deterministic function
@deterministic
define seal(tx)
let h = sha256(tx)
Result::ok(h)
end
# Run
python mantra.py run examples/ledger.m
python mantra.py hash "hello world"Test Status
Architecture
mantra/
├── mantra.py CLI (run / eval / hash / test)
├── lexer/lexer.py Tokenizer (HEX, BYTES, annotations, keywords)
├── mantra_ast/nodes.py AST dataclasses
├── parser/parser.py Pratt parser + field access + dict literals
├── runtime/
│ ├── types.py Integer, Boolean, Bytes, String, DictValue, Option, Result
│ ├── evaluator.py Tree-walking evaluator with closures + builtins
│ ├── runtime.py run_source / run_file
│ └── stdlib/
│ ├── integer.py add/sub/mul/div/mod/pow with overflow checking
│ ├── bit.py band/bor/bxor/bnot/shl/shr/rotl/rotr
│ ├── bytes.py concat/slice/len/get_byte
│ ├── string.py to_bytes/from_bytes/concat
│ ├── hex.py bytes_to_hex/hex_to_bytes
│ ├── sha256.py sha256/sha256_hex (wraps auditable impl)
│ ├── collections.py list_len/list_get/dict_get
│ ├── result.py ok/err/some/none
│ └── testing.py assert_eq/assert_true/assert_false
├── sha256/
│ ├── sha256_impl.py Pure-Python SHA-256 (no hashlib, fully auditable)
│ └── vectors.py NIST canonical test vectors
├── gateway/
│ └── mumps_gateway.py 300-byte binary record pack/unpack/dispatch (IBM i bridge)
└── examples/
├── ledger.m Transaction seal (end-to-end working)
└── treasury.m Multi-step ledger chainKey Properties
License
Trilicensed: Apache-2.0 / MIT / Sovereign-Source-1.0 (see LICENSES/)
