
Wickra Proof — Go
The deterministic Proof-of-Backtest core for Go, over the Wickra C ABI hub via cgo.
Wickra Proof folds a (spec, data) pair into a deterministic wickra-backtest report and a canonical blake3 hash that anyone recomputes byte-for-byte in ten languages. This package is the Go binding: it consumes the C ABI hub through cgo and exposes the stateless Prover handle with the same JSON protocol as every other binding.
Install
Use the published wickra-proof-go module, which bundles the prebuilt C ABI
library for every platform, so go get + go build works with no extra steps (a
C compiler is still required, as the binding uses cgo):
go get github.com/wickra-lib/wickra-proof-go
Quick start
package main
import (
"fmt"
wickra "github.com/wickra-lib/wickra-proof-go"
)
func main() {
p := wickra.New()
defer p.Close()
cmd := `{"cmd":"prove","spec":{"strategy":{...},"dataset_ref":"BTCUSDT/1h"},` +
`"data":{"BTCUSDT":[{"time":1,"open":100,"high":101,"low":99,"close":100,"volume":1000}]}}`
proof, err := p.Command(cmd)
if err != nil {
panic(err)
}
fmt.Println(proof) // {"engine_version":"…","inputs_hash":"…","report":…,"report_hash":"…"}
fmt.Println(wickra.Version())
}
Commands
| Command |
Payload |
Response |
prove |
{spec, data} |
{report, inputs_hash, report_hash, engine_version} |
verify |
{proof, spec, data} |
{ok: true, valid: bool} |
canonicalize |
{value} |
{ok: true, canonical} |
version |
— |
{engine_version} |
Errors are reported in-band as {"ok":false,"error":"…"}.
wickra-proof-go is generated from this directory by the release pipeline: it
mirrors the Go sources, the vendored C ABI header (include/wickra_proof.h) and
the prebuilt libraries under lib/<goos>_<goarch>/. On Windows the DLL must be
discoverable at run time (next to the executable or on PATH).
Building from this repository (contributors)
This bindings/go directory is the development source. To build it directly,
compile the C ABI hub and stage the library into the per-platform directory cgo
links against:
cargo build -p wickra-proof-c --release
mkdir -p bindings/go/lib/linux_amd64 # match your GOOS_GOARCH
cp target/release/libwickra_proof.so bindings/go/lib/linux_amd64/ # Linux
cp target/release/libwickra_proof.dylib bindings/go/lib/darwin_arm64/ # macOS (arm64)
cp target/release/wickra_proof.dll bindings/go/lib/windows_amd64/ # Windows
Then, with the library on the loader path, run go test ./... from this directory.
License
Dual-licensed under MIT
or Apache-2.0, at your option.