Skip to content

[ZK Stack] - From and to are uint256? #621

Answered by alhenaai bot
alexhooketh asked this question in ZK Stack
Discussion options

You must be logged in to vote

In the context of zkSync transactions, the from and to fields are indeed defined as uint256 values rather than the typical address type, which is essentially uint160 under the hood. This design choice is primarily for forward compatibility, considering potential future changes in address sizes, such as the migration to 32-byte addresses discussed in various Ethereum community proposals.

Here’s how you should handle these fields in your smart contracts or when performing comparisons:

  1. Casting for Comparisons: When you need to compare these uint256 fields with actual EVM addresses, you should safely cast the uint256 to uint160. This casting ensures that you are only dealing with valid EVM …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@alexhooketh
Comment options

@alhenaai
Comment options

Answer selected by bxpana
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
ZK Stack
Labels
zk-stack ZK Stack Question
1 participant