Big and Bigger

Within the AO protocol, all counted things are represented by integers or rational fractions aka the ratio of two integers. Internally, these integers are represented by 64 bit signed integers, or when that's not big enough, by arbitrarily large integers handled by the GMP library.

Floating point numbers may be used in user interface representations of rational fractions, but calculations are performed to obtain exact results which can be duplicated on a wide variety of hardware and software which may be cross checking the calculations.
*Originally, 128 bit integers were considered for the larger numbers, but even those are too small for some reasonable applications, and they are also problematic when porting to various computer architectures - the GMP library, while cumbersome, is more portable than __int128.


Both 64 bit integers and GMP integers are stored in key-value form where a 63 bit key
*stored as variable byte code
preceeds the data
*In arrays, a single key preceeds a count of how many values are in the array followed by all the values in the array.
, with the data format indicated by the key value: 64 bit integers are stored as 8 byte signed quantities, while 63 bit unsigned integers are stored using variable byte code, GMP integers and fractions use a different
*Binary Coded Decimal


Time is expressed in Unix Time encoded in a signed 64 bit integer, with the milliseconds multiplied by 1,000.
*this encoding places the storage value rollover event approximately 280,000 years in the future.
The millisecond divisions are used to ensure that events generated on a single server are given a strictly increasing sequence in time - while events coming from multiple sources may be recorded as simultaneous, no two events recorded by a single actor may be marked as simultaneous.
*Regarding leap second concerns the only rule for AO protocol is that events must be sequential in represented time. One might condsider a leap second to be a brief trading halt, or if one must trade during the leap second, the software must simply assure monotonically increasing time numbers for all time records.
It is expected that actual clock times accurate to the millisecond will be used, and for events which are generated in the same millisecond of clock time, their timestamps will be adjusted to place them in proper sequence when considering the smaller divisions of time. When time values are stored, they are stored as straight 8 byte big endian storage of the integer.