1

With regards to the monero Genesis TX breakdown. I'm still puzzled as to how they got the Decimal number (17592186044415) = (ffffffffffff03) in the genesis block.

Does one simply use a Hex to Decimal converter ? What conversion is used ? I thought it was a hexadecimal number but I don't get the correct one when converting ffffffffffff03.

2

The encoding of a varint is answered in this comment. It's not a straight hex string to decimal conversion.

From the specification:

Varints are a method of serializing integers using one or more bytes. Smaller numbers take a smaller number of bytes.

Each byte in a varint, except the last byte, has the most significant bit (msb) set – this indicates that there are further bytes to come. The lower 7 bits of each byte are used to store the two's complement representation of the number in groups of 7 bits, least significant group first.

Therefore, you first drop the MSB of each 8 bit group then reverse the order of the remaining 7 bit groups (because varints store numbers with the least significant group first).

So in the case of FFFFFFFFFFFF03:

FFFFFFFFFFFF03 = 11111111111111111111111111111111111111111111111100000011
converts to
0000011111111111111111111111111111111111111111111
which is
17592186044415
  • Thanks a million, this did help me. Sorry for responding late – Wesley Jun 25 '18 at 22:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.