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.6.tar.gz (1.7 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.6-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (2.7 MB view details)

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

dot_ring-0.1.6-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (2.7 MB view details)

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

dot_ring-0.1.6-cp313-cp313-macosx_11_0_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

dot_ring-0.1.6-cp313-cp313-macosx_11_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

dot_ring-0.1.6-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (2.6 MB view details)

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

dot_ring-0.1.6-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (2.6 MB view details)

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

dot_ring-0.1.6-cp312-cp312-macosx_11_0_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

dot_ring-0.1.6-cp312-cp312-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

dot_ring-0.1.6-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (2.4 MB view details)

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

dot_ring-0.1.6-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (2.4 MB view details)

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

dot_ring-0.1.6-cp311-cp311-macosx_11_0_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

dot_ring-0.1.6-cp311-cp311-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for dot_ring-0.1.6.tar.gz
Algorithm Hash digest
SHA256 3bd227044f584b52318a996e763e537d851af8ecd4c4d647d1ab061ed4e2a01b
MD5 3c1f0c353cf16214dc995a6b19b76e33
BLAKE2b-256 fb6246fbdf3f88b7236e2912fdddc00fb0b95057ad6e5ddce33476d2fe1275b0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.6-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ee8d443f535a52d2192dc18a22d4c2ca154c7dde63084e88441d9bc8578a1dcf
MD5 ee4d7b2aefb1d069eaa4b8c2d2d193cd
BLAKE2b-256 1b5d184d528bc2a10b1f8ab67eadd05d624c5b6c26471a73bcc9587e56e1a4e4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.6-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 507ab593ebee16fd144678d7f0f948029df7f63ccb05921310ea9ce8d9ad3a32
MD5 0a3a0db4155626b50b7eb9213c59f481
BLAKE2b-256 38389ea09bb32a589e74c7bfa4ee83bf167237243fe77eb68af04e7ea67ea05e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.6-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 cb20cd4292f539ebb80fcf1815808f91795c1bba10b1db22e0621fb182b41300
MD5 3c3503cf74294c857dbb8cd45e98da0f
BLAKE2b-256 3ff0c1951b635ec5b712d3727d4c08249df50a21281eb3b05e806b9783b25ddd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.6-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 04a9b406cb7f603deaf046e23224bf334066f98dede49658adbae9418c745fb0
MD5 4f5f704b886672361c7b632554686e3d
BLAKE2b-256 721e6dc98b8fdf5bf700f8293edcc2b4225e766cb8dc7b12f2b77625a44bff7c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.6-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 61176e2d13283b47a4436862260ac0bc765d3e6f8b7894b08606953401229500
MD5 c304a29632512ab9a0c3c498ceada20e
BLAKE2b-256 abf5bfe021ac6ba3d529b9130c514fd025564a5a493916dea8a5d619bf288a57

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.6-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 29898c1f145e06003f35f0c01d69906d9a7582c5bc574459fd23b5acc842c796
MD5 38d1c53324df5d0d5ca48850f800c0e3
BLAKE2b-256 b22dc8b0788a6fd7286414bebb94504bcd79a4774a1a0459c0377ad9ada759a7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.6-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 3988e54b5feb5cc9d7da7e17b198f44254abc6550e297edb1a46ef8ee4f40920
MD5 ac3c480ef5e06fbd1397875a0a877d33
BLAKE2b-256 e3f79f5775f528e80f9be88a51cfdd741cd3cae2487bd640bc4593c03bfa3237

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1440701ee5fa839e64736861153f519b3d52644c4e641412ca330b92c43af37c
MD5 e22d7c75eac99666ab01bd184a573e81
BLAKE2b-256 9a2132cd7ceb897fca1a9e067f09eec4df3176a7d7aa380bc23d5da06053f750

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.6-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 082d870096f9cee109bc5e026b6d37800ff73f061e4fe35b87be49f625cf70a0
MD5 2ecea8f5ba259ba1e1835e416155eead
BLAKE2b-256 88fb265eb6993d744860ba2d8ada7f4660dbf973849e2b681f2091a9d3f9e7a7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.6-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d319fa60cd40208feb8af170789c239a4affc8f0ed6e1bcab44767d31fb5d332
MD5 31e429183a0b9aa4c5f26c77bc17d6ae
BLAKE2b-256 6bd8cc268f84a94c2669d6e99b14ddf4d718d33d77ff3db9229057bc9076fc46

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.6-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 8075bb72266a08141ef541e024fa89f7bd4cbce0f2420d23bbaf3d81948a0bc8
MD5 9ea776d73a2da45f8945e4b986c7299d
BLAKE2b-256 0ebe0d6bf7658ef54764460b1d3f683fbb5c258ce8a5427bb36044f9ee9b1209

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dcf009c13d5cd762db2dc61e48bbda2653abafd4b3701428c783a319d7c1ac63
MD5 eab41364200e22ea8c317b59bb37f89c
BLAKE2b-256 c76ad4225d7d8b8a5b808b7755f218f96b5d8ae1e4599ea84afdd2a2e76066e3

See more details on using hashes here.

Provenance

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