<p>I would say the RPC interface is intended mainly as an application interface, but it's also meant to be simple enough for a human to use.  And the computer cares less than you think.</p>

<p>For human users, using decimal bitcoins (rather than integer satoshis) makes life significantly easier.  For people writing software to interface with it, it makes their life only infinitesimally more complicated (you have to write maybe one extra line of code to insert and parse the decimal point).  The computer running it takes maybe a few more nanoseconds to run the code, which nobody will notice.  So on balance, it seems like more good is achieved by including the decimal point than not.</p>

CC BY-SA 3.0
2014-11-12T19:16:09.360Z
2014-11-12T19:16:09.360Z
Nate Eldredge
<p>The Bitcoin RPC calls all use 8 digit decimals ('reals') to encode amounts of satoshis. For example, if I get a transaction output, it might look like this:</p>

<pre>
{
  "value" : 0.00050000,
  "n" : 1,
  "scriptPubKey" : {
  "asm" : "OP_HASH160 c6e0b29d2aa23b6436cec99e65dfeed2c64a2cad OP_EQUAL",
  "hex" : "a914c6e0b29d2aa23b6436cec99e65dfeed2c64a2cad87",
  "reqSigs" : 1,
  "type" : "scripthash",
  "addresses" : [
    "3KpatoAjz3H5huJJieSpH4j7qFUeTXMnFC"
  ]
}
</pre>

<p>Is there a reason the developers decided to work with "0.00050000" instead of just "50000"? A whole number seems like it would be better for computers to work with.</p>

<p><hr/>
EDIT: I guess the other half of this is that if the RPC calls are being used by a person, then it is easier to use with amounts in decimals (a human can tell the difference between 5.5 and 0.55 a lot easier than 55000000 and 5500000). So I guess the real question is, is the RPC interface meant to be used more for human command line use or for coding applications' use?</p>

<json-rpc><satoshi><divisibility>
Why do the Bitcoin RPC Calls use decimals for coin amounts?
morsecoder
# Why do the Bitcoin RPC Calls use decimals for coin amounts?

(Asked by: username_0 on 2014-11-11)

The Bitcoin RPC calls all use 8 digit decimals ('reals') to encode amounts of satoshis. For example, if I get a transaction output, it might look like this:

```

{
  "value" : 0.00050000,
  "n" : 1,
  "scriptPubKey" : {
  "asm" : "OP_HASH160 c6e0b29d2aa23b6436cec99e65dfeed2c64a2cad OP_EQUAL",
  "hex" : "a914c6e0b29d2aa23b6436cec99e65dfeed2c64a2cad87",
  "reqSigs" : 1,
  "type" : "scripthash",
  "addresses" : [
    "3KpatoAjz3H5huJJieSpH4j7qFUeTXMnFC"
  ]
}

```

Is there a reason the developers decided to work with "0.00050000" instead of just "50000"? A whole number seems like it would be better for computers to work with.

---

EDIT: I guess the other half of this is that if the RPC calls are being used by a person, then it is easier to use with amounts in decimals (a human can tell the difference between 5.5 and 0.55 a lot easier than 55000000 and 5500000). So I guess the real question is, is the RPC interface meant to be used more for human command line use or for coding applications' use?

**Tags:** json-rpc, satoshi, divisibility


---

## 1 answers

### Answer by username_1 on 2014-11-12. Score: 3 | Accepted answer

I would say the RPC interface is intended mainly as an application interface, but it's also meant to be simple enough for a human to use. And the computer cares less than you think.

For human users, using decimal bitcoins (rather than integer satoshis) makes life significantly easier. For people writing software to interface with it, it makes their life only infinitesimally more complicated (you have to write maybe one extra line of code to insert and parse the decimal point). The computer running it takes maybe a few more nanoseconds to run the code, which nobody will notice. So on balance, it seems like more good is achieved by including the decimal point than not.


---

