Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Official SDK and integration libraries to implement the ProbablyFair Verifiability Layer (PF-VL-1.0), for verifiable fairness, inclusion, and reproducibility in RNG-based systems.

License

Notifications You must be signed in to change notification settings

ProbablyFair/pf-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ProbablyFair Verifiability Layer

ProbablyFair SDK (pf-sdk)

ProbablyFair Verifiability Layer (PF-VL-1.0) — Official SDK and integration libraries for implementing verifiable fairness, inclusion, and reproducibility in RNG-based systems.

License
Spec
Build
Go Reference


Overview

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

Architecture

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)

Example (Go)

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)
}

Operator API Endpoints

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.


Language Bindings

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.


Conformance

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.”


License

Licensed under the Apache License 2.0.
See LICENSE for details.


Resources

About

Official SDK and integration libraries to implement the ProbablyFair Verifiability Layer (PF-VL-1.0), for verifiable fairness, inclusion, and reproducibility in RNG-based systems.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages