Author

Topic: Kapyong's Introduction to Bitcoin (Read 181 times)

jr. member
Activity: 103
Merit: 2
Writer
December 20, 2017, 07:37:56 PM
#2
Gday all,

Here is an explanation of BTC mining :

The 'complex calculations' or 'mathematical puzzles' refered to in BTC mining simply amount to grinding through gazillions of combinations to find the right one. Currently about 15 exa hashes per second (exa is 1018 or a million milllion million.)

What's a 'hash' ?
A hash is a general term for any calculation which takes a set of input data, and produces a smaller output derived from the input. A common example is the MD5 codes used to verify downloads - the MD5 number is a hash derived from the file. If even a single bit in the file, or MD5 hash, is corrupted then the MD5 hash will not match. Another example would be a checkdigit for an account number, or CRC (Cyclic Redundancy Check.)

It's called a 'hash' as all the input data is 'hashed up' - chopped and mixed and crunched down into a single output number that is a signature of the input data, and is also called a hash.

A BTC hash takes a one megabyte BTC block and produces a 256 bit result using the industry standard SHA-256 function.

There are a vast number of possible hashes (around as many as there are atoms in the universe), so the chance of two different blocks having the same hash is infinitely small.

Hash difficulty
As a better example, imagine a simple hash function which takes each byte in the 1 MB block and multiplies them all together (treating 0 as 256), and then produces the lowest 100 digits of that vast number. Let's use decimal.

The resulting hash would be a 100-digit number with randomly distributed decimal digits (because we kept only the lowest digits, which vary the most.)

So, about 1 in 10 of those hashes will end in '0', and about 1 in a 100 will end in '00', and about 1 in 1000 will end in '000', etc...

Thus, to find a hash that ends in just one '0' will only take about 5 tries on average (it might take 1, or it could take 10 or more), but to find a hash that ends in '00' will take about 50 tries on average, and to find a hash that ends in '000' will take about 500 tries on average - and a hash ending in '000000' will take about half a million tries.

That's how BTC mining difficulty is adjusted, by automatically adjusting the number of '0's required at the end of the hash (although it's done with binary digits) to keep the block-rate around 10 minutes.

Currently it takes about 10 zetta (1021) hash attempts (!) to produce a successful BTC hash - thus receiving or 'mining' a BTC reward (currently ~$200K per block.

Mining a block
BTC miners repeatedly choose transactions (usually those with highest fees) from the queue of waiting BTC transactions, pack them up into a block, and then churn through hashes attempting to find a hash for that block which ends in the right number of '0's. Which ever miner hits it then immediately broadcasts it on the BTC network, all the other miners check the hash, and acknowledge it, and that block gets added to the chain (it is very easy to check that a hash is correct.)

So those transactions in that block are now done and all the miners go back to the queue to get a new set of transactions to pack into a new block to try again. The small chance of a double hit is covered by majority acknowledgment - one of the mined blocks will be cancelled. That's why at least one confirmation is needed for a transaction.

For the Nonce
Miners churn through the combinations by changing a number inside the BTC block called the 'nonce' in a simple loop as follows :

Start :
Collect the richest transactions into a block
Set nonce = 1
Loop:
__Calculate block hash
__Does the hash result have enough 0s ?
No - increment nonce, go back to loop

Yes - broadcast our block
Does our block get confirmed ?
No - back to start

Yes - success ! 12.5 BTC
Back to start
jr. member
Activity: 103
Merit: 2
Writer
November 26, 2017, 05:48:02 PM
#1
Greetings all,
I have put togther an introduction to BTC suitable for interested investors, I'd be happy to hear feed-back and suggestions Smiley

What is Bitcoin?
Oddly enough, there is no simple clear answer to that. Bitcoin is somewhat like money, somewhat like shares, and partly a whole new concept.
Bitcoins are not physical, they are simply numbers in the blockchain. The blockchain is a public online database stored in the cloud (shared amongst thousands of computers world-wide) which functions somewhat like the records of an online bank.
All bitcoin is stored in a particular 'address', which acts like a cross between a bank account number and an email address - here is an  address e.g. : 1AGNa15ZQXAZUgFiqJ2i7Z2DPU2J6hW62i
The blockchain records exactly how many bitcoins are stored at which addresses, and allows them to be sent securely from one address to another. It is about 142 GB and always growing.

How are Bitcoins Managed ?
A 'wallet' is used to hold and manage Bitcoin addresses and their private keys. A wallet can be a program on a PC, or an app for your smartphone, or an online wallet managed thruough a web-site, or even a hardware wallet much like a USB stick. No-one remembers or types in addresses though - they are usually transferred via copy/paste if possible, or with cameras reading QR codes (squares of black/white dots readable with smartphone or PC cameras.)

How to buy Bitcoin ?
It's similar to buying shares online - first you must set up an online account at a Bitcoin market, then transfer money from your bank to the market account, then finally you can buy Bitcoin on the market (and then move it out to your wallet of choice.)
The major market is the US Coinbase. BTC markets in Australia include Independent Reserve, and BTC Markets, and CoinJar, and CoinSpot et al. It can take a day or more to sign up, and it also takes a similar time to deposit money into the market account (usually BPay, or bank transfer.) There are varying market fees, and daily limits typically starting around $2000.
Your market account will have your own Bitcoin wallet included, and you can send and receive Bitcoins with it.

What is BTC backed by ?
Confidence. The blockchain concept is sound, and yet revolutionary. It is totally de-centralised and is not controlled by any one entity - not a bank nor govt nor corporation nor billionaire. Yet it is still technically secure, being protected by world-standard encryption and hashing technology.
Also - creation of BTC is fixed and dwindling and cannot be increased, unlike our fiat money which can be created arbitrarily en-masse. BTC is designed and expected to steadily increase in value - for ever.

Could BTC collapse ?
Yes. If (almost) everyone suddenly lost confidence at the same time - but that is extremely unlikely, absent some catastrophic and catalyzing event. BTC has already suffered many attacks in the media but has come back stronger from each - because the fundamentals are sound, but the attacks are mostly slogans from bankers with an axe to grind.
Every dip in price is met with a surge in buying that pushes the price ever higher - as designed and as expected. Millions of people are heavily invested in BTC - what could make everyone suddenly change their mind ?

What about a hostile take-over ?
Possible but difficult. Bitcoin can be taken over by controlling 50% of the mining power. Currently the top four mining pools control over 50%. Solo control of over 50% would allow anything to happen - but if someone did achieve control of all two hundred billion $ of BTC, they would hardly destroy it by stealing it.

What are the main risks ?
Hackers and crooks. The blockchain is secure, but your PC and/or phone may not be, nor online exchanges/markets.
Or forgetting your password without having made a backup of your wallet keys or recovery phrase. Or accidentally throwing them away.
BTC is still new and un-regulated, however an informed and careful user faces low risks.

Which wallet type is most secure ?
It boils down to where your private keys are (each public BTC address has a paired private key to allow the BTC to be spent.) The least secure is an online wallet at an exchange or market - which although most convenient, is vulnerable to hacking or theft at their end, as well as the usual risks of web-browsers and their passwords at your end.
A smartphone app is a little better, or a wallet program on a PC. Even more secure is a hardware wallet (which looks like a USB stick.)
Wallets are protected by a password, and also secured by a recovery phrase - so they are generally safe even if stolen or destroyed - provided the password is good and the recovery phrase is secure.
For maximum security, especially for long-term investment, a 'paper wallet' is used - this means literally making a paper printout of your private keys (or alternatively the wallet recovery phrase), and keeping it safe, while un-installing your wallet and accounts. Then your BTC cannot be accessed without the keys/phrase. But if you lose the printout your BTC are gone for-ever.

What's revolutionary about the blockchain concept ?
The blockchain is a public database that is maintained (without external control or funding) by internet volunteers, and yet is provably secure from hacking. It takes the form of an ever-increasing chain of blocks which are added at the top of the chain one by one every ten minutes or so. Previous blocks cannot be changed because each new block contains a digital signature (called a 'hash') of the previous block. Each block contains a set of recent BTC transactions, and is also protected by a hash. In accounting terms it is like a ledger, in computer terms it's like a file that can only be appended to.

Why the Negativity ?
Banks cannot create it, governments cannot tax it, corporations cannot profit from it, and none of them can control it - of course they hate it. Conversely, BTC's freedom from the establishment is a strong feature of BTC and a major selling point for some proponents.
Meanwhile the banks are all working as quickly as possible to establish their own blockchain products. So too many govts and corps.
Big-wig banker Jame Dimon called BTC a fraud and a bubble, and the price dropped about 20% overnight. His friends then spent millions buying BTC at low prices and the price shot up even higher.

Are there Fees ?
Yes. Although transaction fees are optional and can be zero, in practice a schedule of fees is developing. They are not cheap, and range from a few $ to over $50 for fast results. Also - buying and selling BTC at an online market attracts a fee there too, which can be around 1%.

Completely Free to share BTC
Parties who trust each other can share and transfer BTC for free by operating two copies of the exact same wallet (e.g. by sharing the wallet recovery phrase.) Because the BTC are stored on the blockchain and each wallet is simply displaying the values there, any transaction on one wallet copy will be instantly and exactly seen duplicated on the other wallet copy.

Who pays for it all ?
Every block that is succesfully added to the blockchain rewards the miner with some new BTC - currently 12.5 BTC (about $100K) every ten minutes or so, and dwindling. The transaction fees also go to the miner. This can all be quite profitable and these days a typical 'miner' is a vast ware-house in the cold up a Chinese mountain next to a hydro-electric power station filled with tens of thousands of special purpose computers churning through a grand total of 11 million trillion BTC hashes per second world-wide. BTC creation currently consumes about $50 of electricity each .

How to send/receive Bitcoin ?
A BTC transaction consists of sending BTC to a specific address.
Every wallet has a Receive button or function to show a Bitcoin receive address (which is public like an email address, and which receives and holds BTC like a bank account number.)
E.g. after buying some BTC at the online market it is transferred out by copying the Receive address from the receiving wallet over into the To address in a Send transaction on the market wallet (or using a camera to read a QR code.) It is quite easy - but there is no charge back or recovery from error. The result will show instantly, but will not be confirmed for a while - the queue is currently 10 hours long, but increasing the fee will push your transaction up the queue.

Have I missed the boat ?
No. The boat is still there. BTC is designed for steady price increase, and it is following that expected pattern (barring dips and jumps.) As long as BTC increases it is never too late - was it too late at $100 ? $500 ? $1000 ? $5000 ? At currently over AUD$10,000 it may seem too late, but when it hits $20,000 it won't.

Note -  I am not a financial advisor, this is not financial advice.


Kapyong
Jump to: