{"id":19390345,"url":"https://github.com/nucypher/nubls","last_synced_at":"2025-04-24T00:31:13.682Z","repository":{"id":57646848,"uuid":"262414095","full_name":"nucypher/NuBLS","owner":"nucypher","description":"NuBLS is pure Rust implementation of BLS signatures with nifty threshold protocols","archived":false,"fork":false,"pushed_at":"2020-11-10T16:59:17.000Z","size":95,"stargazers_count":19,"open_issues_count":20,"forks_count":5,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-03-14T19:54:07.155Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nucypher.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-08T19:43:58.000Z","updated_at":"2024-02-04T09:46:07.000Z","dependencies_parsed_at":"2022-09-19T05:10:24.289Z","dependency_job_id":null,"html_url":"https://github.com/nucypher/NuBLS","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nucypher%2FNuBLS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nucypher%2FNuBLS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nucypher%2FNuBLS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nucypher%2FNuBLS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nucypher","download_url":"https://codeload.github.com/nucypher/NuBLS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250539363,"owners_count":21447294,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T10:20:25.491Z","updated_at":"2025-04-24T00:31:13.142Z","avatar_url":"https://github.com/nucypher.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NuBLS\n![Crates.io](https://img.shields.io/crates/l/nubls)\n![Discord](https://img.shields.io/discord/411401661714792449)\n\nNuBLS is NuCypher's BLS signature library that implements threshold protocols\nlike threshold signatures and a Proxy Re-Signature (PRS) algorithm designed\nby NuCypher called Penumbral.\n\nThe NuBLS library offers bindings to Python from a rust backend, see below for\ndetails.\n\n## Rust\n![Crates.io](https://img.shields.io/crates/v/nubls)\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/nucypher/nubls/rust)\n\nThe core of NuBLS is written in Rust, and is accessible here - https://github.com/nucypher/NuBLS/tree/master/rust-nubls\n\n## Python\n![PyPI](https://img.shields.io/pypi/v/pynubls)\n\nThe Python bindings are also written in Rust using the PyO3 library to ensure\nsafety. This crate is accessible here - https://github.com/nucypher/NuBLS/tree/master/nubls/src\n\n### Installation\nYou can install NuBLS from pip with: `pip install pynubls`. Alternatively, see\nthe build instructions below.\n\n### Building PyNuBLS\nTo build `pynubls` for Python, create a virtual environment and install maturin:\n`pip install maturin`\n\nThen build the package with:\n`maturin build`\n\nTo build and install the package into your virtual environment use:\n`maturin develop`\n\n### Usage\nThe API for the Python wrapper closely resembles that of the Rust API. After\ninstalling via pip or building the development version, you can call it in Python with:\n```python\nfrom pynubls import PrivateKey, PublicKey, hash_message, InvalidSignature\n\npriv_key = PrivateKey.random()\npub_key = priv_key.public_key()\n\npriv_key_bytes = priv_key.to_bytes()\npub_key_bytes = pub_key.to_bytes()\n\n# Splitting/Recovery\nkey_frags = priv_key.split(3, 5)\nrecovered_key = PrivateKey.recover(key_frags[:3])\n\n# Signing\nsig = priv_key.sign(hash_message(b'NuBLS!'))\ntry:\n    pub_key.verify(hash_message(b'NuBLS!'), sig)\nexcept InvalidSignature:\n    # Raises `InvalidSignature` when the signature is invalid.\n    print(\"The signature is invalid.\")\n\n# Penumbral Proxy Re-Signature\nalice_priv, bob_priv = PrivateKey.random(), PrivateKey.random()\n\nresigning_key_bob_to_alice = alice_priv.resigning_key(bob_priv.public_key())\nsig_under_bob = bob_priv.designated_key(alice_priv.public_key()).sign(hash_message(b'Penumbral!'))\n\nresigned_sig = resigning_key_bob_to_alice.resign(sig_under_bob)\nalice_priv.public_key().verify(hash_message(b'Penumbral!'), resigned_sig)\n```\n\n### Warning\nAs this library is a work-in-progress, there are some missing API details.\nOne of these is a rust-native hash-to-curve implementation. As such, it's not\npresently possible to hash messages natively with this library, and another\nlibrary must be used. To get around this, `pynubls` uses the `py-ecc` library\nfor hashing messages to the curve.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnucypher%2Fnubls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnucypher%2Fnubls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnucypher%2Fnubls/lists"}