-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Authwit): lookup the validity of authwits (#5316)
Fixes #4822. The current solution is pretty ugly (I think). The issues encountered is mainly that: - There are no context so we need to pass stuff that seems quite redundant (address of the contract itself and block number) - Fetching witness data with oracles explodes if you try to fetch something that does not exists. - The implementation here is a lookup from "outside" a transaction. The latter is the main trouble. It can be somewhat mitigated by having a function on the typescript side of things that try doing the lookup in its local storage first to not encounter that case, but then we need to be able to split the check so seems a bit meh to fix it that way. This means that the unconstrained cannot really be used nicely as what @spalladino did at the offsite, but mainly is an off-chain thing for the user who is unsure if something was approved and want to check it. I'm not really sure if I like to have the implementation this way where we are doing things in both ts and noir to get it somewhat working, but seems like the thing that is making it the easiest to get a query going fast.
- Loading branch information
Showing
8 changed files
with
267 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
use dep::protocol_types::{constants::GENERATOR_INDEX__L1_TO_L2_MESSAGE_SECRET, hash::pedersen_hash}; | ||
use dep::protocol_types::{ | ||
address::AztecAddress, | ||
constants::GENERATOR_INDEX__L1_TO_L2_MESSAGE_SECRET, | ||
hash::{pedersen_hash, silo_nullifier}}; | ||
|
||
pub fn compute_secret_hash(secret: Field) -> Field { | ||
// TODO(#1205) This is probably not the right index to use | ||
pedersen_hash([secret], GENERATOR_INDEX__L1_TO_L2_MESSAGE_SECRET) | ||
} | ||
|
||
pub fn compute_siloed_nullifier(address: AztecAddress, nullifier: Field) -> Field { | ||
silo_nullifier(address, nullifier) | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.