Encoding & Caveats
Contract state is stored through a deterministic JSON-based encoding layer.
Supported Special Types
The encoder has explicit markers for:
ContractingDecimaldatetime.datetime/ contractDatetimedatetime.timedelta/ contractTimedeltabytes- very large integers
Why This Matters
Consensus depends on every validator encoding the same value into the same byte representation.
For numeric values, this means:
- contract
floatvalues are stored asContractingDecimal - decimal values are encoded with the
__fixed__marker - the same numeric value always produces the same stored representation
Practical Advice
- keep values JSON-like where possible
- avoid storing very large blobs
- remember that storage cost is byte-based
- use shorter key and field names when stamp efficiency matters
Read/Write Cost Reminder
- reads:
1stamp per byte - writes:
25stamps per byte
That byte count includes both key and value.