<p>As Gracchus said, Bitcoin internally uses 64bit integers. Bitcoin's JSON interface on the other hand uses doubles, which give only 52 bit precision. Both types are big enough for bitcoin (double only for data exchange, the precision of doubles is not enough for actual calculations).</p>

<p>In the specific case of Dogecoin, the precision of the JSON interface (and parts of the GUI) is a known problem which we hope to fix in the future. Handling values in the range of hundreeds of million of dogecoin suffers from this currently.</p>

<p>The internally used 64bit integers are also a problem for Dogecoin which is being tracked. This is mostly a problem if anyone ever accumulates at leastn 2^64 Koinu (Satoshi) in a single wallet. This problem should be limited to the wallet, on the protocol level the size of transactions is limited to 10 billion doge.</p>

<p>I don't know how other coins handle this. There's at least one coin out there which supports arbitrary precision, but I forgot its name.</p>

CC BY-SA 3.0
2014-05-15T03:47:35.610Z
@Gracchus Floats are the textbook no-nos. Doubles less so. They appear to have 15 significant digits of precision, so unless you have 10^7 coins, you are still right down to a satoshi.
ThePiachu
CC BY-SA 3.0
2014-05-15T16:14:21.297Z
Doubles are unusable as an internal format for Bitcoins (precision loss due to operations), but they are just big enough to convert a number in Satoshis into an number in BTC or the other way around. They are convienient enough to be "abused" for that by Bitcoin Core.
Jannis Froese
CC BY-SA 3.0
2014-05-14T23:19:52.033Z
2014-05-14T23:19:52.033Z
Jannis Froese
<p>I am currently working with a number of altcoins and and I need to support deposits and withdrawals in currencies with very large coin number cap like Dogecoin. I am wondering whether the Bitcoin Core client that is the basis for such altcoin clients supports such high denomination currencies internally and in its API (for example, when calling <code>getbalance</code> can it display balances of 10^12 coins with a precision of 1 satoshi?), or is there a limit to the precision used?</p>

<bitcoin-core><development><api><dogecoin><money-supply>
Does the Bitcoin Core API support high-precision balance display?
ThePiachu
# Does the Bitcoin Core API support high-precision balance display?

(Asked by: username_0 on 2014-05-14)

I am currently working with a number of altcoins and and I need to support deposits and withdrawals in currencies with very large coin number cap like Dogecoin. I am wondering whether the Bitcoin Core client that is the basis for such altcoin clients supports such high denomination currencies internally and in its API (for example, when calling `getbalance` can it display balances of 10^12 coins with a precision of 1 satoshi?), or is there a limit to the precision used?

**Tags:** bitcoin-core, development, api, dogecoin, money-supply


---

## 1 answers

### Answer by username_1 on 2014-05-14. Score: 2 | Accepted answer

As Gracchus said, Bitcoin internally uses 64bit integers. Bitcoin's JSON interface on the other hand uses doubles, which give only 52 bit precision. Both types are big enough for bitcoin (double only for data exchange, the precision of doubles is not enough for actual calculations).

In the specific case of Dogecoin, the precision of the JSON interface (and parts of the GUI) is a known problem which we hope to fix in the future. Handling values in the range of hundreeds of million of dogecoin suffers from this currently.

The internally used 64bit integers are also a problem for Dogecoin which is being tracked. This is mostly a problem if anyone ever accumulates at leastn 2^64 Koinu (Satoshi) in a single wallet. This problem should be limited to the wallet, on the protocol level the size of transactions is limited to 10 billion doge.

I don't know how other coins handle this. There's at least one coin out there which supports arbitrary precision, but I forgot its name.

> **Comments:**
> **username_0**: @Gracchus Floats are the textbook no-nos. Doubles less so. They appear to have 15 significant digits of precision, so unless you have 10^7 coins, you are still right down to a satoshi.  
> **username_1**: Doubles are unusable as an internal format for Bitcoins (precision loss due to operations), but they are just big enough to convert a number in Satoshis into an number in BTC or the other way around. They are convienient enough to be "abused" for that by Bitcoin Core.  

---

