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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

File metadata

  • Download URL: dot_ring-0.1.7.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.7.tar.gz
Algorithm Hash digest
SHA256 5faa9f255cdacc5ff13471344365d7aaa3abfc3854b8c8e764671a32a9423fe5
MD5 9f90a0a9efbce5c0801c3fb1650b3484
BLAKE2b-256 6ec9306f3f69222984a15ac38183d8cbd5de15f2a25b14230d0e2d22d5ccda58

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.7-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7c661c6d26177efe5024332b78d8081b751dc12326493ef5fe1371fbd3ff0d20
MD5 2b3767d2e6d46a25a14214897b2064bc
BLAKE2b-256 917d646bc7f031798d0eba037b32f68d35518272b4239cc48a84deeed25d3cba

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.7-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9ec68d953fd6a8284c373b35174393bbbaef1c2fbb80368862ddff5f6c33b233
MD5 33b141615a2b8817b642c8c2ca750012
BLAKE2b-256 e121fe4dd83ba74a56aa78248614f0d800db65e179c92097d1b4e252d234251a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.7-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 563b2b2b79932900c9ac8125d0088530c807643574d4d32b35c9d392f638aa02
MD5 f6977736792c516f181c93a3c2cfe874
BLAKE2b-256 3d59bfb1c3a1247c22e6cc8dabea7b19679d9739d9e538682a22845611212f9b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.7-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e96234bbfe75fc5362b15a46763d70fd4bcd2d6e09a92a3fa998346c644ee5f2
MD5 ce407d85b0c08fb6fd05f0f9eaa5c604
BLAKE2b-256 ff02a95db79b61e3c17a59df14010759228668eeefb69f3556ec0ad3ed1917c6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.7-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b0c6a4fdb803b6a68e239b68327162e048a444a5f21e43f529a26f7a24adfb8a
MD5 1ecafa87370430b9d4eea15ca7277ad9
BLAKE2b-256 f40ba5f8f93bfbbcfda5dd45eeab6b8ef64b3811f3dd69a082753a79d8feb2b2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.7-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 79043edf0e30e9524238021984e3f8877870ebfaa1e6516a45c0fe3228a59770
MD5 39e62f8f54160f85026bd3d03a12ffc1
BLAKE2b-256 1895c53a34bde9cd3a34b6fa2c3e7b63be6ac585386b76845cf8453691c6fbc2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.7-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 b7d30e1f3cf8524caaf37eae3344e5d1cd67dcf677259dc594a177ad004f0d47
MD5 b9c84e4e8b51489f205e0a8c3671c904
BLAKE2b-256 40ccedf0d349974e22468d20d10d083c093e60fe559f9ae91b6fbe4d162b31e1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.7-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 651462095284182a36a000455c416fbd09992abb6a3eec1441d2c502ec4ccbc7
MD5 0eebf00c02eccdfdb87b1eb74e14faad
BLAKE2b-256 5a9b9f1bea57eff78ec18ae8523d25bd1ca6c1ec1cee8b290ace082aeaa11d03

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.7-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 38355d5d8ebf773bb0cb5859b0f0853cb71b0ffa6515dce789f6ba87924617f1
MD5 4dfa9c262e59dc47b0e84f98ddeb1bc7
BLAKE2b-256 d2ec25cdc57d51eb3d40a6be36d821742f1322c69661e936372b96dffec1784a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.7-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 543c0979f1dc43ee3b2e2e77391b8eaca73d0d61a4cd57256738e1e774cbdf8d
MD5 123e292788160a76fe4396cb23c10be6
BLAKE2b-256 9a0765768b200662145fb7a7ffb9cf8541571d11934027e90537ff887b0a4967

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.7-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 d6653dd36363c91c5264cec564f0520c0bc04f2db5fbbd1b3f208207375620dc
MD5 135b9bfccb2bf7d9d19c3bab08c44bce
BLAKE2b-256 7f8b4e3d499e029bb64dfeee8959593d552f4e01cc207b49300febe96a497242

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for dot_ring-0.1.7-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e95af6e81d1a2a01ee8a42244ad10555d0d047a7fd91dbe5509283badc977727
MD5 eb382154ad12bfb4e62777534be5341d
BLAKE2b-256 26a961318349b0a1854fc63201f2f5127a9d7ad9cf103f75edd089fcf5e953a1

See more details on using hashes here.

Provenance

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