I need to track an amount of Bitcoins in a database. Is a UINT64 sufficient?

I'd rather not deal with floating point types, and the rounding errors they end with.

  • 1
    The title is catchy but nonsensical. I am guessing you are trying to keep track of an amount of bitcoins (e.g. BTC 3.01329) but that is not clear from your wording Aug 12, 2014 at 21:44
  • @NateEldredge it's tagged development, yes.. I want to know that the max value in a Tx is defined to be 64 bits. I made it clearer Aug 12, 2014 at 21:47

1 Answer 1


yes, UINT64 is sufficient, which is in fact how the Bitcoin protocol works internally. The conversion factor from UINT64 to BTC is 1.0e8.

Not using floating point numbers is a very good idea indeed.

Your Answer

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

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