Repository navigation
Quickstart Go
github-actions[bot] edited this page Oct 14, 2026
·
3 revisions
Go services verify; they do not write logs. The module
github.com/0xAndersen/witness-log/clients/go is an independent
implementation of the verifier from the spec, standard library only,
checked against the conformance corpus and against the Rust CLI's verdicts
in CI.
go get github.com/0xAndersen/witness-log/clients/go@latestpackage main
import (
"fmt"
"log"
"os"
witnesslog "github.com/0xAndersen/witness-log/clients/go"
)
func main() {
dossier, err := os.ReadFile("dossier.json")
if err != nil { log.Fatal(err) }
dirJSON, err := os.ReadFile("trusted.json") // a directory you trust, not one the agent sent
if err != nil { log.Fatal(err) }
dir, err := witnesslog.ParseDirectory(dirJSON)
if err != nil { log.Fatal(err) }
verdict, report, err := witnesslog.VerifyDossier(dossier, dir, witnesslog.Options{
ExpectedIdentityPubkey: os.Getenv("EXPECTED_IDENTITY"), // obtained out-of-band
})
if err != nil { log.Fatal(err) }
code := report.ExitCode(false) // false: a sub-majority WITNESSED is 11, as the CLI returns
fmt.Println(verdict, "exit", code, "valid receipts", report.Quorum.ValidReceipts)
os.Exit(code)
}Treat anything but WITNESSED with exit 0 as "not proven": 11 is WITNESSED
by less than a majority of your directory, 30 DIVERGED (valid, but
contradicts a head or proof you passed in Options.KnownHeads /
Options.Evidence), 40 INVALID (a check failed). The meanings are the
same as the CLI's: Verification and verdicts.
a, _ := witnesslog.ParseDossier(aJSON)
b, _ := witnesslog.ParseDossier(bJSON)
res, err := witnesslog.Bind(a, b) // same matching as `witness-log bind`
fmt.Println(res.ExitCode()) // 0 BOUND, 30 MISMATCHerr := witnesslog.VerifyDisclosure(&dossier.Leaves[i], payload, salt) // SPEC §8go install github.com/0xAndersen/witness-log/clients/go/cmd/witness-log-verify@latest
witness-log-verify dossier.json --directory trusted.json --identity <hex>; echo $?Full API: clients/go/README.md.
Start
- Home
- Why witness-log
- Concepts
-
Comparison
- Tessera · Microsoft AGT · Signet · immudb · Agent Receipts · SCITT
Use it
- Quickstart: Python
- Quickstart: TypeScript
- Quickstart: Rust
- Quickstart: CLI
- CLI reference
- MCP integration
- Framework guides
- Quickstart: Go
- Browser verifier
- Other languages
Tutorials
Understand it
- Architecture
- Design decisions
- How a leaf becomes a proof
- Witness protocol walkthrough
- Redaction explained
- Keys and identity
Trust it
- Verification and verdicts
- Getting witnessed
- Operator onboarding
- Witness status
- Running a witness
- Compliance
- Threat model
- Spec and interop
- SCITT mapping
Run it
Project