-
Notifications
You must be signed in to change notification settings - Fork 304
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
feat: re-enabling authwit constraint #6323
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,19 +3,19 @@ use dep::aztec::protocol_types::address::PublicKeysHash; | |
use dep::std::{schnorr::verify_signature_slice}; | ||
use crate::auth_oracle::AuthWitness; | ||
|
||
// TODO(#5830): the following is currently broken because we are no longer able to compute public keys hash | ||
// pub fn recover_address(message_hash: Field, witness: AuthWitness) -> AztecAddress { | ||
// let message_bytes = message_hash.to_be_bytes(32); | ||
// let verification = verify_signature_slice( | ||
// witness.owner.x, | ||
// witness.owner.y, | ||
// witness.signature, | ||
// message_bytes | ||
// ); | ||
// assert(verification == true); | ||
pub fn recover_address(message_hash: Field, witness: AuthWitness) -> AztecAddress { | ||
let message_bytes = message_hash.to_be_bytes(32); | ||
// In a single key account contract we re-used ivpk_m as signing key | ||
let verification = verify_signature_slice( | ||
witness.ivpk_m.x, | ||
witness.ivpk_m.y, | ||
witness.signature, | ||
message_bytes | ||
); | ||
assert(verification == true); | ||
|
||
// AztecAddress::compute( | ||
// PublicKeysHash::compute(witness.owner), | ||
// witness.partial_address | ||
// ) | ||
// } | ||
AztecAddress::compute( | ||
PublicKeysHash::compute(witness.npk_m, witness.ivpk_m, witness.ovpk_m, witness.tpk_m), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems a bit weird to me here if the viewing key is used as the signing key? But might just be the confusion over the "single_key" when the signing key is one of the other keys. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
witness.partial_address | ||
) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,7 +125,6 @@ export class AccountManager { | |
); | ||
} | ||
await this.#register(); | ||
const encryptionPublicKey = this.getPublicKeysHash(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an issue unrelated stale naming fix. |
||
const { chainId, protocolVersion } = await this.pxe.getNodeInfo(); | ||
const deployWallet = new SignerlessWallet(this.pxe, new DefaultMultiCallEntrypoint(chainId, protocolVersion)); | ||
|
||
|
@@ -135,7 +134,7 @@ export class AccountManager { | |
const args = this.accountContract.getDeploymentArgs() ?? []; | ||
this.deployMethod = new DeployAccountMethod( | ||
this.accountContract.getAuthWitnessProvider(this.getCompleteAddress()), | ||
encryptionPublicKey, | ||
this.getPublicKeysHash(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an issue unrelated stale naming fix. |
||
deployWallet, | ||
this.accountContract.getContractArtifact(), | ||
args, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be made nicer in my PR up the stack.