0

I am new to LevelDB and the way BTC keeps everything in the database. I went through article How does Bitcoin read from/write to LevelDB but was not able to get to the first step -

Transaction

246c5a81b6ad0dfc0dbc0b2ff5bde65ee1913f75a47d409b8ff8074a27ec1000

is identified in the LevelDB by:

c0010ec274a07f88f9b407da4753f91e15ee6bdf52f0bbc0dfc0dadb6815a6c24

How does the first string translates back to c0010ec274a07f88f9b407da4753f91e15ee6bdf52f0bbc0dfc0dadb6815a6c24? I understand the first character is c but what calculation makes the second string?

I am using .Net Core to read level DB using LevelDB.Standard nuget package (Assembly LevelDB.NET, Version=2.1.6.0)

1 Answer 1

1

The two strings are the same, but with the bytes (hex digit pairs) in reversed order (with an extra c at the beginning). The first string starts with 24 6c 5a ... and the second string ends with ... 5a 6c 24.

It looks like an endianness flip to me (network order is big-endian, but your machine is presumably using little-endian order). I don't know what the meaning of the extra c is.

1
  • 1
    The 'c' simply stands for "coin", FWIW; it distinguishes it from a few meta records in the database that are not UTXOs. Apr 24, 2021 at 0:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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