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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

dot_ring-0.1.11-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.11-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.11-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.11-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.11.tar.gz.

File metadata

  • Download URL: dot_ring-0.1.11.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.11.tar.gz
Algorithm Hash digest
SHA256 b5f0c2ab28e3cf81562484ee6cffe35b0ca8261fffac5d8546335e7d0510b2d5
MD5 cd8c74d4c6f1b12f32197ff39958733d
BLAKE2b-256 9137360aa092c22bc3cf594db48df5962243cb5ea5af78a43a27e3ed31145e83

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.11-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d89a758d0cabd312c4c1554d8e0dac300b7c9b0113ba4d18bf848996152f15cc
MD5 4f33666e788a2140fe53a470b8808c98
BLAKE2b-256 bb1dbbe1cf779cf0a47d514e0f539306cbb2a6731d9124e632f9f4309d96b844

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.11-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e16f3f027fefc485f8600c95675477d21fec9d9839ca55778d74f71533f34c56
MD5 4317c5ff02b56a204d778c84f8fa0ce1
BLAKE2b-256 d04539ecc800cb2dd027fe2ecebf40f31a2f91f745149639299f5f606c630b95

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.11-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 dea4841de404c9163c146bd47d6c4a197f9a1b7dab2343e5bf2bc3b304109871
MD5 af5a24ffe175fb1bff15263e2cbde267
BLAKE2b-256 dbede5eade03058fb64da0df0f5042b16753c92ca4919331c61fef9a8be4c5c3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.11-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 73ca4afa8ba30fcf08f4e3cb3c8973c235729333eeca06267c63d9eee00afa62
MD5 2dcb14e83f215e2f6779b67cd771380e
BLAKE2b-256 b544f7514baf1c406f721a05625a8abec23e9dc99ae60bc953c8cf01f796205f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.11-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cb20ad37c97d937ef05b05695ded6f5b6e845cff817273838d5fd3cf0f8481a3
MD5 b153c2cb9fdc35b62410d7c61c46bc9f
BLAKE2b-256 3cdf4b568e292eda9b789c5c35b9ae2e6095f96f3dce66e5ad89a50fd83c6601

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.11-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 463a3a0f764578e106670557f4f0f35badd37574ce0ed7ae02567040161107af
MD5 fa68f0988597b46bb5ac7687084c0c8c
BLAKE2b-256 af5b9aad8e590e0f23313129b34db6036cd5df2f94991dc4577700028ba85fc7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.11-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 f19c1534e609ccc1c3a766783408603c8582bbba0235205a08bc803561a06bdc
MD5 37bf163c976063fee15abff10fdc4f07
BLAKE2b-256 a3c3afda47ca7923eb18ebce967491ec38f66b0d5615110b557615bec0af3b34

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.11-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8ca8f57c96b27c33e8d83f25b21b55d21f1e325b7a6110ba7cfc556f5ff5b21f
MD5 9bb54427a445bba9c87284bf7d8ed0c6
BLAKE2b-256 0a608802c0fb4a3a418d55cd8de67927c5f25405aa13b3c3ef926524279235ec

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.11-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6fb1ec38caca2b8d1d7c756933c6256359c44acb1132f458017768326d41ca54
MD5 56779509af93e0419dc5e3eb28bfa731
BLAKE2b-256 480bb0e6b27d5489064645fa31d8f663e28bdda485c8c45df73f9c027c4b828a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.11-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 aadc76c989ace6ef72a9b099c8561382ffd4a15b8761181ca2dd793dd3bf2c8f
MD5 3804998aa20276345990893c89a5446b
BLAKE2b-256 e916898d2517798c2eb777c351fd87bf1ddd82b90837b12230a730e4b1a04805

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.11-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 a6b25e5231fcdc0babc11612d25c6f52d8e89fd2229eecde27c0a6b21eda0ac9
MD5 4f68e7d8193e9085fede8b41da684325
BLAKE2b-256 483f9e2d854bf8e8201472e18a31176cf759cb3051c4c1de44785d122c7b5874

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.11-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6612cc7f596ee7d4bad881b24d011e9eebc778dab3cbb80c5c32f8715f0c6dd9
MD5 9b8bb269636c8c4e18afbc39bc0894cd
BLAKE2b-256 e33e5a24f9356430f57e81a99ef0f5327b911110c532ef69d97b67f714f1de2b

See more details on using hashes here.

Provenance

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