Skip to content

[BUG] nodeKey domain is incorrect on the zktrie page #281

@jimjimvalkema

Description

@jimjimvalkema

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions