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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

dot_ring-0.1.8-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.8-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.8-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.8-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.8.tar.gz.

File metadata

  • Download URL: dot_ring-0.1.8.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.8.tar.gz
Algorithm Hash digest
SHA256 ce48f26b4a94effd4af37de922466efed2d88e0170cdcafea68d9200169a7eca
MD5 28c335158c51a7a2d36c9e9ba37914a3
BLAKE2b-256 ad1c3f48c2e28194e076a612b62119114dead3af347d7714d57622745990a0bb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.8-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 71597ae6abf0d6bcf32ae51fb314011ceba75cfce12a2e8e6b3406492bc1c545
MD5 f0b3a7212c6315283facfb159e42f4fa
BLAKE2b-256 863e4e903554a0d073a69cccbcc120f8736cc66e2c86667d97c506642f694f0e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.8-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 12878337af306c0bbdcc44eb5656ef5973020bdd06a82adfb165b98d24cba948
MD5 959b5d6a500e485230b533c50cee514f
BLAKE2b-256 8d397e9091c5945704af3f5a56cb75661e426d3b883c7ed7437be676908e37d3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.8-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 7be71922aa3b4c9016ceb389ea7691094d9f3db6d602a2faceb2d64da5635371
MD5 52bff61f2c7b211fb53f94db4bb5ede5
BLAKE2b-256 a9deb0ffa581846b4a7fcad110c4140f9bc0782655b06590b8b53cefc004cbee

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.8-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 604d4f269b10d54aa2b0ae19ae65446d9ecf0e35ca1298d556b148ecad53b6cb
MD5 59d54aa28c7badbfd496ba62e38e4a2e
BLAKE2b-256 27840d030470707cbfc86711001922719102eaf6de69e6918e5c44d6e38dac73

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.8-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cdbe919f0ef9b988e73e9256154c4c0059e68e5974ad9a4d97602f7512083e62
MD5 a95a31137e8dcfe1ad587698506d4d9e
BLAKE2b-256 69b981ab7f77bceefe28c1ba23874c467888a395a0769eacda48b8311c731a40

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.8-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8decc8424d3ae5793da851c7b835e2c33f793af3bc54f9bf7b62eb48bc9f7eaa
MD5 3b7057bf5bb9d6418c63645cda297598
BLAKE2b-256 117b9629cec6a13955790598a88b44b28514f557da78a6b0e356866433cb158f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.8-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 9be32194589763c9980f4f430b7f30a36af6075ee9557f0c3c5a73e9f9b4dc82
MD5 f54fb955681171aa417ab4bf57d25617
BLAKE2b-256 8f74c842267077eb45377737c7dbf975d92b7ee3faed3f724a13d9f3fe56dc5b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.8-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 69931b15c4ac14701ff1f81b3503c14603da03f98e5026420de9d50105da53cb
MD5 1511a48eec4e4d82d5312d801c72fdf9
BLAKE2b-256 468fe9e8d7467f79889e32778e78bb52203abfa4f6d62b3682b8221ce0529220

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.8-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fc175f5643174936b44304d9e2a31d01dbddf8d7bd965d5bb651f0a31a1850db
MD5 66ac37e74f68303e9cd6a64783f14537
BLAKE2b-256 631668ba94843ad6aaa32fbbfe00fe4aaa75faebaa386a1c915e2b9e2b1b3054

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.8-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9f1d8d7eb6cc25a9181ce9c736908e2985bb95536f208d0c131050ac82037b06
MD5 7807fe7d78bd231565e2bae839678a67
BLAKE2b-256 893ac11fd9da860bf2f2869d3e21787558dc663fc99f7e11f345a387e414e0a3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.8-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 2617033fb74a3bd35ec13def56920fc5c880511e0bed379d3bbde03ecb6e7cc5
MD5 49523fd791353fa768db1f157839d38b
BLAKE2b-256 235b717bd74e62ceed72381b1602ef4b266c046352bc4ab964fddd234816128e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.8-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 793c834cad6092fb36e05707714cf6000f1d1c965e6ed583c728f5d9ee34fbe3
MD5 69163c6cbee67cb03c4dbc9232de2ec5
BLAKE2b-256 75f354ea7b13ffbd5007dc54b59b13e04de59ca4780b3c1ac27a455313165206

See more details on using hashes here.

Provenance

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