<p>Within the Bitcoin protocol, each Bitcoin is represented as 100000000 satoshis. Therefore, you can divide bitcoin up with a precision of 0.00000001.</p>

<p>In a transaction, the number of satoshis being delivered to each output is recorded, along with a record of which previous output is being spent.</p>

<p>The fee is then derived from <code>sum(Inputs) - sum(Outputs)</code>. The actual representation of the amount itself is encoded using the <a href="https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer" rel="nofollow noreferrer">Variable Length Integer representation</a></p>

CC BY-SA 4.0
2019-09-25T03:34:40.017Z
2019-09-25T03:34:40.017Z
Raghav Sood
<blockquote>
  <p><strong>How is the monetary aspect of a bitcoin stored?</strong></p>
</blockquote>

<p>There is no such thing as a Bitcoin in normal Bitcoin usage. Bitcoin is a currency but it does not have the equivalent of a physical coin that passes around. Bitcoin is really a unit of measure not a coin or anything much like a coin.</p>

<p>Where the monetary aspect is stored depends on where you look.</p>

<p>Bitcoin full nodes such as the Bitcoin-core wallet, send and receive data to other nodes that are primarily blocks of the blockchain. Every full-node maintains its own copy of the blockchain. As you know, the blockchain is simply a list of transactions and the information about a transaction is only a list of input amounts and a list of output amounts. Each amount being associated with a script that usually contains a Bitcoin-address which is almost always under the control of some unidentified person.</p>

<p>As you know, to work out the total unspent amount of money currently associated with an address you can look through the whole blockchain, add an amount everytime that address appears in an output and subtract an amount every time that address appears in an input.</p>

<p>Since people nowadays use a new address for every transaction, to calculate a total for a person you'd have to know a list of addresses under the control of that person. That information is not in the blockchain data but is stored in the person's wallet (and not shared with anyone else).</p>

<p>A wallet could choose to have a file that contains the person's name, or an account-number and the number representing the total amount of money controlled by that person or account. But whether or how wallets do this and how they store this data is not really part of any Bitcoin definition or specification. Each wallet could choose to do this or not and to do it in a unique way.</p>

CC BY-SA 4.0
2019-09-25T08:57:29.993Z
2019-09-25T08:57:29.993Z
RedGrittyBrick
<p>You have to divide this question into two parts. Your confusion arises from the fact that there is no <strong>account</strong> per person like a bankaccount.</p>

<p><strong>1 - If there is no account where does the knowledge of who owns how many bitcoin comes from?</strong></p>

<p>The blockchain contains of information about amounts of bitcoins that have been sent to <strong>addresses</strong>. So, it <em>knows</em> how many bitcoin each address <em>owns</em> and <em>spent</em> in the sense that each transaction contains an address and an amount of bitcoins. </p>

<p>Someone interested in how many bitcoin a certain receiver owns has to add and substract all those amounts from those transactions for a certain address and do this for a set of addresses that <em>belong</em> to a certain receiver.</p>

<p><strong>2 - How much is a bitcoin worth?</strong></p>

<p>This depends on the <strong>exchange rate</strong> of bitcoin to other things. The exchange to dollars happens on bitcoin exchanges and is derived from supply and demand of dollars and bitcoins there.</p>

CC BY-SA 4.0
2019-09-25T20:48:28.710Z
The concept of "how many BTC an address has" is still an abstraction provided by block explorers and some wallets; it does not exist at the protocol level.
Pieter Wuille
CC BY-SA 4.0
2019-09-26T04:08:32.533Z
@Pieter Wuille yes, i meant in the sense of knowledge in the chain. it is there in a raw form, it has just to be computed from it.
bomben
CC BY-SA 4.0
2019-09-28T11:36:35.343Z
@PieterWuille Can you share link with good (preferably easy) explanation of the concept at the protocol level?
baysx
CC BY-SA 4.0
2019-10-05T06:19:24.850Z
@baysx https://bitcoin.org/en/blockchain-guide#term-utxo and https://en.bitcoin.it/wiki/Script
Pieter Wuille
CC BY-SA 4.0
2019-09-25T18:33:26.080Z
2019-09-28T16:05:31.823Z
2019-09-28T16:05:31.823Z
bomben
<p>How is the monetary aspect of a bitcoin stored? 
I understand that the blockchain is a set of records documenting transactions. I've also seen that blockchains in general can store arbitrary information (such as contracts, small notes, etc).</p>

<p>What I don't understand is how monetary values are recorded, exchanged, and divided.</p>

<p>Is a literal number value encrypted into the transaction? Or is it something more abstract? </p>

CC BY-SA 4.0
2019-09-28T22:20:38.497Z
related: https://bitcoin.stackexchange.com/q/1600/5406
Murch
<blockchain><utxo><balance><money-supply>
How is the monetary part of bitcoin stored?
Leo Blanchette
# How is the monetary part of bitcoin stored?

(Asked by: username_0 on 2019-09-25)

How is the monetary aspect of a bitcoin stored?
I understand that the blockchain is a set of records documenting transactions. I've also seen that blockchains in general can store arbitrary information (such as contracts, small notes, etc).

What I don't understand is how monetary values are recorded, exchanged, and divided.

Is a literal number value encrypted into the transaction? Or is it something more abstract?

**Tags:** blockchain, utxo, balance, money-supply

> **Comments:**
> **username_1**: related: https://bitcoin.stackexchange.com/q/1600/5406  

---

## 3 answers

### Answer by username_2 on 2019-09-25. Score: 1

Within the Bitcoin protocol, each Bitcoin is represented as 100000000 satoshis. Therefore, you can divide bitcoin up with a precision of 0.00000001.

In a transaction, the number of satoshis being delivered to each output is recorded, along with a record of which previous output is being spent.

The fee is then derived from `sum(Inputs) - sum(Outputs)`. The actual representation of the amount itself is encoded using the [Variable Length Integer representation](https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer)


---

### Answer by username_3 on 2019-09-25. Score: 0

> **How is the monetary aspect of a bitcoin stored?**

There is no such thing as a Bitcoin in normal Bitcoin usage. Bitcoin is a currency but it does not have the equivalent of a physical coin that passes around. Bitcoin is really a unit of measure not a coin or anything much like a coin.

Where the monetary aspect is stored depends on where you look.

Bitcoin full nodes such as the Bitcoin-core wallet, send and receive data to other nodes that are primarily blocks of the blockchain. Every full-node maintains its own copy of the blockchain. As you know, the blockchain is simply a list of transactions and the information about a transaction is only a list of input amounts and a list of output amounts. Each amount being associated with a script that usually contains a Bitcoin-address which is almost always under the control of some unidentified person.

As you know, to work out the total unspent amount of money currently associated with an address you can look through the whole blockchain, add an amount everytime that address appears in an output and subtract an amount every time that address appears in an input.

Since people nowadays use a new address for every transaction, to calculate a total for a person you'd have to know a list of addresses under the control of that person. That information is not in the blockchain data but is stored in the person's wallet (and not shared with anyone else).

A wallet could choose to have a file that contains the person's name, or an account-number and the number representing the total amount of money controlled by that person or account. But whether or how wallets do this and how they store this data is not really part of any Bitcoin definition or specification. Each wallet could choose to do this or not and to do it in a unique way.


---

### Answer by username_4 on 2019-09-25. Score: 0

You have to divide this question into two parts. Your confusion arises from the fact that there is no **account** per person like a bankaccount.

**1 - If there is no account where does the knowledge of who owns how many bitcoin comes from?**

The blockchain contains of information about amounts of bitcoins that have been sent to **addresses**. So, it *knows* how many bitcoin each address *owns* and *spent* in the sense that each transaction contains an address and an amount of bitcoins.

Someone interested in how many bitcoin a certain receiver owns has to add and substract all those amounts from those transactions for a certain address and do this for a set of addresses that *belong* to a certain receiver.

**2 - How much is a bitcoin worth?**

This depends on the **exchange rate** of bitcoin to other things. The exchange to dollars happens on bitcoin exchanges and is derived from supply and demand of dollars and bitcoins there.

> **Comments:**
> **username_5**: The concept of "how many BTC an address has" is still an abstraction provided by block explorers and some wallets; it does not exist at the protocol level.  
> **username_4**: @username_5 yes, i meant in the sense of knowledge in the chain. it is there in a raw form, it has just to be computed from it.  
> **username_6**: @username_5 Can you share link with good (preferably easy) explanation of the concept at the protocol level?  
> **username_5**: @username_6 https://bitcoin.org/en/blockchain-guide#term-utxo and https://en.bitcoin.it/wiki/Script  

---

