Proofs & Reconciliation
Merkle proofs
Section titled “Merkle proofs”Attestia generates Merkle-tree inclusion proofs for attestation packages. Each proof provides a tamper-evident path from a leaf (your attestation) to the tree root.
// Get the current Merkle root and leaf countvar rootInfo = await client.Proofs.MerkleRootAsync();Console.WriteLine($"Root: {rootInfo.Root}, Leaves: {rootInfo.LeafCount}");
// Fetch an attestation proof package and verify itvar package = await client.Proofs.GetAttestationAsync(attestationId);var result = await client.Proofs.VerifyProofAsync(package);
Console.WriteLine(result.Valid ? $"Proof valid — root {result.MerkleRoot}" : "Proof verification failed");An AttestationProofPackage contains the attestation data, its hash, the Merkle root, the inclusion proof (leaf hash, leaf index, sibling steps), and a package hash for integrity.
Three-way reconciliation
Section titled “Three-way reconciliation”The reconciliation engine performs deterministic three-way matching across three pairs:
- Intent vs. Ledger — does the ledger entry match what was declared?
- Ledger vs. Chain — does the on-chain result match the ledger?
- Intent vs. Chain — does the on-chain result match the original intent?
var report = await client.Reconciliation.ReconcileAsync(new ReconcileRequest{ Intents = intents, LedgerEntries = ledgerEntries, ChainEvents = chainEvents,});
// Check the summaryConsole.WriteLine(report.Summary.AllReconciled ? "All matched" : $"{report.Summary.MismatchCount} mismatches, {report.Summary.MissingCount} missing");Each match is classified with a MatchStatus: Matched, AmountMismatch, MissingLedger, MissingIntent, MissingChain, or Unmatched. The report includes separate lists for IntentLedgerMatches, LedgerChainMatches, and IntentChainMatches.
You can scope reconciliation by time range, intent ID, chain ID, or correlation ID using ReconciliationScope.
Attestation records
Section titled “Attestation records”After reconciliation, create a signed attestation record:
var attestation = await client.Reconciliation.AttestAsync(reconcileRequest);// attestation.ReportHash links back to the reconciliation reportAttestation records are paginated and queryable via ListAttestationsAsync.
Compliance mapping
Section titled “Compliance mapping”Map attestation controls to regulatory frameworks and generate scored compliance reports. Each control mapping tracks its status (Implemented, Partial, Planned, NotApplicable) along with evidence types and notes.
// List available frameworksvar frameworks = await client.Compliance.ListFrameworksAsync();
// Generate a scored report for a frameworkvar report = await client.Compliance.GetReportAsync(frameworkId);Console.WriteLine($"Score: {report.Score:P0} ({report.PassedControls}/{report.TotalControls})");The desktop app provides a dedicated Compliance view for framework management and report generation.