Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
What is the `Big-endian by default` means here?

In TVM's whitepaper, we got this in Chapter 3.2.8:

Integers in cells are big-endian by default.
Notice that the
default order of bits in Integer s serialized into Cells is big-endian, not littleendian.14 In this respect TVM is a big-endian machine. However, this affects
only the serialization of integers inside cells. The internal representation of
the Integer value type is implementation-dependent and irrelevant for the
operation of TVM. Besides, there are some special primitives such as STULE
for (de)serializing little-endian integers, which must be stored into an integral
number of bytes (otherwise “little-endianness” does not make sense, unless
one is also willing to revert the order of bits inside octets). Such primitives are
useful for interfacing with the little-endian world—for instance, for parsing
custom-format messages arriving to a TON Blockchain smart contract from
the outside world.

Please share with me what is thatm and why it's important

Reference: https://docs.ton.org/tvm.pdf

Votes Newest



In big endian byte order, the **most significant byte (MSB) is stored at the lowest memory address, and the least significant byte (LSB) is stored at the highest memory address.

This is also known as network byte order, because it is the format used in internet protocols like TCP/IP in general.

Big-Endian in TVM

In TVM, integers within cells are serialized using the big-endian format by default. This means that when an integer is converted into a sequence of bytes to be stored, the most significant byte is placed at the beginning.

Example 1: Big-Endian Serialization

Consider the 16-bit integer 0xABCD. In big-endian format, it would be stored as:

0xAB 0xCD

Little-Endian with Special Primitives

The text also mentions special primitives such as STULE that allow for (de)serializing little-endian integers. In a little-endian system, the least significant byte is stored first.

Example 2: Little-Endian Serialization

Using little-endian for the same integer 0xABCD, it would be stored as:

0xCD 0xAB

Relevance to TVM

  • Big-Endian Default: TVM uses big-endian for standard serialization of integers within cells, making it a big-endian machine in this respect.
  • Internal Representation: The internal representation of integers within the TVM is implementation-dependent and not relevant to how TVM operates.
  • Little-Endian Primitives: Special primitives for handling little-endian integers are available, which can be useful when interfacing with systems or data formats that use little-endian. This could be important for parsing custom messages from external sources.


Understanding the endianness is vital when working with low-level data manipulation in TVM.

By default, TVM uses big-endian, but there are tools for handling little-endian data when needed.

The choice between big-endian and little-endian affects how data is read from and written to memory, so it's essential to be aware of the specific format being used in the context of TVM or any other system you are working with.

Posted 3 months ago
1 Answer
3 months ago
3 months ago