Skip to content

starknet_api: make contract address derivation hash-pluggable - #14811

Draft
ron-starkware wants to merge 1 commit into
mainfrom
ron/contract-address/pluggable-hash
Draft

starknet_api: make contract address derivation hash-pluggable#14811
ron-starkware wants to merge 1 commit into
mainfrom
ron/contract-address/pluggable-hash

Conversation

@ron-starkware

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

Copy link
Copy Markdown
Contributor

Stack — part 1 of 9 (ron/contract-address/*, one commit per branch). Targets 0.14.5.

Introduces AddressDerivationHash { Pedersen, Blake2 } and parameterizes calculate_contract_address over it through a generic inner helper.

The scheme is selected per transaction version at the derivation sites — there is no network-wide cutover, no protocol-version gate and no runtime flag. Every caller in this PR still passes Pedersen, so this is a behavior-preserving refactor that prepares DeployAccount v4 (#14813) and the deploy_v2 syscall (#14817).

The deploy / deploy-account transaction-hash functions now take the already-derived ContractAddress as a parameter instead of recomputing it. That leaves the broad TransactionHasher trait unchanged and keeps the scheme choice at the derivation sites, where the per-version dispatch lands.

🤖 Generated with Claude Code

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

@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!

Introduce AddressDerivationHash {Pedersen, Blake2} and parameterize
calculate_contract_address over it via a generic inner helper. The scheme is
selected per transaction version at the derivation sites -- there is no
network-wide cutover and no runtime flag. Every caller still passes Pedersen,
so this is a behavior-preserving refactor that prepares DeployAccount v4.

The deploy / deploy-account transaction-hash functions now take the already-
derived ContractAddress as a parameter instead of recomputing it, which leaves
the broad TransactionHasher trait unchanged and keeps the scheme choice at the
derivation sites.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ron-starkware
ron-starkware force-pushed the ron/contract-address/pluggable-hash branch from 85b0748 to dcefda7 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