-
Notifications
You must be signed in to change notification settings - Fork 191
Description
Describe the bug
On the zkTrie page at the ethereum-account-leaf-node and storage-leaf-node section the domain for hashing the nodeKey preimage is set to 256 instead of 512
To Reproduce
In the zktrie repo nodekeys are hashed with ToSecureKey() in type/util.go (afaik) https://github.com/scroll-tech/zktrie/blob/23181f209e94137f74337b150179aeb80c72e7c8/types/util.go#L107
ToSecureKey() uses Hash() in types/bytes32.go which uses HASH_DOMAIN_BYTE32 as domain which is 256 *2 (512) see here: https://github.com/scroll-tech/zktrie/blob/23181f209e94137f74337b150179aeb80c72e7c8/types/hash.go#L16
URLs
- https://docs.scroll.io/en/technology/sequencer/zktrie/#storage-leaf-node
- https://docs.scroll.io/en/technology/sequencer/zktrie/#ethereum-account-leaf-node
Expected behavior
domain used in nodeKey preimaged should be 512
Additional context
Am currently making a storage prover for scroll in noir and came accross the error in the docs.
Here is my testing hashing a leaf :D (account leaf is lower in same file) https://github.com/jimjimvalkema/scrollZkStorageProofs/blob/bcdd922405e046e99787b8b47f374befac170779/ScrollStorageProver/src/main.nr#L168