Skip to content

Commit ba56037

Browse files
committed
fix: rename bn128 to bn256
1 parent def0f87 commit ba56037

File tree

23 files changed

+195
-195
lines changed

23 files changed

+195
-195
lines changed

Makefile

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -653,24 +653,24 @@ batcher_send_groth16_bn254_infinite: crates/target/release/aligned ## Send a dif
653653
@mkdir -p scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs
654654
@./crates/cli/send_burst_tasks.sh $(BURST_SIZE) $(START_COUNTER)
655655

656-
batcher_send_circom_groth16_bn128_task: crates/target/release/aligned ## Send a Circom Groth16 BN128 proof to Batcher. Parameters: RPC_URL, NETWORK
657-
@echo "Sending Circom Groth16 BN128 proof to Batcher..."
656+
batcher_send_circom_groth16_bn256_task: crates/target/release/aligned ## Send a Circom Groth16 BN256 proof to Batcher. Parameters: RPC_URL, NETWORK
657+
@echo "Sending Circom Groth16 BN256 proof to Batcher..."
658658
@cd crates/cli/ && cargo run --release -- submit \
659-
--proving_system CircomGroth16Bn128 \
660-
--proof ../../scripts/test_files/circom_groth16_bn128_script/proof.json \
661-
--public_input ../../scripts/test_files/circom_groth16_bn128_script/public.json \
662-
--vk ../../scripts/test_files/circom_groth16_bn128_script/verification_key.json \
659+
--proving_system CircomGroth16Bn256 \
660+
--proof ../../scripts/test_files/circom_groth16_bn256_script/proof.json \
661+
--public_input ../../scripts/test_files/circom_groth16_bn256_script/public.json \
662+
--vk ../../scripts/test_files/circom_groth16_bn256_script/verification_key.json \
663663
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
664664
--rpc_url $(RPC_URL) \
665665
--network $(NETWORK)
666666

667-
batcher_send_circom_groth16_bn128_burst: crates/target/release/aligned ## Send a burst of Circom Groth16 BN128 proofs to Batcher. Parameters: RPC_URL, NETWORK, BURST_SIZE
668-
@echo "Sending Circom Groth16 BN128 proof to Batcher..."
667+
batcher_send_circom_groth16_bn256_burst: crates/target/release/aligned ## Send a burst of Circom Groth16 BN256 proofs to Batcher. Parameters: RPC_URL, NETWORK, BURST_SIZE
668+
@echo "Sending Circom Groth16 BN256 proof to Batcher..."
669669
@cd crates/cli/ && cargo run --release -- submit \
670-
--proving_system CircomGroth16Bn128 \
671-
--proof ../../scripts/test_files/circom_groth16_bn128_script/proof.json \
672-
--public_input ../../scripts/test_files/circom_groth16_bn128_script/public.json \
673-
--vk ../../scripts/test_files/circom_groth16_bn128_script/verification_key.json \
670+
--proving_system CircomGroth16Bn256 \
671+
--proof ../../scripts/test_files/circom_groth16_bn256_script/proof.json \
672+
--public_input ../../scripts/test_files/circom_groth16_bn256_script/public.json \
673+
--vk ../../scripts/test_files/circom_groth16_bn256_script/verification_key.json \
674674
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
675675
--repetitions $(BURST_SIZE) \
676676
--rpc_url $(RPC_URL) \
@@ -785,13 +785,13 @@ generate_gnark_groth16_bn254_ineq_proof: ## Run the gnark_plonk_bn254_script
785785
@echo "Running gnark_groth_bn254_ineq script..."
786786
@go run scripts/test_files/gnark_groth16_bn254_infinite_script/cmd/main.go 1
787787

788-
generate_circom_groth16_bn128_proof: ## Run the circom_groth16_bn128_script
789-
@echo "Running circom_groth16_bn128 script..."
790-
@cd scripts/test_files/circom_groth16_bn128_script && ./generate_proof.sh
788+
generate_circom_groth16_bn256_proof: ## Run the circom_groth16_bn256_script
789+
@echo "Running circom_groth16_bn256 script..."
790+
@cd scripts/test_files/circom_groth16_bn256_script && ./generate_proof.sh
791791

792-
generate_circom_groth16_bn128_setup: ## Run the circom_groth16_bn128_script setup
793-
@echo "Running circom_groth16_bn128 script setup..."
794-
@cd scripts/test_files/circom_groth16_bn128_script && ./generate_setup.sh
792+
generate_circom_groth16_bn256_setup: ## Run the circom_groth16_bn256_script setup
793+
@echo "Running circom_groth16_bn256 script setup..."
794+
@cd scripts/test_files/circom_groth16_bn256_script && ./generate_setup.sh
795795

796796
__CONTRACTS_DEPLOYMENT__: ## ____
797797
deploy_aligned_contracts: ## Deploy Aligned Contracts. Parameters: NETWORK=<mainnet|holesky|sepolia>
@@ -1127,14 +1127,14 @@ docker_batcher_send_groth16_burst:
11271127
--rpc_url $(DOCKER_RPC_URL) \
11281128
--max_fee 0.1ether
11291129

1130-
docker_batcher_send_circom_groth16_bn128_burst:
1131-
@echo "Sending Circom Groth16 BN128 task to Batcher..."
1130+
docker_batcher_send_circom_groth16_bn256_burst:
1131+
@echo "Sending Circom Groth16 BN256 task to Batcher..."
11321132
docker exec $(shell docker ps | grep batcher | awk '{print $$1}') aligned submit \
11331133
--private_key $(DOCKER_PROOFS_PRIVATE_KEY) \
1134-
--proving_system CircomGroth16Bn128 \
1135-
--proof ./scripts/test_files/circom_groth16_bn128_script/proof.json \
1136-
--public_input ./scripts/test_files/circom_groth16_bn128_script/public.json \
1137-
--vk ./scripts/test_files/circom_groth16_bn128_script/verification_key.json \
1134+
--proving_system CircomGroth16Bn256 \
1135+
--proof ./scripts/test_files/circom_groth16_bn256_script/proof.json \
1136+
--public_input ./scripts/test_files/circom_groth16_bn256_script/public.json \
1137+
--vk ./scripts/test_files/circom_groth16_bn256_script/verification_key.json \
11381138
--proof_generator_addr $(PROOF_GENERATOR_ADDRESS) \
11391139
--repetitions $(DOCKER_BURST_SIZE) \
11401140
--rpc_url $(DOCKER_RPC_URL) \
@@ -1147,7 +1147,7 @@ docker_batcher_send_all_proofs_burst:
11471147
@$(MAKE) docker_batcher_send_plonk_bn254_burst
11481148
@$(MAKE) docker_batcher_send_plonk_bls12_381_burst
11491149
@$(MAKE) docker_batcher_send_groth16_burst
1150-
@$(MAKE) docker_batcher_send_circom_groth16_bn128_burst
1150+
@$(MAKE) docker_batcher_send_circom_groth16_bn256_burst
11511151

11521152
docker_batcher_send_infinite_groth16:
11531153
docker exec $(shell docker ps | grep batcher | awk '{print $$1}') \

common/proving_systems.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const (
1616
Groth16Bn254
1717
SP1
1818
Risc0
19-
CircomGroth16Bn128
19+
CircomGroth16Bn256
2020
)
2121

2222
func (t *ProvingSystemId) String() string {
@@ -35,8 +35,8 @@ func ProvingSystemIdFromString(provingSystem string) (ProvingSystemId, error) {
3535
return SP1, nil
3636
case "Risc0":
3737
return Risc0, nil
38-
case "CircomGroth16Bn128":
39-
return CircomGroth16Bn128, nil
38+
case "CircomGroth16Bn256":
39+
return CircomGroth16Bn256, nil
4040
}
4141

4242
return 0, fmt.Errorf("unknown proving system: %s", provingSystem)
@@ -54,8 +54,8 @@ func ProvingSystemIdToString(provingSystem ProvingSystemId) (string, error) {
5454
return "SP1", nil
5555
case Risc0:
5656
return "Risc0", nil
57-
case CircomGroth16Bn128:
58-
return "CircomGroth16Bn128", nil
57+
case CircomGroth16Bn256:
58+
return "CircomGroth16Bn256", nil
5959
}
6060

6161
return "", fmt.Errorf("unknown proving system: %d", provingSystem)
@@ -110,8 +110,8 @@ func (s *ProvingSystemId) UnmarshalCBOR(data []byte) error {
110110
*s = SP1
111111
case "Risc0":
112112
*s = Risc0
113-
case "CircomGroth16Bn128":
114-
*s = CircomGroth16Bn128
113+
case "CircomGroth16Bn256":
114+
*s = CircomGroth16Bn256
115115
}
116116

117117
return nil

crates/batcher/go_verifiers_lib/verifier.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ func verifyGroth16Proof(proofBytesRef C.ListRef, pubInputBytesRef C.ListRef, ver
122122
return err == nil
123123
}
124124

125-
//export VerifyCircomGroth16ProofBN128
126-
func VerifyCircomGroth16ProofBN128(proofBytesRef C.ListRef, pubInputBytesRef C.ListRef, verificationKeyBytesRef C.ListRef) bool {
125+
//export VerifyCircomGroth16ProofBN256
126+
func VerifyCircomGroth16ProofBN256(proofBytesRef C.ListRef, pubInputBytesRef C.ListRef, verificationKeyBytesRef C.ListRef) bool {
127127
proofBytes := listRefToBytes(proofBytesRef)
128128
pubInputBytes := listRefToBytes(pubInputBytesRef)
129129
verificationKeyBytes := listRefToBytes(verificationKeyBytesRef)

crates/batcher/src/circom/verifier.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::ffi::circom_ffi::VerifyCircomGroth16ProofBN128;
1+
use crate::ffi::circom_ffi::VerifyCircomGroth16ProofBN256;
22
use aligned_sdk::common::types::ProvingSystemId;
33

44
pub fn verify_circom(
@@ -12,8 +12,8 @@ pub fn verify_circom(
1212
let verification_key = verification_key.into();
1313

1414
match proving_system {
15-
ProvingSystemId::CircomGroth16Bn128 => unsafe {
16-
VerifyCircomGroth16ProofBN128(proof, public_input, verification_key)
15+
ProvingSystemId::CircomGroth16Bn256 => unsafe {
16+
VerifyCircomGroth16ProofBN256(proof, public_input, verification_key)
1717
},
1818
_ => false,
1919
}

crates/batcher/src/ffi/circom_ffi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::ffi::list_ref::ListRef;
22

33
extern "C" {
4-
pub fn VerifyCircomGroth16ProofBN128(
4+
pub fn VerifyCircomGroth16ProofBN256(
55
proof: ListRef,
66
public_input: ListRef,
77
verification_key: ListRef,

crates/batcher/src/zk_utils/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ fn verify_internal(verification_data: &VerificationData) -> bool {
6060
debug!("Gnark proof is valid: {}", is_valid);
6161
is_valid
6262
}
63-
ProvingSystemId::CircomGroth16Bn128 => {
63+
ProvingSystemId::CircomGroth16Bn256 => {
6464
let Some(pub_input) = verification_data.pub_input.as_ref() else {
6565
warn!("Circom Groth16 public input missing");
6666
return false;
@@ -102,7 +102,7 @@ mod test {
102102
ProvingSystemId::Groth16Bn254,
103103
ProvingSystemId::SP1,
104104
ProvingSystemId::Risc0,
105-
ProvingSystemId::CircomGroth16Bn128,
105+
ProvingSystemId::CircomGroth16Bn256,
106106
];
107107
// Just to make sure we are not missing any verifier. The compilation will fail if we do and it forces us to add it to the vec above.
108108
for verifier in verifiers.iter() {
@@ -112,7 +112,7 @@ mod test {
112112
ProvingSystemId::GnarkPlonkBls12_381 => (),
113113
ProvingSystemId::GnarkPlonkBn254 => (),
114114
ProvingSystemId::Groth16Bn254 => (),
115-
ProvingSystemId::CircomGroth16Bn128 => (),
115+
ProvingSystemId::CircomGroth16Bn256 => (),
116116
}
117117
}
118118
verifiers

crates/cli/send_proof_with_random_address.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ elif [[ $PROOF_TYPE == "risc0" ]]; then
7474

7575
elif [[ $PROOF_TYPE == "circom_groth16" ]]; then
7676
aligned submit \
77-
--proving_system CircomGroth16Bn128 \
78-
--proof ../../scripts/test_files/circom_groth16_bn128_script/proof.json \
79-
--public_input ../../scripts/test_files/circom_groth16_bn128_script/public.json \
80-
--vk ../../scripts/test_files/circom_groth16_bn128_script/verification_key.json \
77+
--proving_system CircomGroth16Bn256 \
78+
--proof ../../scripts/test_files/circom_groth16_bn256_script/proof.json \
79+
--public_input ../../scripts/test_files/circom_groth16_bn256_script/public.json \
80+
--vk ../../scripts/test_files/circom_groth16_bn256_script/verification_key.json \
8181
--random_address \
8282
--repetitions $REPETITIONS \
8383
--rpc_url $RPC_URL \

crates/cli/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,8 @@ pub enum ProvingSystemArg {
356356
SP1,
357357
#[clap(name = "Risc0")]
358358
Risc0,
359-
#[clap(name = "CircomGroth16Bn128")]
360-
CircomGroth16Bn128,
359+
#[clap(name = "CircomGroth16Bn256")]
360+
CircomGroth16Bn256,
361361
}
362362

363363
const ANVIL_PRIVATE_KEY: &str = "2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6"; // Anvil address 9
@@ -370,7 +370,7 @@ impl From<ProvingSystemArg> for ProvingSystemId {
370370
ProvingSystemArg::Groth16Bn254 => ProvingSystemId::Groth16Bn254,
371371
ProvingSystemArg::SP1 => ProvingSystemId::SP1,
372372
ProvingSystemArg::Risc0 => ProvingSystemId::Risc0,
373-
ProvingSystemArg::CircomGroth16Bn128 => ProvingSystemId::CircomGroth16Bn128,
373+
ProvingSystemArg::CircomGroth16Bn256 => ProvingSystemId::CircomGroth16Bn256,
374374
}
375375
}
376376
}
@@ -914,7 +914,7 @@ fn verification_data_from_args(args: &SubmitArgs) -> Result<VerificationData, Su
914914
args.pub_input_file_name.clone(),
915915
)?);
916916
}
917-
ProvingSystemId::CircomGroth16Bn128 => {
917+
ProvingSystemId::CircomGroth16Bn256 => {
918918
verification_key = Some(read_file_option(
919919
"--vk",
920920
args.verification_key_file_name.clone(),

crates/sdk/src/common/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub enum ProvingSystemId {
4646
#[default]
4747
SP1,
4848
Risc0,
49-
CircomGroth16Bn128,
49+
CircomGroth16Bn256,
5050
}
5151

5252
impl Display for ProvingSystemId {
@@ -57,7 +57,7 @@ impl Display for ProvingSystemId {
5757
ProvingSystemId::Groth16Bn254 => write!(f, "Groth16Bn254"),
5858
ProvingSystemId::SP1 => write!(f, "SP1"),
5959
ProvingSystemId::Risc0 => write!(f, "Risc0"),
60-
ProvingSystemId::CircomGroth16Bn128 => write!(f, "CircomGroth16Bn128"),
60+
ProvingSystemId::CircomGroth16Bn256 => write!(f, "CircomGroth16Bn256"),
6161
}
6262
}
6363
}

docs/3_guides/0_submitting_proofs.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,14 @@ aligned submit \
256256
--rpc_url https://ethereum-holesky-rpc.publicnode.com
257257
```
258258
259-
### CircomGroth16Bn128
259+
### CircomGroth16Bn256
260260
261-
The CircomGroth16Bn128 proof needs the proof file, the public input file and the verification key file.
261+
The CircomGroth16Bn256 proof needs the proof file, the public input file and the verification key file.
262262
263263
```bash
264264
rm -rf ./aligned_verification_data/ &&
265265
aligned submit \
266-
--proving_system CircomGroth16Bn128 \
266+
--proving_system CircomGroth16Bn256 \
267267
--proof <proof_file> \
268268
--public_input <public_input_file> \
269269
--vk <verification_key_file> \
@@ -278,10 +278,10 @@ aligned submit \
278278
```bash
279279
rm -rf ./aligned_verification_data/ &&
280280
aligned submit \
281-
--proving_system CircomGroth16Bn128 \
282-
--proof ./scripts/test_files/circom_groth16_bn128_script/proof.json \
283-
--public_input ./scripts/test_files/circom_groth16_bn128_script/public.json \
284-
--vk ./scripts/test_files/circom_groth16_bn128_script/verification_key.json \
281+
--proving_system CircomGroth16Bn256 \
282+
--proof ./scripts/test_files/circom_groth16_bn256_script/proof.json \
283+
--public_input ./scripts/test_files/circom_groth16_bn256_script/public.json \
284+
--vk ./scripts/test_files/circom_groth16_bn256_script/verification_key.json \
285285
--keystore_path ~/.aligned_keystore/keystore0 \
286286
--network holesky \
287287
--rpc_url https://ethereum-holesky-rpc.publicnode.com

0 commit comments

Comments
 (0)