json_atomic 0.1.1

The Cryptographic Atom — JSON✯Atomic: canonicalization + BLAKE3 content addressing + DV25-Seal (Ed25519) for Signed Facts
Documentation
1
2
3
4
5
6
7
8
9
10
11
use ed25519_dalek::SigningKey;
use json_atomic::{seal_value, verify_seal};
use serde_json::json;

fn main() {
    let sk = SigningKey::from_bytes(&[7u8; 32]);
    let value = json!({"b":1,"a":"Café"});
    let fact = seal_value(&value, &sk).unwrap();
    verify_seal(&fact).unwrap();
    println!("CID(hex)={}", fact.cid_hex());
}