starknet_api: escape the Pedersen image in Blake2 contract address derivation - #14812
Draft
ron-starkware wants to merge 1 commit into
Draft
Conversation
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Jul 15, 2026
ron-starkware
force-pushed
the
ron/contract-address/pluggable-hash
branch
from
July 19, 2026 09:19
bc96b38 to
85b0748
Compare
ron-starkware
force-pushed
the
ron/contract-address/pedersen-image-escape
branch
from
July 19, 2026 09:19
9783bd7 to
34c036c
Compare
|
There hasn't been any activity on this pull request recently, and in order to prioritize active work, it has been marked as stale. |
ron-starkware
force-pushed
the
ron/contract-address/pluggable-hash
branch
from
August 31, 2026 12:56
85b0748 to
dcefda7
Compare
ron-starkware
force-pushed
the
ron/contract-address/pedersen-image-escape
branch
from
August 31, 2026 12:56
34c036c to
0088e53
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Stack — part 2 of 9 (base: #14811). Targets 0.14.5.
Makes the
Blake2arm ofcalculate_contract_addressescape the Pedersen image: the raw BLAKE2s address is incremented (wrapping modL2_ADDRESS_UPPER_BOUND, skipping the reserved0x0/0x1) until no Pedersen derivation can reach it.A Pedersen output is always the x-coordinate of a STARK curve point, so the escaped address is provably unreachable by any Pedersen derivation — a funded-but-undeployed Blake2 address cannot be front-run through
DeployAccountv1/v3 or thedeploysyscall, even by an attacker with a discrete-log oracle. The two address spaces are therefore disjoint, and the scheme is readable off any address with one residuosity check.pedersen_reachable(a) = is_curve_x(a) or (a < SECOND_LIFT_BOUND and is_curve_x(a + ADDR_BOUND)), withSECOND_LIFT_BOUND = p - ADDR_BOUND = 17·2^192 + 257.Tests pin the five frozen derivation vectors (0/1/2/3/7 escape steps) and the
pedersen_reachabletruth table — the same vectors the Cairo OS, the cairo compiler (starkware-libs/cairo#10214) and cairo-native pin.🤖 Generated with Claude Code