Skip to main content

Serves as a library to generate and verify a signature using IETF, Pedersen and Ring VRF-AD Schemes

Project description

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 VRFRing ProofRFC9381RFC9380


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 (matching ark-vrf):

from dot_ring import Bandersnatch, secret_from_seed

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

IETF VRF

from dot_ring import Bandersnatch, IETF_VRF

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

# Verify
public_key = IETF_VRF[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)

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, RingVRF

# Setup ring
ring_pks = [pk1, pk2, pk3, ...]  # list of public keys
ring_root = RingVRF[Bandersnatch].construct_ring_root(ring_pks)

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

# Verify (proves membership without revealing which key)
is_valid = proof.verify(alpha, ad, 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

Contact

Prasad // Chainscore Labs

alt text

EmailWebsite

Benchmarks

See the docs/BENCHMARK.md for performance results.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dot_ring-0.1.10.tar.gz (1.8 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dot_ring-0.1.10-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

dot_ring-0.1.10-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (2.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

dot_ring-0.1.10-cp313-cp313-macosx_11_0_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

dot_ring-0.1.10-cp313-cp313-macosx_11_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

dot_ring-0.1.10-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

dot_ring-0.1.10-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (2.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

dot_ring-0.1.10-cp312-cp312-macosx_11_0_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

dot_ring-0.1.10-cp312-cp312-macosx_11_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

dot_ring-0.1.10-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

dot_ring-0.1.10-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

dot_ring-0.1.10-cp311-cp311-macosx_11_0_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

dot_ring-0.1.10-cp311-cp311-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file dot_ring-0.1.10.tar.gz.

File metadata

  • Download URL: dot_ring-0.1.10.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dot_ring-0.1.10.tar.gz
Algorithm Hash digest
SHA256 ce61e372500e74541f66248dea150694fc1aea799b6f2c5f2fce3c791befaf5a
MD5 ebe5a9e5a4c8d8fddb0c74f82ea48687
BLAKE2b-256 7ecbad5faf274cad739dd2d414eec11fdb2fbaab8aa93ee9c760009ad9ce0f7d

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.10.tar.gz:

Publisher: release.yml on Chainscore/dot-ring

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dot_ring-0.1.10-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dot_ring-0.1.10-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 52036ea3624f836f1b134141d82348c84f789c3d4d359731f23a21cfac909e07
MD5 f8d61a66bb0915daf4f1896e0b555a07
BLAKE2b-256 081b654804cf9c8417aad1849fe24f0e74e9d8838930cd905c9b84c430b4a064

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.10-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on Chainscore/dot-ring

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dot_ring-0.1.10-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for dot_ring-0.1.10-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 685c33baf57df7c5e81fcc58b80acdc35863d12c6e417d3b349d7393201477e1
MD5 bce28b301bbe068457353f0ac48ccf23
BLAKE2b-256 d066703da814f8c3ceaef5aa0cc3f2d09c4831f936a266b82b7901045b2cd309

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.10-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl:

Publisher: release.yml on Chainscore/dot-ring

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dot_ring-0.1.10-cp313-cp313-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for dot_ring-0.1.10-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 dca5f37efd5353d92008a036a9f33dcf3c8ddea360b14afdd42717a644c09123
MD5 caed41914421a195877d706733651b36
BLAKE2b-256 a84546aa6507bd72d482c5ae70e320dc4646ae4abd23a3ff2329b6de0f612608

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.10-cp313-cp313-macosx_11_0_x86_64.whl:

Publisher: release.yml on Chainscore/dot-ring

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dot_ring-0.1.10-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dot_ring-0.1.10-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 822d1629436e1d3b7cecf43ee1bd7f5ac269309c338e226a90f5cc693249fbaf
MD5 29d84d4991e160c48b9483cda559624c
BLAKE2b-256 1c988632f395234ea29c06bff786d9e19e539b42e8cf27c3dde58b5f8b1b51b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.10-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on Chainscore/dot-ring

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dot_ring-0.1.10-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dot_ring-0.1.10-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1baff05ca2a88d0de9c153356540a345f69d66b2bcc0d1917b04c17ed5fc931b
MD5 5c6790e15e6ea81df5e24e5b677ecc56
BLAKE2b-256 d4e0fb288f069715d6a825a4fb023f7acd98e20adee6581d95fcf9158d2d8462

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.10-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on Chainscore/dot-ring

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dot_ring-0.1.10-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for dot_ring-0.1.10-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 54989dc2b98b43a6235a46d478dde986a2ac56bd0a595ef8c2bf43390013dbb4
MD5 28260b801e9cdf25c00f77d68a12c8b7
BLAKE2b-256 fb5fcaa98a99e2f0871148484387938556381139d3d9d2763f0c6d2b4245fed7

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.10-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl:

Publisher: release.yml on Chainscore/dot-ring

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dot_ring-0.1.10-cp312-cp312-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for dot_ring-0.1.10-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 ff5e3da7fd577af65b3e4d97879bd2b1c07b0beea0b530ad4ddf6db6fdbe540d
MD5 4d7cf5c0436fc2ebd631c2c210964c9a
BLAKE2b-256 decef867be1e7b52397e2de422276bc49a22dc2f255429b41eca9395a7805893

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.10-cp312-cp312-macosx_11_0_x86_64.whl:

Publisher: release.yml on Chainscore/dot-ring

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dot_ring-0.1.10-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dot_ring-0.1.10-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e9b049e30b5dad63087805d715ea79a382dd0cb173e176f5a0d2eeaa419f9a9b
MD5 28b0844c310ea0d11e6b8fc031a54b2e
BLAKE2b-256 d60ca9a438456d0246dbf9edc925a612985831146d770938807f53039c6ee24d

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.10-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on Chainscore/dot-ring

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dot_ring-0.1.10-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dot_ring-0.1.10-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 71a10944492ee4241b4740340d0ca03885e4e1122abaeb5f68300b2d85ac7a97
MD5 1790c55f12ac726c401f0892c8ee56bb
BLAKE2b-256 89b260a3ceb25c06169ae62463ffac040ab9f5827b8c57ab6bf0f35038e700cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.10-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on Chainscore/dot-ring

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dot_ring-0.1.10-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for dot_ring-0.1.10-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 652ad954b419751aaa193884fd4a6d5f3192a85a9cfc0c919731501d5e70cbf2
MD5 cc3cad61ba1ec66a0ffe895bc3b73fea
BLAKE2b-256 868b57ccc075b871df488f5fdc98edf289784940793aa491be09449285ff8e9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.10-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl:

Publisher: release.yml on Chainscore/dot-ring

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dot_ring-0.1.10-cp311-cp311-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for dot_ring-0.1.10-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 399874e245f11583b6eb39e6c6ff31eb80eafc74d038fbb7ec036222af8a5751
MD5 87f1847bf05fd9abc2a252c2999ee793
BLAKE2b-256 06d4fa5b8f3a584d5e2e863a602a84371c82b3fca7206ef68414cc40b12c45b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.10-cp311-cp311-macosx_11_0_x86_64.whl:

Publisher: release.yml on Chainscore/dot-ring

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dot_ring-0.1.10-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dot_ring-0.1.10-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b07890f03a99317626d17e4c4c5568cdaca8949c27918d494980eec8cc77c299
MD5 e260dfe865506fb6d3a369b66bfbcc12
BLAKE2b-256 3b789688733c0648cc6535bf54a5f5c8a96886359fbf830320c68f814d1b8f78

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.10-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on Chainscore/dot-ring

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page