Skip to main content

Command Palette

Search for a command to run...

Deserialization in Cairo

Published
•1 min read•View as Markdown

Serialization of uint256 values in Cairo

  • In Cairo uint256 is represented as two felt252 values of 128 bit each

  • The first felt252 value represent the least significant bits, low part

  • The second felt252 value represent the most significant bits, high part

Taking examples from the Starkent documentation, let’s try to understand serialization

  1. Serialization of 2

  2. Serialization of 2^128

  3. Serialization of 2^129 + 2^128 + 20

More from this blog

tammy writes

7 posts