Open
Conversation
paolodamico
reviewed
Sep 3, 2025
paolodamico
reviewed
Sep 3, 2025
| reqwest = { version = "0.12.19", features = ["json"] } | ||
| ruint = { version = "1.15.0", default-features = false, features = ["serde"] } | ||
| secrecy = { version = "0.10", features = ["serde"] } | ||
| semaphore-rs = "0.3.1" |
Contributor
There was a problem hiding this comment.
let me think about this, wanted to keep complete separations between World App and World ID
0xOsiris
requested changes
Sep 3, 2025
|
|
||
| /// `PBHSignatureAggregator` - Sepolia | ||
| /// Contract reference: <https://github.com/worldcoin/world-chain/blob/main/contracts/src/PBHSignatureAggregator.sol> | ||
| pub static PBH_SIGNATURE_AGGREGATOR_SEPOLIA: LazyLock<Address> = LazyLock::new(|| { |
There was a problem hiding this comment.
Address is copy. This can just be a const. Prefer using address!
|
|
||
| impl From<WorldchainBuilderPBHPayload> for PBHPayload { | ||
| fn from(val: WorldchainBuilderPBHPayload) -> Self { | ||
| let p0 = val.proof.0 .0 .0; |
There was a problem hiding this comment.
Prefer semaphore_rs::protocol::Proof::from_flat
|
|
||
| const STAGING_MAX_NONCE: u16 = u16::MAX; | ||
| // TODO: UPDATE THIS ONCE SET IN PRODUCTION | ||
| const PRODUCTION_MAX_NONCE: u16 = 9000; |
There was a problem hiding this comment.
These values should be read from the PBHEntryPoint such that they never fall out of sync.
| ) -> Result<WorldchainBuilderPBHPayload, WorldIdError> { | ||
| let packed_user_op: PackedUserOperation = PackedUserOperation::from(user_op); | ||
| let signal = hash_user_op(&packed_user_op); | ||
| let external_nullifier = find_unused_nullifier_hash(network).await?; |
There was a problem hiding this comment.
You should join the future to fetch the inclusion proof with the future to fetch the nullifier hash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add world id primitive for setting identity + generating PBH proofs
Will automatically fetch unused PBH nonce + generate the nullifier
Add eth_call function inside RPC for contract calls
Add pbh logic inside 4337 userOperation construction
Add RPCUserOperationv7 struct for clean serialization before sending to RPC as certain fields (paymaster/factory) were not properly removed which cause bundler errors
Set userOperation nonce using magic 5 bytes depending on if its PBH or not
Add E2E test on sepolia with hard coded staging identity (TODO: Move secret into CI)