ProbablyFair Verifiability Layer (PF-VL-1.0) — Official SDK and integration libraries for implementing verifiable fairness, inclusion, and reproducibility in RNG-based systems.
pf-sdk provides the official Go implementation and developer toolkit for integrating the ProbablyFair Verifiability Layer (PF-VL-1.0).
It offers a consistent, language-agnostic interface for:
- Generating and verifying bet receipts and inclusion proofs
- Publishing and validating Merkle roots
- Deriving entropy and replaying outcomes deterministically
- Exposing the PF Operator API (REST) for external verifiers
- Generating SDK bindings for Node.js, Python, and WASM
| Component | Description |
|---|---|
cmd/ |
CLI tools (pfctl, pf-operator) for integration and testing |
pkg/ |
Core Go SDK packages (Merkle, RNG, GDP, Signatures) |
api/ |
Reference Operator API (OpenAPI-defined, PF-VL compliant) |
internal/ |
Common utilities and reproducible test harnesses |
go.mod |
Go module definition (v0.1.0) |
import (
"github.com/probablyfair/pf-sdk/pkg/entropy"
"github.com/probablyfair/pf-sdk/pkg/verify"
)
func main() {
e := entropy.Derive("server_seed_plain", "client_seed", 42, "beacon_mix_value")
ok, err := verify.Settlement("receipt.json", "settlement.json")
if err != nil {
panic(err)
}
println("Verified:", ok)
}| Method | Path | Description |
|---|---|---|
POST |
/pf/v1/bets |
Submit new bet and receive inclusion proof |
GET |
/pf/v1/roots/latest |
Retrieve latest Merkle root and signature |
GET |
/pf/v1/settlement/:bet_id |
Fetch settlement transcript |
POST |
/pf/v1/anchor |
Publish anchoring transaction metadata |
Full OpenAPI definition available at /api/openapi.yaml.
The SDK generator emits official bindings for multiple runtimes:
| Target | Location | Notes |
|---|---|---|
| Node.js | pf-bindings/node/ |
via GopherJS/WASM |
| Python | pf-bindings/py/ |
cgo bridge |
| Browser | pf-wasm/ |
TinyGo → WASM verifier |
Each binding passes the same deterministic test vectors defined in pf-specs/test-vectors.
Implements:
ProbablyFair Verifiability Layer — PF-VL-1.0-A
and conforms to the Operator SDK specification (PF-SDK-1.0 draft).
“Every bet: committed, included, reproduced.”
Licensed under the Apache License 2.0.
See LICENSE for details.