Skip to content

starknet_os: support DeployAccount v4 Blake2 address derivation in the OS - #14814

Draft
ron-starkware wants to merge 1 commit into
ron/contract-address/deploy-account-v4-typesfrom
ron/contract-address/os-v4
Draft

starknet_os: support DeployAccount v4 Blake2 address derivation in the OS#14814
ron-starkware wants to merge 1 commit into
ron/contract-address/deploy-account-v4-typesfrom
ron/contract-address/os-v4

Conversation

@ron-starkware

@ron-starkware ron-starkware commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Stack — part 4 of 9 (base: #14813). Targets 0.14.5.

Teaches the proving OS to derive a v4 deploy-account address.

  • get_contract_address_blake_escaped in the OS (BLAKE2s + the Pedersen-image escape), verified from hints rather than computing a Legendre symbol in-circuit: a skipped candidate needs a square root of t(lift), the final candidate a square root of t(address)/3 (3 is a fixed quadratic non-residue). One field-mul per witness; a wrong witness fails the proof, so the hint cannot move the address.
  • prepare_constructor_execution_context dispatches on the hinted tx_version. That hint is bound by the transaction-hash assertion — both the version felt and the derived address are in the committed preimage.
  • get_account_tx_common_fields takes the version (was hardcoded 3); the deploy-account tx-hash, deprecated-fields-consistency and max-fee asserts are relaxed from = 3 to (v-3)(v-4) = 0.
  • The Cairo↔Rust parity test asserts the OS derivation equals starknet_api's Blake2 arm, escape included.

Versioned constants (0.14.5 only): extending those shared version guards costs a few steps per transaction even for v3 — execute_txs_inner DeployAccount 4989→5017, InvokeFunction 4779→4787, Declare 3938→3946 — which is the normal consequence of adding a transaction version through shared gates. blockifier_versioned_constants_0_14_4.json and the 0.14.3→0.14.4 diff fixture are byte-identical to main; the deltas land in 0_14_5 and its diff fixture. allowed_virtual_os_program_hashes keeps 0x1c7be3… (baked into the frozen stwo proof fixtures) and replaces only the other slot.

🤖 Generated with Claude Code

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

@github-actions

Copy link
Copy Markdown

There hasn't been any activity on this pull request recently, and in order to prioritize active work, it has been marked as stale.
This PR will be closed and locked in 7 days if no further activity occurs.
Thank you for your contributions!

@ron-starkware
ron-starkware force-pushed the ron/contract-address/deploy-account-v4-types branch from 2ecac08 to 159b89b Compare August 31, 2026 12:56
@ron-starkware
ron-starkware force-pushed the ron/contract-address/os-v4 branch from b18e4e1 to 43dbd2f Compare August 31, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants