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.9.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.9-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.9-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.9-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.9-cp313-cp313-macosx_11_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

dot_ring-0.1.9-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.9-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.9-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.9-cp312-cp312-macosx_11_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

dot_ring-0.1.9-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.9-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.9-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.9-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.9.tar.gz.

File metadata

  • Download URL: dot_ring-0.1.9.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.9.tar.gz
Algorithm Hash digest
SHA256 51529a6bf990ca93484a1d635c7d6efbae0600e1e349a2ef227c7bf8d71a80cb
MD5 2fcf462d241b4dbeea030f0dffad36b7
BLAKE2b-256 705d1a9f6be5b6c79606d4baee566e030b91d12893624208326a3d108834fb3a

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.9.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.9-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dot_ring-0.1.9-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9ad04294288ccd0226c0c136a5056b8b726de73373aa3bf0497ccaeff2228b1c
MD5 6dce3f38090d0d2415ce691f03eadb6b
BLAKE2b-256 8b8c135793158de92e14e2eda3cc32c97999148e588e45ca388b24f3f7525dc1

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.9-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.9-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for dot_ring-0.1.9-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 034d75f8b35c968a54ce196d544a2460ce2fd7d5b9da2e1edcc070678927c370
MD5 2ed62bdce0be576e0c80251750d7eaa8
BLAKE2b-256 46deac515d7a26d06f51a4064d940d9fe7ab240c4be5c2ed28121c7b58460203

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.9-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.9-cp313-cp313-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for dot_ring-0.1.9-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 e6da5538dc541b733e0844bab9114943d4cc674e66857967601f8494cd93a7fa
MD5 0efec576b62cc759540b6f127a018f44
BLAKE2b-256 ab8b0642a124c9b90eec713e60b8588ce081e9b31f8b67b2ee9d93c894ed0c35

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.9-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.9-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dot_ring-0.1.9-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 694ffbf06aef49757f4b5115d2b81d8ae98401029ee818b42a861b901159ad6a
MD5 e0e04d53060e7bfc1ee7e643fdf742dc
BLAKE2b-256 a1709c76792c2e29bdd45264655a8dcfc64a99e6b3a07e0ab731f0be44df3674

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.9-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.9-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dot_ring-0.1.9-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 98c72e937a16912d0075cb388c54ebd644aa93c3637ef75cda46272b4d4157d6
MD5 80cc94d2db61d3bf5e3b011b86c62616
BLAKE2b-256 99af517a800c7e2e17542616414d49dd53bfa3cb2276956adf45ea0ebe65497d

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.9-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.9-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for dot_ring-0.1.9-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 13dedc2c48d73d046b843e48764170c6847ad8d4283ee6239060196508b5b8ef
MD5 2b9da05fe38c039c87c092e2b2efcf69
BLAKE2b-256 3426fddab21023dd690639a6d708e5ff97d3666acf654a7b44d10215abbf3e0c

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.9-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.9-cp312-cp312-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for dot_ring-0.1.9-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 1f4c51eb4a6097802239f1b6d422202401ead604827901e03f750c8e20d9c5cf
MD5 23521c586b256446d7eb9d64458c94f2
BLAKE2b-256 f2d97455732ec14a4b2ef6547c74863cfd831e8713f385e972c299943df11b7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.9-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.9-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dot_ring-0.1.9-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d6b3931d4178a46dce21a152d70888d7c8de4daaea3b0d06d5a232fd050a75c8
MD5 a16b4d4f90926cb01183e7577904eff3
BLAKE2b-256 68bea97f3c4d84ed40abda098dde027da5b6ea6a99cde5dcdf5af96e39b7e7c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.9-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.9-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dot_ring-0.1.9-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 dac0d3562e4cfe76dc4ef7ec720435090cbb3f700f1abf88716e65f03ffbe6c3
MD5 7e9b239b6828094e6a608f6c30eae8e9
BLAKE2b-256 b522f51faa7525f227e0bfd68bb26cf15ccde61d0f3effd9e9e375d7011459eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.9-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.9-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for dot_ring-0.1.9-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a067ca9eaab3971f523c8e7ce1a2f01f074ed3a98a9583ae3bb0b38559acb04c
MD5 20620fb4e84780e3272a8466a6ac747e
BLAKE2b-256 c6a9416308ea67b016d3d5b142288bf08ab8ca1126bd95f2929aba0b73f90531

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.9-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.9-cp311-cp311-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for dot_ring-0.1.9-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 fa208b3b1a0ef478432e4dae2fbbe01ab9830995689316687d1ba13163c0cc65
MD5 ac94379bb3cd2c7b6abe567153a099cb
BLAKE2b-256 fea7f6a2b69fb95b2dabd9eecc89434ffde2ed567476ce91c1f8bb2337fad870

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.9-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.9-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dot_ring-0.1.9-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7406a4640e5989a54913fd6b116007d30022f5cad81d8dc6f1a6ca57ff9f2fb0
MD5 5fa133c6cfcb6d245e7542664f506f06
BLAKE2b-256 bf8e4f6dcb06b592f7809dcbb183bd04a4e0f31e52298f7f53b2980669a239c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for dot_ring-0.1.9-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