Zero-Dependency Ed25519 Manifest Signing and Sparkle Cross-Verification for Local AI Runtimes
Zero-Dependency Ed25519 Manifest Signing and Sparkle Cross-Verification for Local AI Runtimes
Reporting signed: true by reading a JSON boolean provides zero cryptographic guarantee: an unverified MITM response or mutated payload field can set "signed": true while rewriting download URLs and SHA-256 digests.
In commit 44ecec5caa39d48c7aaa5f0fafa666643f0e2768 under github.com/karany97/destiny/tree/main/mcp, we upgraded Destiny’s zero-dependency MIT MCP server (io.github.karany97/destiny@2.0.0) so both model manifest enumeration (list_destiny_models) and release verification (verify_destiny_release) enforce real cryptographic checks and multi-source agreement using Python >=3.10 standard library only.
1. Canonical Domain-Separated Ed25519 Signing (DESTINY-MODELS-V1.)
The live catalog at models.nandai.org/v1/models-manifest.json ships a signed envelope containing:
schema:destiny-models-manifest-v1kid:destiny-ota-ed25519-v1public_key_b64:7y6YzFY2ZxGdGx5secvm35hiuE9G7R6YTD0rbPcb8vA=(32-byte raw Ed25519 public key)payload_b64u: URL-safe Base64 encoding of the canonical38-entry manifest (177.9106GB across GGUF/ONNX/image assets)signature_b64u:64-byte Ed25519 signature over the exact byte sequence"DESTINY-MODELS-V1." + payload_b64u
Signing the encoded payload_b64u string rather than re-serializing an in-memory dictionary avoids JSON whitespace or key-ordering ambiguity. Crucially, list_destiny_models also checks inline_manifest == decoded_manifest so altering the convenience manifest object while leaving payload_b64u and signature_b64u intact cannot slip unsigned URLs past verification.
2. Zero-Dependency OpenSSL SPKI DER -rawin Verification & Tamper Rejection
Because Python’s standard library does not include an Ed25519 primitive, wrapping the raw 32-byte Ed25519 public key into ASN.1 SubjectPublicKeyInfo DER requires only a fixed 12-byte OID prefix (id-Ed25519 1.3.101.112):
30 2a 30 05 06 03 2b 65 70 03 21 00 || <32-byte raw Ed25519 public key>
The verifier writes the 44-byte pub.der, 64-byte sig.bin, and "DESTINY-MODELS-V1." + payload_b64u message bytes into an ephemeral tempfile.TemporaryDirectory() and invokes:
openssl pkeyutl -verify -pubin -keyform DER -inkey pub.der -rawin -in msg.bin -sigfile sig.bin
Cross-platform behavior verified in mcp/test_mcp_stdio.py:
- Linux & OpenSSL 3 hosts: Returns
Signature Verified Successfully(ed25519_signature_verified: true,ed25519_verification_status: "verified"). - macOS Darwin: System
/usr/bin/openssl(LibreSSL 3.3.6) printsunknown option '-rawin', so the resolver checks Homebrew OpenSSL 3 (/opt/homebrew/opt/openssl@3/bin/openssl) automatically before falling back cleanly (ed25519_signature_verified: null,ed25519_verification_status: fallback_*) on minimal environments lacking-rawin. - Fail-Closed Single-Bit Tamper Rejection: Flipping any bit in
signature_b64uorpayload_b64uproduces OpenSSL exit1(Signature Verification Failure), setsed25519_signature_verified: false(verification_failed), and forcesok: false.
3. Multi-Source Release Cross-Verification (appcast.json + appcast.xml + SHA256SUMS.txt)
Instead of trusting a single release JSON endpoint, verify_destiny_release now cross-verifies four independent artifacts:
- nandai.org/appcast.json (
schema: destiny-appcast-v1,kid: destiny-ota-ed25519-2026-v1,version: 2.0.0,build: 2000,size_bytes: 271345746) - Sparkle XML dl.nandai.org/appcast.xml parsed with Python stdlib
xml.etree.ElementTree, assertingsparkle:edSignature(64decoded bytes), matchinglength="271345746", matchingsparkle:sha256, and matching version/build (appcast_xml_verified: true) - Release checksum manifest GitHub v2.0.0 SHA256SUMS.txt, matching
Destiny-macOS-AppleSilicon.dmgandDestiny-2.0.0.dmgto2da76c011c1bd511cc5547ff152b8b7382cf7793cc5d7e13078ba317abd54a3e(release_checksums_verified: true) HEADprobe confirming un-gated271,345,746bytes (pin_gate_active: false) plus localcodesign --verify --deep --stricton macOS (TeamIdentifier=J5BH67967P,com.destiny.sovereign)
Full documentation, reproducible E2E stdio test suite, and security posture details are published at nandai.org/security/ and nandai.org/.well-known/mcp.json.
- Reference: https://github.com/karany97/destiny/tree/main/mcp
- Reference: https://github.com/karany97/destiny/commit/44ecec5caa39d48c7aaa5f0fafa666643f0e2768
- Reference: https://models.nandai.org/v1/models-manifest.json
- Reference: https://dl.nandai.org/appcast.xml
- Reference: https://nandai.org/security/
Write a comment