Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is the Noir circuit checking for fid < 10000? #4

Open
harshnambiar opened this issue Feb 8, 2024 · 0 comments
Open

Is the Noir circuit checking for fid < 10000? #4

harshnambiar opened this issue Feb 8, 2024 · 0 comments

Comments

@harshnambiar
Copy link

Hi. I was trying to work through the Noir<>Farcaster integration and this repository seemed to have that. I am looking the v2 Noir circuit:

fn main(
  fid: Field,
  timestamp: pub u64,
  public_key_preimage: Field,
  public_key: Field,
  // Merkle membership proof
  note_root: pub Field,
  index: Field,
  note_hash_path: [Field; 16],
  // Message
  message: pub [Field; 16],
  // Reply cast id
  reply: pub [Field; 4]
) -> pub ([Field; 16], u64, [Field; 4]) {
  let expected_public_key = std::hash::mimc_bn254([public_key_preimage]);

  assert(expected_public_key == public_key);

  // assert(public_key == expected_public_key);
  let commitment = std::hash::mimc_bn254([fid, public_key]);

  // Check that the input note commitment is in the root
  let new_root = compute_root_from_leaf(commitment, index, note_hash_path);
  assert(new_root == note_root);

  (message, timestamp, reply)
}

I'm wondering where the fid < 10000 part is being tested, and what the public_key_preimage comes from. Would appreciate some assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant