Skip to content

spacesprotocol/libveritas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Libveritas

Stateless verification for Bitcoin handles using the Spaces protocol.

Similar to BIP-353, but replaces centralized ICANN signing keys with a permissionless trust anchor.

Usage

Verifying the handle alice@bitcoin:

use std::fs;
use libveritas::Veritas;

let anchors = fs::read("trust_anchors.json")?; // created by spaced
let veritas = Veritas::from_anchors(serde_json::from_slice(&anchors)?)?;

let bitcoin_cert = fs::read("bitcoin.cert")?;
let alice_cert = fs::read("alice_bitcoin.cert")?;

// verify @bitcoin top level handle
let bitcoin_zone = veritas.verify(bitcoin_cert, None)?;

// verify an off-chain handle e.g. alice@bitcoin
let alice_zone = veritas.verify(alice_cert, Some(&bitcoin_zone))?;

println!("@bitcoin zone: {:?}", bitcoin_zone);
println!("alice@bitcoin zone: {:?}", alice_zone);

That's it!

About

Stateless verification for Bitcoin handles using the Spaces protocol

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages