GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Chainscore/dot-ring: Zero Knowledge (ZK) toolkit for generating and verifying IETF VRF, Pedersen VRF and Ring Proofs

BranchesTags
Open more actions menu

Latest commit

 

History

439 Commits
439 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
docs
docs
 
 
dot_ring
dot_ring
 
 
scripts
scripts
 
 
tests
tests
 
 
.DS_Store
.DS_Store
 
 
.dockerignore
.dockerignore
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
MANIFEST.in
MANIFEST.in
 
 
README.md
README.md
 
 
codecov.yml
codecov.yml
 
 
pyproject.toml
pyproject.toml
 
 
setup.py
setup.py
 
 
tox.ini
tox.ini
 
 
uv.lock
uv.lock
 
 

Repository files navigation

alt text

Tests codecov Python 3.12+ License

dot-ring is a Python library for Verifiable Random Functions with Additional Data (VRF-AD) supporting 10+ elliptic curves, including IETF VRF, Pedersen VRF, and Ring VRF.

Specifications: Bandersnatch VRF • Ring Proof • RFC9381 • RFC9380


Installation

Install from PyPI (Recommended)

Pre-built wheels are available for Linux and macOS - no build tools required:

pip install dot-ring

Development Setup

For building from source, you need system dependencies:

OS Command
macOS brew install swig
Ubuntu/Debian sudo apt install swig build-essential
Fedora/RHEL sudo dnf install swig gcc-c++
Arch sudo pacman -S swig base-devel

Then install in development mode:

git clone https://github.com/chainscore/dot-ring.git
cd dot-ring
pip install -e .[dev]

Usage

secret_key = bytes.fromhex("3d6406500d4009fdf2604546093665911e753f2213570a29521fd88bc30ede18")
alpha = b"input data"
ad = b"additional data"

Deterministic key generation from a seed:

from dot_ring import Bandersnatch

seed = (0).to_bytes(32, "little")
public_key, secret_key = Bandersnatch.secret_from_seed(seed)

Tiny VRF / IETF

from dot_ring import Bandersnatch, TinyVRF

# Generate proof
proof = TinyVRF[Bandersnatch].prove(alpha, secret_key, ad)

# Verify
public_key = Bandersnatch.public_key_from_secret(secret_key)
is_valid = proof.verify(public_key, alpha, ad)

# Serialize
proof_bytes = proof.encode()
proof = TinyVRF[Bandersnatch].decode(proof_bytes)

Pedersen VRF

from dot_ring import Bandersnatch, PedersenVRF

# Generate proof (public key is blinded in proof)
proof = PedersenVRF[Bandersnatch].prove(alpha, secret_key, ad)

# Verify
is_valid = proof.verify(alpha, ad)

Ring VRF

from dot_ring import Bandersnatch, Ring, RingRoot, RingVRF
from dot_ring.ring_proof.params import RingProofParams

# Setup ring
my_pk = Bandersnatch.public_key_from_secret(secret_key)
other_pks = [
    Bandersnatch.public_key_from_secret(i.to_bytes(32, "little"))
    for i in range(1, 4)
]
ring_pks = [my_pk, *other_pks]

params = RingProofParams.from_ring_size(len(ring_pks), cv=Bandersnatch)
ring = Ring(ring_pks, params)
ring_root = RingRoot.from_ring(ring, params)

# Generate proof
proof = RingVRF[Bandersnatch].prove(alpha, ad, secret_key, my_pk, ring, ring_root)

# Verify (proves membership without revealing which key)
is_valid = proof.verify(alpha, ad, ring, ring_root)

Testing

pytest tests/

See TESTING.md for details.


Docker

docker build -t dot-ring .
docker run -it dot-ring pytest tests/

Troubleshooting

Error Solution
swig: command not found Only needed for building from source. Install: brew install swig / apt install swig
gcc failed Only needed for building from source. Install: xcode-select --install / apt install build-essential
Import errors Try: pip install dot-ring --force-reinstall --no-cache-dir

Benchmarks

See the benchmarks here for performance results.


Contact

Chainscore Labs is a full-stack engineering and research studio with a proven track record of delivering secure, high-performance systems for leading blockchain ecosystems like Polkadot and Telos. Founded in 2021, our team of engineers with expertise in blockchain infrastructure and modern apps has successfully shipped 20+ projects, demonstrating our ability to execute complex projects from protocol-level engineering to production-grade dApps.

Chainscore Labs Cover

Website
Email

About

Zero Knowledge (ZK) toolkit for generating and verifying IETF VRF, Pedersen VRF and Ring Proofs

dotring.chainscore.finance/

Topics

anonymityblindingietfpedersenpedersen-commitmentpedersen-hashpolkadotpythonrandom-number-generatorring-proofring-signaturering-vrfverifiablevrfw3f

Resources

Readme
MIT license
Activity
Custom properties

Stars

4 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.