-
Notifications
You must be signed in to change notification settings - Fork 234
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: add nullifying key to Token Note #6130
Changes from 140 commits
3acc686
1f53bd5
177445f
fdbb60a
2d3a95f
58f9650
42a9c35
f82d1c8
ea93350
781bbe3
3201fd4
1b13804
211a060
29bfb80
7d1620d
f0ece69
0461006
e4f6d15
f9a844b
0e0b63e
7572be2
9051c8e
6e3509a
6fbd1d9
711afac
7f5dbfc
afdd9df
48b0626
0ca8578
c852740
3b9e7ba
b76ab1a
7eb2366
e2a479a
ede83f4
59a4c18
dd9ae57
32598c9
0f0df81
7534a16
cf27fc9
194df19
938761a
0baf281
a85f513
209fe0c
94db9f5
0c7dc94
6f0d457
1cae18c
2f19996
fffee53
167603b
4416ccb
5d1b800
c4a745f
3c89a06
d69e112
b954ecc
577b69c
11b4848
435c9fd
a74311b
1d9964a
5fa644d
227378c
ccbb5c9
f5659f5
c8901ff
ec75986
4bfaefa
4604a29
53a443b
d9704ab
7fd8b1d
b9733a0
9a3829c
40ce5c6
b432ad2
f734d3f
bd7db1e
04f058f
76850bd
4f86276
e47580f
b85388d
b4d24e1
29f4225
af0ffd7
05f8fef
f8f27a7
ded1ee3
2f76913
bfe3f87
1ce4d63
3e6ec6f
2bd798e
ba7aa67
906e105
113b1e9
9fae196
e9f2326
97a6c5a
fe73adb
eb53c44
b6b6969
8ecec72
730c842
1deda94
851c53e
5cee1ce
a2eed7c
1d52a38
6798917
0a523d4
06c4cc2
a765ec7
5c63480
993e33d
31ec469
a1f3f9b
f418d3e
4511907
e9a1007
2478e6e
5ca32e2
34b8aa1
44f8bf4
5a41082
3287585
dc1476a
f014dde
84e53c3
fee5a59
9563d94
071e7c4
3420a2f
79c13a3
34eb010
d93ce6b
7890520
880fb54
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 |
---|---|---|
@@ -1,6 +1,10 @@ | ||
use dep::protocol_types::{address::AztecAddress, constants::CANONICAL_KEY_REGISTRY_ADDRESS, grumpkin_point::GrumpkinPoint}; | ||
use dep::protocol_types::{ | ||
address::AztecAddress, constants::CANONICAL_KEY_REGISTRY_ADDRESS, grumpkin_point::GrumpkinPoint, | ||
hash::poseidon2_hash | ||
}; | ||
use crate::{ | ||
context::PrivateContext, oracle::keys::get_public_keys_and_partial_address, | ||
context::PrivateContext, | ||
oracle::keys::{get_public_keys_and_partial_address, get_public_keys_and_partial_address_with_npk_m_hash}, | ||
keys::public_keys::{PublicKeys, NULLIFIER_INDEX, INCOMING_INDEX}, | ||
state_vars::{ | ||
map::derive_storage_slot_in_map, | ||
|
@@ -14,6 +18,10 @@ pub fn get_npk_m(context: &mut PrivateContext, address: AztecAddress) -> Grumpki | |
get_master_key(context, address, NULLIFIER_INDEX) | ||
} | ||
|
||
pub fn get_npk_m_hash(context: &mut PrivateContext, address: AztecAddress) -> Field { | ||
poseidon2_hash(get_master_key(context, address, NULLIFIER_INDEX).serialize()) | ||
} | ||
|
||
pub fn get_ivpk_m(context: &mut PrivateContext, address: AztecAddress) -> GrumpkinPoint { | ||
get_master_key(context, address, INCOMING_INDEX) | ||
} | ||
|
@@ -80,3 +88,8 @@ fn fetch_and_constrain_keys(address: AztecAddress) -> PublicKeys { | |
|
||
public_keys | ||
} | ||
|
||
pub fn get_ivpk_m_with_npk_m_hash(npk_m_hash: Field) -> GrumpkinPoint { | ||
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. I don't think this functin should exist, as we whould never really need to make this lookup in the intended flow with the changes required on broadcasting etc. But I can follow it for not making this pr huge. 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. Yep, should have added a comment, this is removed downstream in a stack. |
||
let result = get_public_keys_and_partial_address_with_npk_m_hash(npk_m_hash); | ||
result.0.ivpk_m | ||
} |
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.
As Lasse pointed out, docs should change in several places here (such as token tutorial where we add address or anywhere where we talk about notes! This can also be done in your other PR where you are changing all other notes
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.
I think it would make more sense to handle docs in the final task in the arc, after all the notes are changed, so it's a bit easier to find / replace the entire block, also I wouldn't have to worry about caveats (some have been replaced and some haven't). Although I do not mind doing it in this PR. Wdyt ?