Skip to content

Commit 207d1dd

Browse files
authored
chore: Add VERIFIER_HASH value to the output of sphinx-proof program (#6)
1 parent f972956 commit 207d1dd

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This repository contains smart contracts required for on-chain verification of [
55
To install Solidity contracts in your Foundry project:
66

77
```
8-
forge install argumentcomputer/sphinx-contracts --no-commit
8+
forge install argumentcomputer/sphinx-contracts@main --no-commit
99
```
1010

1111
To install Move contracts, add following dependency to your Move.toml file:
@@ -36,6 +36,12 @@ RUST_LOG=info cargo run --package sphinx-proof --release
3636

3737
then copy-paste output to the relevant places in Move / Solidity tests.
3838

39+
You also need to update manually the version tag in `VERSION()` function and the value of the hash in the `VERIFIER_HASH()` function
40+
from `solidity/src/SphinxVerifier.sol`. In Move contracts the verifier hash is stored in `VERSION_1082_TESTNET` constant from `move/sources/utilities.move` source file.
41+
42+
The first value can be taken directly from [Sphinx](https://github.com/argumentcomputer/sphinx/blob/dev/core/src/lib.rs#L33),
43+
while the second is printed while running `sphinx-proof` program.
44+
3945
Finally, to test updated Solidity contracts:
4046

4147
```

sphinx-proof/main.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@ fn main() {
8686
let proof = prover.prove(&pk, stdin).plonk().run().unwrap();
8787
prover.verify(&proof, &vk).unwrap();
8888

89+
match &proof.proof {
90+
sphinx_sdk::SphinxProof::Plonk(pr) => {
91+
println!("To update hash from VERIFIER_HASH() function in SphinxVerifier.sol");
92+
println!();
93+
println!("0x{};", hex::encode(&pr.plonk_vkey_hash));
94+
println!();
95+
}
96+
_ => unreachable!(),
97+
};
98+
8999
print_solidity(&vk, &proof);
90100
print_move(&vk, &proof);
91101
}

0 commit comments

Comments
 (0)