Verify a Log Entry
# Verify a Merkle inclusion proof (requires curl + python3)
# 1. Fetch the certificate entry and save it to a file:
curl -fsS "https://api.ultimateteam.ai/api/v1/trust/agent-certificates/<FINGERPRINT_OR_UUID>" -o cert.json
# 2. Recompute the root from cert.json's 'merkle_inclusion_proof'
# (leaf_hash + sibling_hashes) and compare it to 'merkle_root':
python3 - cert.json <<'PY'
import hashlib, json, sys
with open(sys.argv[1]) as f:
proof = json.load(f)['merkle_inclusion_proof']
h = proof['leaf_hash']
for s in proof['sibling_hashes']:
left, right = (h, s['hash']) if s['position'] == 'right' else (s['hash'], h)
h = hashlib.sha256((left + right).encode()).hexdigest()
assert h == proof['merkle_root'], 'Inclusion proof failed: computed ' + h
print('Verified: leaf', proof['leaf_index'], 'is in the tree at root', h)
PY
# 3. Confirm the printed root appears in the Root History above, or in
# https://api.ultimateteam.ai/api/v1/trust/transparency/merkle-roots