Jump to content

Backend of Cryptocoins


Ianf

Recommended Posts

The subject of how cryptocoins work puzzles me. 

An example is when a new bitcoin is mined does it have a unique serial number? 

When you buy bitcoins say 0.035 how does the system which bitcoin that came from? Or doesn't that matter.

Are the blocks only used recording of transactions rather than what happens to each bitcoin?

This is quite a ramble I trying to get my mind around this and not getting any answers from googling.

Link to comment
Share on other sites

Cryptocurrency is an encrypted decentralized digital currency transferred between peers and confirmed in a public ledger via a process known as mining.

 

Below, we take a simplified look at how cryptocurrencies like bitcoin work. First, let’s review the basics and essentials of cryptocurrency, and then we will do an overview of the other properties that have made cryptocurrency what it is today.

 

[video=youtube]

 

The Cryptocurrency Basics

 

In order to understand how cryptocurrency works, you’ll need to understand a few basic concepts. Specifically:

 

Public Ledgers: All confirmed transactions from the start of a cryptocurrency’s creation are stored in a public ledger. The identities of the coin owners are encrypted, and the system uses other cryptographic techniques to ensure the legitimacy of record keeping. The ledger ensures that corresponding “digital wallets” can calculate an accurate spendable balance. Also, new transactions can be checked to ensure that each transaction uses only coins currently owned by the spender. Bitcoin calls this public ledger a “transaction block chain“.

 

Transactions: A transfer of funds between two digital wallets is called a transaction. That transaction gets submitted to a public ledger and awaits confirmation. When a transaction is made, wallets use an encrypted electronic signature (an encrypted piece of data called a cryptographic signature) to provide a mathematical proof that the transaction is coming from the owner of the wallet. The confirmation process takes a bit of time (ten minutes for bitcoin) while “miners” mine (ie. confirm transactions and add them to the public ledger).

 

Mining: In simple terms, mining is the process of confirming transactions and adding them to a public ledger. In order to add a transaction to the ledger, the “miner” must solve an increasingly-complex computational problem (sort of like a mathematical puzzle). Mining is open source, so anyone can confirm the transaction. The first “miner” to solve the puzzle adds a “block” of transactions to the ledger. The way in which transactions, blocks, and the public blockchain ledger work together ensures that no one individual can easily add or change a block at will. Once a block is added to the ledger, all correlating transactions are permanent and a small transaction fee is added to the miner’s wallet (along with newly created coins). The mining process is what gives value to the coins and is known as a proof-of-work system.

 

[video=youtube]

 

The Anatomy of Cryptocurrency

 

 

Although there can be exceptions to the rule, there are a number of factors (beyond the basics above) that make cryptocurrency so different from the financial systems of the past:

 

Adaptive Scaling: Adaptive scaling essentially means that cryptocurrencies are built with a number of measures to ensure that they will work well in both large or small scales.

 

Adaptive Scaling Example: Bitcoin is programmed to allow for one transaction block to be mined every ten minutes. The algorithm adjusts after every 2016 blocks (theoretically, that’s every two weeks) to get easier or harder based on how long it actually took for those 2016 blocks to be mined. So if it only took 13 days for the network to mine 2016 blocks, that means it’s too easy to mine, so the difficulty increases. However, if it takes 15 days for the network to mine 2016 blocks, that shows that it’s too hard to mind, so the difficulty decreases.

 

A number of other measures are included in digital coins to allow for adaptive scaling including limiting the supply overtime (to create scarcity) and reducing the reward for mining as more total coins are mined.

 

Cryptographic: Cryptocurrency uses a system of cryptography (AKA encryption) to control the creation of coins and to verify transactions.

 

Decentralized: Most currencies in circulation are controlled by a centralized government, and thus their creation can be regulated by a third party. Cryptocurrency’s creation and transactions are open source, controlled by code, and rely on “peer-to-peer” networks. There is no single entity that can affect the currency.

 

Digital: Traditional currency is defined by a physical object (USD representing gold for example), but cryptocurrency is all digital. Digital coins are stored in digital wallets and transferred digitally to other peoples’ digital wallets. No physical object ever exists.

 

[video=youtube]

 

Open Source: Cryptocurrencies are typically open source. That means that developers can create APIs without paying a fee and anyone can use or join the network.

 

Proof-of-work: Most cryptocurrencies use a proof-of-work system. A proof-of-work scheme uses a hard-to-compute but easy-to-verify computational puzzle to limit exploitation of cryptocurrency mining. Essentially, it’s like a really hard to solve “catpcha” that requires lots of computing power.

 

Pseudonymity: Owners of cryptocurrency keep their digital coins in an encrypted digital wallet. A coin-holder’s identification is stored in an encrypted address that they have control over – it is not attached to a person’s identity. The connection between you and your coins is pseudonymous rather than anonymous as ledgers are open to the public (and thus, the ledgers could be used to glean information about groups of individuals in the network).

 

Value: For something to be an effective currency, it has to have value. The US dollar used to represent actual gold. The gold was scarce and required work to mine and refine, so the scarcity and work gave the gold value. This, in turn, gave the US dollar value.

 

Cryptocurrency works with a similar concept. In cryptocurrency, “coins” (which are nothing more than publicly agreed on records of ownership) are generated or produced by “miners”. These miners are people who run programs on specialized hardware made specifically to solve proof-of-work puzzles. The work behind mining coins gives them value, while scarcity of coins and demand thereof causes their value to fluctuate. The idea of work giving value to currency is called a “proof-of-work” system. The other method for validating coins is called proof-of-stake. Value is also created when transactions are added to public ledgers as creating a verified “transaction block” takes work as well.

 

[video=youtube]

 

All of this is from google, I copied it.

Link to comment
Share on other sites

Thanks James,

Being trying to read a bit more, but still I struggle.

I think that a bitcoin doesn't have a unique number and is just added to a wallet when created, what is encrypted is the wallet and transaction which is then locked down each time a block is completed.

How is the total of bitcoins checked? It just seems that transactions are checked and agreed upon then locked, who checks and how is the total bitcoins issued checked? Or is it controlled only at issue?

Link to comment
Share on other sites

Thanks James,

Being trying to read a bit more, but still I struggle.

I think that a bitcoin doesn't have a unique number and is just added to a wallet when created, what is encrypted is the wallet and transaction which is then locked down each time a block is completed.

How is the total of bitcoins checked? It just seems that transactions are checked and agreed upon  then locked, who checks and how is the total bitcoins issued checked? Or is it controlled only at issue?

 

@BitcoinZAR I have the same questions :)

Link to comment
Share on other sites

How Bitcoins works; from the beginning:

 

1. Bitcoins are first created when they are mined by solving a block. The first transaction in the block is basically you saying "I'm giving myself 50 Bitcoins to my address A" (plus transaction fees from the block).

 

2. When you want to spend Bitcoins, you have to point to one or more transactions that show where you got them from, and say how many Bitcoins you are transferring where. It's like saying "I got Bitcoins at transaction X. I'm sending 20 coins to address B."

 

3. The point is that more often than not you don't want to send all the coins you got from the transaction, so you also specify how much change you are sending to another address, usually controlled by yourself: "I got Bitcoins at transaction X. I'm sending 20 coins to address B and 30 coins to address A."

 

4. Since all of the above is cryptographically signed, one can be sure nobody can spend coins they don't have (spending more than they have, spending someone else's coins, etc).

 

5. To make sure nobody is cheating, everyone is looking at everyone's hands by checking each transaction that comes their way. If you cheat, your transaction does not get forwarded.

 

That explains the concept of how Bitcoin works.

 

Just to be clear:

 

"Does each bitcoin have a unique identifier, like currency notes have serial numbers?"

 

Not like currency (that each bill has a serial number and you can't break them apart), more like bank statements (the identifier identifies the transaction on a certain amount of Bitcoins), but that's still a simplification.

 

"If so, could you trace a particular bitcoin's ownership chain (ie. find the current owner of a particular bitcoin by its identifier)?"

 

You can trace the history of transactions on the set of Bitcoins up to who mined them, but not on a particular 1BTC.

Join the official JSE Discord Channel

Link to comment
Share on other sites

There is actually no such thing as a bitcoin - there are only transactions, which are denominated in bitcoins. Those transactions do have a history and that history can be complex.

 

It's and abstract idea imo. Since some bitcoins can be traced back to certain transactions and others can not you might actually find that some bitcoins are worth more than others depending on what transaction they where a part of remember when that guy bought a pizza with bitcoin well someone bought that particle bitcoin for 2 bitcoins.

 

It's amazing, it seems a bitcoin is a bitcoin is not true. Some are more valuable than others.

 

Saw something in another thread about how newly mined "pure" bitcoins with no transaction history can have a premium over other bitcoins due to their potential non-traceability.

 

Here we had someone valuing certain bitcoins more than others due to their transaction history.

Join the official JSE Discord Channel

Link to comment
Share on other sites

Spreadsheet ranger

Thanks for explaining , so the blockchain is one massive ledger with more bitcoins added by mining.

But how do bitcoiners know what the total number of bitcoins issued are and is there check against the bitcoins issued vs. the total of bitcoins in the ledger?

Link to comment
Share on other sites

Spreadsheet ranger

Thanks for explaining , so the blockchain is one massive ledger with more bitcoins added by mining.

But how do bitcoiners know what the total number of bitcoins issued are and is there check against the bitcoins issued vs. the total of bitcoins in the ledger?

 

Bitcoin is defined by a protocol.

 

  1. There are 21 million bitcoins that can be mined total, ever. This is by design.
     
  2. Every transaction that happens is stored indefinitely by the blockchain. The blockchain is where the trust that who says they own a bitcoin owns it comes from, and the basis of this trust is somewhat two fold. (Side note: This also means if a wallet is ever definitively linked to someone, there is a permanent record of their transactions)
     
  3. The blockchain is generated using hashing functions (By definition, a good hashing function is irreversible by anything other than brute force), and part of the input to the hashing function is the last thing prior to it in the chain. This means to forge 1 record, you would have to succesfully forge the entire blockchain.
     
  4. you can't forge the entire blockchain as everyone has a copy of what already exists. A theoretical 51% attack on the blockchain is also partially mitigated by having historical blocks every so often, so the damage someone with it is partially minimized here.
     
  5. Because everyone has a record of it, anyone can look at the blockchain to see how many have been mined.
     
  6. Using that number alone however does not account for any bitcoins that may be permanently lost. (Data loss making them inaccessible, forgotten wallet paswords, etc.)
     

When a block of bitcoins is mined, everyone else knows about it at some point soon after through the block chain when a luno/coinbase/walltername transaction happens. 

 

From all of this, you can find the number of bitcoins that have been mined so far by looking at the blockchain and totaling the amount that have been mined so far. There are several websites that can do this for you. Many of these are full blockchain explorers, others may just give you general data regarding the current state of the chain.

 

Example - The total number of bitcoins that have already been mined; in other words, the current supply of bitcoins on the network. https://blockchain.info/charts/total-bitcoins?timespan=all

 

You can also do this manually if you want. https://en.bitcoin.it/wiki/Transaction However it's not worth it.

Join the official JSE Discord Channel

Link to comment
Share on other sites

I found a forum that seem to be clued up on the blockchain. A topic was started by me on this. https://bitcointalk.org/index.php?topic=1926096.msg19111936#msg19111936

It seems that there is no totals checked on the blockchain. What was interesting was the mechanism of creating the miners fee in the block.

It is a struggle for me to understand new things. ;)

 

Yea that pretty much echoes what Ranger explained.

 

To add to that since I saw you asked about counterfeit bitcoins. There is no such thing as a "bitcoin" that can be copied. Rather, there is a list of all the transactions that have taken place on the bitcoin network and the order they have taken place. Every client has a copy of this list or theoretically have access to this list if they're a thin client...

 

Essentially, the only way to counterfeit bitcoins would be to spend them in more than one place. This is called a double-spend attack. However, because of the design of the bitcoin blockchain (the list of all the transactions) and the way that list is secured by mining, this requires a tremendous amount of computer power. You can read about this here: Double_spending

 

 

Link to comment
Share on other sites

I found a forum that seem to be clued up on the blockchain. A topic was started by me on this. https://bitcointalk.org/index.php?topic=1926096.msg19111936#msg19111936

It seems that there is no totals checked on the blockchain. What was interesting was the mechanism of creating the miners fee in the block.

It is a struggle for me to understand new things. ;)

 

If you want to make a transaction "today" you need to add a non-trivial fee. The "No fees" claim when bitcoin started became "low fees" a while back, and has now vanished completely with luno adding dynamic fees to cover costs. Once the block reward goes away entirely there's suddenly a lot more that fees need to cover, and they will need to be quite large.

 

Which is why I got out of bitcoin. Interesting experiment, not ready to replace the world's financial systems.

Join the official JSE Discord Channel

Link to comment
Share on other sites

This seems to answer my questions

 

Quick answers to your doubts:

 

1.) The total amount is always tally;

2.) No bitcoin is lost between transactions; and

3.) No counterfeit bitcoin exist.

 

The only "way" to destroy circulating bitcoin is by sending them to the unspent-able so-called BitcoinEater addresses which were generated without private keys.

 

I will keep on looking to see how total amount always tally.

Link to comment
Share on other sites

Hi Guys 

I got a comprehensive reply.

You can check out the whole reply in the link I posted above.

 

 

You can see here that there are currently 51,045,935 transaction outputs, and that the sum of the values of those outputs is 16,342,861.10771819 BTC

 

Considering:


  •  
  • We are currently at block height 467441
     
  • The first 210,000 blocks had a subsidy of 50 BTC
     
  • The next 210,000 blocks had a subsidy of 25 BTC
     
  • The remaining 47,441 blocks had a subsidy of 12.5 BTC

The total bitcoin value of all outputs (if OP_RETURN wasn't subtracted and miners didn't fail to pay themselves their maximum allowable reward) should be:

(210,000 X 50) + (210,000 X 25) + (47,441 X 12.5) = 16,343,012.5

 

This theoretical total minus the actual total (where OP_RETURN outputs are subtracted) is:

16,343,012.5 - 16,342,861.10771819 = 151.39228181

 

OP_RETURN is intended to be used when intentionally creating an unspendable output, but there are other outputs that are provably unspendable. Bitcoin Core keeps these other provably unspendable outputs in its UTXO. There have been several efforts to analyze the ledger and find ALL provably unspendable outputs.  Here's an analysis that was completed in July 2014:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...