<p>these questions would justify a whole section of a book. To avoid this, I put a link at the end of the message. In between, I'll try to answer some parts of your question.</p>

<blockquote>
  <p>I've gone through dozens of videos and texts, but haven't found
  properly how is the actual bitcoin itself represented technically or
  at code level?</p>
</blockquote>

<p>That is a known problem with all these videos. It is not sufficient :-)
The bitcoin is represented as data in the blockchain. Effectivly, a transaction moves bitcoins around, taking transaction from an address, sending it to a new address. When you take a look at some bitcoin explorers, they provide details, e.g. <a href="https://blockchain.info/rawtx/9b564bffe6dd1bdfd8469c73cc02a8d77dca8b76b227dd585f3d0b83a9bdecd5" rel="nofollow noreferrer">here as an example</a>. To answer your question, you'd need to understand the details presented in this transaction. In short: you'll discover 2 inputs and 4 outputs. This is, what moves the Bitcoins (or Satoshis). Many transactions can then be combined into a block, which then create the blockchain. </p>

<blockquote>
  <p>From what I have understood thus-so-far (if correct), is that a single
  bitcoin itself is NOT represented by any class/object at code level
  (or technically NOT represented by a unique ID like fiat money has
  printed on it),</p>
</blockquote>

<p>yes, I mean, no serial number on it. But programming wise (there are dozens of implementations), you could think of a class "bitcoin". The default core code has no such thing, <a href="https://github.com/bitcoin/bitcoin/tree/master/src" rel="nofollow noreferrer">code reference is here</a>.</p>

<blockquote>
  <p>but rather bitcoin is ONLY a figure that's stored in a distributed
  ledger (blockchain).</p>
</blockquote>

<p>yes</p>

<blockquote>
  <p>And that the creation of a 'new' bitcoin is out of thin air</p>
</blockquote>

<p>well, thin air is often a repeated idea, which sounds like discrediting distinction to the FIAT world. But effectivly you have to do some work ("mining"), which costs a lot. So thin air is probably wrong.</p>

<blockquote>
  <p>as a reward for verifying transactions together with proof-of-work 
  (i.e. solving a math problem in order to delay the broadcast of 
  verificationof transactions) for security purposes (and thus NOT as 
  some put it to discover new bitcoins - as no bitcoin has a permanent 
  unique ID to be discovered).</p>
</blockquote>

<p>somehow - please read chapter 10 of the refenced book :-)</p>

<blockquote>
  <p>to please explain how bitcoin itself is represented either technically </p>
</blockquote>

<p>Yup: here is Andreas wonderful <a href="http://chimera.labs.oreilly.com/books/1234000001802/index.html" rel="nofollow noreferrer">book "Mastering Bitcoin"</a>, which has lots of examples relevant for developers. 
My proposal to you: start to evaluate transactions in detail (Chapter 6), and work over into wallets and keys. This gives you the picture within 2-3 hours. And then you probably get the idea. Otherwise you extend your question here, or raise a new question :-)</p>

CC BY-SA 3.0
2018-03-06T13:28:29.270Z
Thank you very much for your directions.  I really do appreciate it.  I found the info I am looking for both in your answers and also in the book that you that you have recommended 'Mastering Bitcoin'.  I thought to read the book first prior to making a comment.
Cem R.
CC BY-SA 3.0
2018-03-05T13:19:38.700Z
2018-03-05T13:19:38.700Z
pebwindkraft
<p>Closest analogue of Bitcoins, i.e what you intuitively imagine as the coins, are the sums (face values) inside unspent transaction outputs (UTXO), or the unspent transaction outputs (UTXO) themselves.</p>

CC BY-SA 4.0
2022-07-11T17:33:13.837Z
2022-07-11T17:33:13.837Z
Hugo Franklin
<p>I've gone through dozens of videos and texts, but haven't found properly how is the actual bitcoin itself represented technically or at code level?  </p>

<p>From what I have understood thus-so-far (if correct), is that a single bitcoin itself is NOT represented by any class/object at code level (or technically NOT represented by a unique ID like fiat money has printed on it), but rather bitcoin is ONLY a figure that's stored in a distributed ledger (blockchain).  And that the creation of a 'new' bitcoin is out of thin air as a reward for verifying transactions together with proof-of-work (i.e. solving a math problem in order to delay the broadcast of verification of transactions) for security purposes (and thus NOT as some put it to discover new bitcoins - as no bitcoin has a permanent unique ID to be discovered).</p>

<p>Is there a bitcoin expert or bitcoin developer that could verify (and possibly add more info) if my understanding is correct, and if not, to please explain how bitcoin itself is represented either technically or at code level (and it will help me understand more clearly if you could also explain the technically process of the creation - or the so-called discovery) of 'new' bitcoins in a way that's related to this question)?</p>

<p>Thanks.</p>

<bitcoin-core><bitcoin-core-development>
How is Bitcoin itself represented (either technically or code level)
Cem R.
# How is Bitcoin itself represented (either technically or code level)

(Asked by: username_0 on 2018-03-05)

I've gone through dozens of videos and texts, but haven't found properly how is the actual bitcoin itself represented technically or at code level?

From what I have understood thus-so-far (if correct), is that a single bitcoin itself is NOT represented by any class/object at code level (or technically NOT represented by a unique ID like fiat money has printed on it), but rather bitcoin is ONLY a figure that's stored in a distributed ledger (blockchain). And that the creation of a 'new' bitcoin is out of thin air as a reward for verifying transactions together with proof-of-work (i.e. solving a math problem in order to delay the broadcast of verification of transactions) for security purposes (and thus NOT as some put it to discover new bitcoins - as no bitcoin has a permanent unique ID to be discovered).

Is there a bitcoin expert or bitcoin developer that could verify (and possibly add more info) if my understanding is correct, and if not, to please explain how bitcoin itself is represented either technically or at code level (and it will help me understand more clearly if you could also explain the technically process of the creation - or the so-called discovery) of 'new' bitcoins in a way that's related to this question)?

Thanks.

**Tags:** bitcoin-core, bitcoin-core-development


---

## 2 answers

### Answer by username_1 on 2018-03-05. Score: 1 | Accepted answer

these questions would justify a whole section of a book. To avoid this, I put a link at the end of the message. In between, I'll try to answer some parts of your question.

> I've gone through dozens of videos and texts, but haven't found
> properly how is the actual bitcoin itself represented technically or
> at code level?

That is a known problem with all these videos. It is not sufficient :-)
The bitcoin is represented as data in the blockchain. Effectivly, a transaction moves bitcoins around, taking transaction from an address, sending it to a new address. When you take a look at some bitcoin explorers, they provide details, e.g. [here as an example](https://blockchain.info/rawtx/9b564bffe6dd1bdfd8469c73cc02a8d77dca8b76b227dd585f3d0b83a9bdecd5). To answer your question, you'd need to understand the details presented in this transaction. In short: you'll discover 2 inputs and 4 outputs. This is, what moves the Bitcoins (or Satoshis). Many transactions can then be combined into a block, which then create the blockchain.

> From what I have understood thus-so-far (if correct), is that a single
> bitcoin itself is NOT represented by any class/object at code level
> (or technically NOT represented by a unique ID like fiat money has
> printed on it),

yes, I mean, no serial number on it. But programming wise (there are dozens of implementations), you could think of a class "bitcoin". The default core code has no such thing, [code reference is here](https://github.com/bitcoin/bitcoin/tree/master/src).

> but rather bitcoin is ONLY a figure that's stored in a distributed
> ledger (blockchain).

yes

> And that the creation of a 'new' bitcoin is out of thin air

well, thin air is often a repeated idea, which sounds like discrediting distinction to the FIAT world. But effectivly you have to do some work ("mining"), which costs a lot. So thin air is probably wrong.

> as a reward for verifying transactions together with proof-of-work
> (i.e. solving a math problem in order to delay the broadcast of
> verificationof transactions) for security purposes (and thus NOT as
> some put it to discover new bitcoins - as no bitcoin has a permanent
> unique ID to be discovered).

somehow - please read chapter 10 of the refenced book :-)

> to please explain how bitcoin itself is represented either technically

Yup: here is Andreas wonderful [book "Mastering Bitcoin"](http://chimera.labs.oreilly.com/books/1234000001802/index.html), which has lots of examples relevant for developers.
My proposal to you: start to evaluate transactions in detail (Chapter 6), and work over into wallets and keys. This gives you the picture within 2-3 hours. And then you probably get the idea. Otherwise you extend your question here, or raise a new question :-)

> **Comments:**
> **username_0**: Thank you very much for your directions.  I really do appreciate it.  I found the info I am looking for both in your answers and also in the book that you that you have recommended 'Mastering Bitcoin'.  I thought to read the book first prior to making a comment.  

---

### Answer by username_2 on 2022-07-11. Score: 1

Closest analogue of Bitcoins, i.e what you intuitively imagine as the coins, are the sums (face values) inside unspent transaction outputs (UTXO), or the unspent transaction outputs (UTXO) themselves.


---

