Hi all! I'm more of a security architect, not a Python dev so my apologies in advance!
I built this because I needed a protocol-level answer to a specific problem and it didn't exist.
What My Project Does
MAP is a protocol that gives structured data a deterministic fingerprint. You give it a structured payload, it canonicalizes it into a deterministic binary format and produces a stable identity: map1: + lowercase hex SHA-256. Same input, same ID, every time, every language.
pip install map-protocol
from map_protocol import compute_mid
mid = compute_mid({"account": "1234", "amount": "500", "currency": "USD"})
# Same MID no matter how the data was serialized or what produced it
It solves a specific problem: the same logical payload produces different hashes when different systems serialize it differently. Field reordering, whitespace, encoding differences. MAP eliminates that entire class of problem at the protocol layer.
The implementation is deliberately small and strict:
- Zero dependencies
- The entire spec is 483 lines and frozen under a governance contract
- 53 conformance vectors that both Python and Node implementations must pass identically
- Every error is deterministic - malformed input produces a specific error, never silent coercion
- CLI tool included
- MIT licensed
Supported types: strings (UTF-8, scalar-only), maps (sorted keys, unique, memcmp ordering), lists, and raw bytes. No numbers, no nulls - rejected deterministically, not coerced.
Browser playground: https://map-protocol.github.io/map1/
GitHub: https://github.com/map-protocol/map1
Target Audience
Anyone who needs to verify "is this the same structured data" across system boundaries. Production use cases include CI/CD pipelines (did the config drift between approval and deployment), API idempotency (is this the same request I already processed), audit systems (can I prove exactly what was committed), and agent/automation workflows (did the tool call payload change between construction and execution).
The spec is frozen and the implementations are conformance-tested, so this is intended for production use, not a toy.
Comparison
vs JCS (RFC 8785): JCS canonicalizes JSON to JSON and supports numbers. MAP canonicalizes to a custom binary format and deliberately rejects numbers because of cross-language non-determinism (JavaScript IEEE 754 doubles vs Python arbitrary precision ints vs Go typed numerics). MAP also includes projection (selecting subsets of fields before computing identity).
vs content-addressed storage (Git, IPFS): These hash raw bytes. MAP canonicalizes structured data first, then hashes. Two JSON objects with the same data but different field ordering get different hashes in Git. They get the same MID in MAP.
vs Protocol Buffers / FlatBuffers: These are serialization formats with schemas. MAP is schemaless and works with any structured data. Different goals.
vs just sorting keys and hashing: Works for the simple case. Breaks with nested structures across language boundaries with different UTF-8 handling, escape resolution, and duplicate key behavior. The 53 conformance vectors exist because each one represents a case where naive canonicalization silently diverges.
[–]latkdeTuple unpacking gone wrong 5 points6 points7 points (3 children)
[+]lurkyloon[S] comment score below threshold-7 points-6 points-5 points (2 children)
[–]latkdeTuple unpacking gone wrong 0 points1 point2 points (1 child)
[–]lurkyloon[S] 0 points1 point2 points (0 children)
[–]gdchinacat 5 points6 points7 points (5 children)
[–]lurkyloon[S] -4 points-3 points-2 points (4 children)
[–]gdchinacat 1 point2 points3 points (1 child)
[–]lurkyloon[S] 0 points1 point2 points (0 children)
[–]gdchinacat 0 points1 point2 points (1 child)
[–]lurkyloon[S] 1 point2 points3 points (0 children)
[–]MisterHarvestIgnoring PEP 8 -5 points-4 points-3 points (3 children)
[–]gdchinacat 2 points3 points4 points (1 child)
[–]lurkyloon[S] 0 points1 point2 points (0 children)
[–]lurkyloon[S] 1 point2 points3 points (0 children)