From e10f74a9be441c3cb855064026805701b888c752 Mon Sep 17 00:00:00 2001 From: "Ya-wen, Jeng" Date: Mon, 6 Oct 2025 10:45:54 +0800 Subject: [PATCH 1/2] refactor: rename package from semaphore-rs to semaphore-protocol and update version to 0.1.0-alpha.0 --- Cargo.lock | 4 ++-- Cargo.toml | 11 +++++++++-- README.md | 14 +++++++------- tests/group.rs | 2 +- tests/identity.rs | 2 +- 5 files changed, 20 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 54178d1..b2c8d61 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2728,8 +2728,8 @@ dependencies = [ ] [[package]] -name = "semaphore-rs" -version = "0.1.0" +name = "semaphore-protocol" +version = "0.1.0-alpha.0" dependencies = [ "anyhow", "ark-ec", diff --git a/Cargo.toml b/Cargo.toml index 4a1c5a9..8a984dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,14 @@ [package] -name = "semaphore-rs" -version = "0.1.0" +name = "semaphore-protocol" +version = "0.1.0-alpha.0" edition = "2024" +description = "Semaphore Rust Implementation" +license = "MIT" +repository = "https://github.com/semaphore-protocol/semaphore-rs" +keywords = ["semaphore", "zk", "zero-knowledge", "proof", "cryptography"] +categories = ["cryptography", "zk", "semaphore"] +documentation = "https://semaphore.pse.dev/" +readme = "README.md" [dependencies] blake = "2.0.2" diff --git a/README.md b/README.md index ec14fa0..f6e676a 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ Add this to your `Cargo.toml`: ```toml [dependencies] -semaphore-rs = "0.1" +semaphore-protocol = "0.1" ``` ### 📜 Usage @@ -84,7 +84,7 @@ semaphore-rs = "0.1" - Generate a semaphore identity from a string ```rust - use semaphore_rs::identity::Identity; + use semaphore_protocol::identity::Identity; let identity = Identity::new("secret".as_bytes()); ``` - Get the identity commitment @@ -101,13 +101,13 @@ semaphore-rs = "0.1" - Generate a group member from an identity ```rust - use semaphore_rs::utils::to_element; + use semaphore_protocol::utils::to_element; let member = to_element(*identity.commitment()) ``` - Generate a semaphore group from members ```rust - use semaphore_rs::group::{Element, Group}; + use semaphore_protocol::group::{Element, Group}; const MEMBER1: Element = [1; 32]; const MEMBER2: Element = [2; 32]; let group = Group::new(&[ @@ -126,8 +126,8 @@ semaphore-rs = "0.1" - Generate a semaphore proof ```rust - use semaphore_rs::proof::GroupOrMerkleProof; - use semaphore_rs::proof::Proof; + use semaphore_protocol::proof::GroupOrMerkleProof; + use semaphore_protocol::proof::Proof; let message = "message"; let scope = "scope"; @@ -161,7 +161,7 @@ semaphore-rs = "0.1" ``` - Deserialize a semaphore proof ```rust - use semaphore_rs::proof::SemaphoreProof; + use semaphore_protocol::proof::SemaphoreProof; let proof_imported = SemaphoreProof::import(&proof_json).unwrap(); ``` diff --git a/tests/group.rs b/tests/group.rs index 8910375..61e7796 100644 --- a/tests/group.rs +++ b/tests/group.rs @@ -71,7 +71,7 @@ mod group { use ark_ed_on_bn254::Fq; use ark_ff::{BigInteger, PrimeField}; use num_bigint::BigInt; - use semaphore_rs::group::{EMPTY_ELEMENT, Element, Group}; + use semaphore_protocol::group::{EMPTY_ELEMENT, Element, Group}; use std::str::FromStr; fn str_to_element(s: &str) -> Element { diff --git a/tests/identity.rs b/tests/identity.rs index 09a5efb..f45212e 100644 --- a/tests/identity.rs +++ b/tests/identity.rs @@ -59,7 +59,7 @@ mod identity { use super::*; use ark_ed_on_bn254::{Fq, Fr}; use ark_ff::{AdditiveGroup, BigInteger, PrimeField}; - use semaphore_rs::{ + use semaphore_protocol::{ baby_jubjub::EdwardsAffine, error::SemaphoreError, identity::{Identity, Signature}, From 91bf51f2675cd6ae0c437bf75c553a3aeda185b8 Mon Sep 17 00:00:00 2001 From: "Ya-wen, Jeng" Date: Mon, 6 Oct 2025 12:27:16 +0800 Subject: [PATCH 2/2] refactor: update library name in Cargo.toml and adjust usage in README and tests to reflect new package structure --- Cargo.toml | 3 +++ README.md | 12 ++++++------ tests/group.rs | 2 +- tests/identity.rs | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8a984dd..21eb95e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,9 @@ categories = ["cryptography", "zk", "semaphore"] documentation = "https://semaphore.pse.dev/" readme = "README.md" +[lib] +name = "semaphore" + [dependencies] blake = "2.0.2" light-poseidon = "0.3.0" diff --git a/README.md b/README.md index f6e676a..147d5a7 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ semaphore-protocol = "0.1" - Generate a semaphore identity from a string ```rust - use semaphore_protocol::identity::Identity; + use semaphore::identity::Identity; let identity = Identity::new("secret".as_bytes()); ``` - Get the identity commitment @@ -101,13 +101,13 @@ semaphore-protocol = "0.1" - Generate a group member from an identity ```rust - use semaphore_protocol::utils::to_element; + use semaphore::utils::to_element; let member = to_element(*identity.commitment()) ``` - Generate a semaphore group from members ```rust - use semaphore_protocol::group::{Element, Group}; + use semaphore::group::{Element, Group}; const MEMBER1: Element = [1; 32]; const MEMBER2: Element = [2; 32]; let group = Group::new(&[ @@ -126,8 +126,8 @@ semaphore-protocol = "0.1" - Generate a semaphore proof ```rust - use semaphore_protocol::proof::GroupOrMerkleProof; - use semaphore_protocol::proof::Proof; + use semaphore::proof::GroupOrMerkleProof; + use semaphore::proof::Proof; let message = "message"; let scope = "scope"; @@ -161,7 +161,7 @@ semaphore-protocol = "0.1" ``` - Deserialize a semaphore proof ```rust - use semaphore_protocol::proof::SemaphoreProof; + use semaphore::proof::SemaphoreProof; let proof_imported = SemaphoreProof::import(&proof_json).unwrap(); ``` diff --git a/tests/group.rs b/tests/group.rs index 61e7796..fd45aef 100644 --- a/tests/group.rs +++ b/tests/group.rs @@ -71,7 +71,7 @@ mod group { use ark_ed_on_bn254::Fq; use ark_ff::{BigInteger, PrimeField}; use num_bigint::BigInt; - use semaphore_protocol::group::{EMPTY_ELEMENT, Element, Group}; + use semaphore::group::{EMPTY_ELEMENT, Element, Group}; use std::str::FromStr; fn str_to_element(s: &str) -> Element { diff --git a/tests/identity.rs b/tests/identity.rs index f45212e..be650e6 100644 --- a/tests/identity.rs +++ b/tests/identity.rs @@ -59,7 +59,7 @@ mod identity { use super::*; use ark_ed_on_bn254::{Fq, Fr}; use ark_ff::{AdditiveGroup, BigInteger, PrimeField}; - use semaphore_protocol::{ + use semaphore::{ baby_jubjub::EdwardsAffine, error::SemaphoreError, identity::{Identity, Signature},