Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
--cov=dot_ring \
--cov-report=term-missing \
--cov-report=xml \
--cov-fail-under=80 \
-v \
--tb=short

Expand Down
28 changes: 16 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ alpha = b"input data"
ad = b"additional data"
```

Deterministic key generation from a seed (matching ark-vrf):
Deterministic key generation from a seed:

```python
from dot_ring import Bandersnatch, secret_from_seed
Expand All @@ -63,21 +63,21 @@ seed = (0).to_bytes(32, "little")
public_key, secret_scalar = secret_from_seed(seed, Bandersnatch)
```

### IETF VRF
### Tiny VRF / IETF

```python
from dot_ring import Bandersnatch, IETF_VRF
from dot_ring import Bandersnatch, TinyVRF

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

# Verify
public_key = IETF_VRF[Bandersnatch].get_public_key(secret_key)
public_key = TinyVRF[Bandersnatch].get_public_key(secret_key)
is_valid = proof.verify(public_key, alpha, ad)

# Serialize
proof_bytes = proof.to_bytes()
proof = IETF_VRF[Bandersnatch].from_bytes(proof_bytes)
proof = TinyVRF[Bandersnatch].from_bytes(proof_bytes)
```

### Pedersen VRF
Expand Down Expand Up @@ -140,14 +140,18 @@ docker run -it dot-ring pytest tests/

---

## Contact
## Benchmarks

**Prasad // Chainscore Labs**
See the benchmarks [here](docs/BENCHMARK.md) for performance results.

![alt text](https://raw.githubusercontent.com/Chainscore/dot-ring/refs/heads/main/docs/chainscore.png)
---

[Email](mailto:prasad@chainscore.finance) • [Website](https://chainscore.finance)
## 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](https://raw.githubusercontent.com/Chainscore/dot-ring/refs/heads/main/docs/chainscore.svg)

## Benchmarks

See the `docs/BENCHMARK.md` for performance results.
[Website](https://chainscorelabs.com) <br/>
[Email](mailto:prasad@chainscorelabs.com)
11 changes: 11 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
coverage:
status:
project:
default:
target: "80%"
threshold: "1%"
patch:
default:
target: "80%"
threshold: "5%"
informational: true
63 changes: 41 additions & 22 deletions docs/BENCHMARK.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,34 @@ Benchmark results for `dot-ring` VRF implementations on Bandersnatch curve.

- **Runtime**: Python 3.13
- **Device**: MacBook Pro, M1 Max - ARM, 64 GB RAM
- **Vectors**: `tests/vectors/ark-vrf/bandersnatch_ed_sha512_ell2_*.json`
- **Suite**: `Bandersnatch-SHA512-ELL2-v1`
- **Vectors**: `tests/vectors/ark-vrf/bandersnatch_*_*.json`
- **Baseline**: ark-vrf `benches/SUMMARY.md`, quick mode, AMD Ryzen Threadripper 3970X
- **Local run**: 2026-05-25

---

## IETF VRF
## IETF / Tiny VRF

Standard IETF-compliant VRF (RFC 9381).
IETF VRF-AD proof.

| Operation | Min | Mean | Stddev |
|-----------|-----|------|--------|
| Proof Generation | 1.67 ms | 1.78 ms | 0.09 ms |
| Verification | 1.58 ms | 1.66 ms | 0.06 ms |
| Operation | Min | Mean | Stddev | ark-vrf | x |
|-----------|-----|------|--------|---------|---|
| Proof Generation | 2.21 ms | 2.65 ms | 0.85 ms | 185.4 us | 14.3x |
| Verification | 1.97 ms | 2.28 ms | 0.59 ms | 194.5 us | 11.7x |

**Proof size**: 80 bytes

---

## Thin VRF

Thin VRF with `(R, s)` proofs.

| Operation | Min | Mean | Stddev | ark-vrf | x |
|-----------|-----|------|--------|---------|---|
| Proof Generation | 2.21 ms | 2.55 ms | 0.56 ms | 184.8 us | 13.8x |
| Verification | 1.99 ms | 2.15 ms | 0.20 ms | 192.4 us | 11.2x |

**Proof size**: 96 bytes

Expand All @@ -25,10 +41,10 @@ Standard IETF-compliant VRF (RFC 9381).

VRF with Pedersen commitment for public key blinding.

| Operation | Min | Mean | Stddev |
|-----------|-----|------|--------|
| Proof Generation | 2.30 ms | 2.38 ms | 0.07 ms |
| Verification | 1.88 ms | 1.97 ms | 0.06 ms |
| Operation | Min | Mean | Stddev | ark-vrf | x |
|-----------|-----|------|--------|---------|---|
| Proof Generation | 2.40 ms | 2.64 ms | 0.68 ms | 374.6 us | 7.1x |
| Verification | 1.74 ms | 1.83 ms | 0.07 ms | 215.4 us | 8.5x |

**Proof size**: 192 bytes

Expand All @@ -37,33 +53,36 @@ VRF with Pedersen commitment for public key blinding.
## Ring VRF

Ring VRF with SNARK-based ring membership proof.

**Proof size**: 784 bytes (constant across all ring sizes)

### 8-member ring (domain size: 512)

| Operation | Min | Mean | Stddev |
|-----------|-----|------|--------|
| Ring Root Construction | 28.07 ms | 28.28 ms | 0.14 ms |
| Proof Generation | 153.35 ms | 155.18 ms | 1.42 ms |
| Verification | 4.05 ms | 4.35 ms | 0.19 ms |
| Ring Root Construction | 27.03 ms | 27.80 ms | 0.75 ms |
| Proof Generation | 152.31 ms | 154.03 ms | 1.29 ms |
| Verification | 3.70 ms | 3.95 ms | 0.19 ms |

### 1023-member ring (domain size: 2048)

| Operation | Min | Mean | Stddev |
|-----------|-----|------|--------|
| Ring Root Construction | 330.76 ms | 334.71 ms | 5.07 ms |
| Proof Generation | 525.28 ms | 543.04 ms | 29.13 ms |
| Verification | 4.09 ms | 4.22 ms | 0.14 ms |

| Operation | Min | Mean | Stddev | ark-vrf | x |
|-----------|-----|------|--------|---------|---|
| Ring Root Construction | 327.11 ms | 334.16 ms | 9.18 ms | 138.5 ms | 2.4x |
| Proof Generation | 527.04 ms | 534.57 ms | 12.48 ms | 482.2 ms | 1.1x |
| Verification | 3.81 ms | 3.99 ms | 0.24 ms | 3.37 ms | 1.2x |

---

## Running Benchmarks

```bash
# IETF VRF
# IETF / Tiny VRF
uv run python tests/benchmark/bench_ietf.py

# Thin VRF
uv run python scripts/benchmark_rust_baseline.py --output /tmp/dot-ring-benchmark.md --ring-batch-max 0

# Pedersen VRF
uv run python tests/benchmark/bench_pedersen.py

Expand All @@ -72,4 +91,4 @@ uv run python tests/benchmark/bench_ring_proof.py

# Ring VRF (1023-member ring, domain size 2048)
uv run python tests/benchmark/bench_ring_large.py
```
```
Binary file removed docs/chainscore.png
Binary file not shown.
23 changes: 23 additions & 0 deletions docs/chainscore.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading