Bitcoin Forum
May 05, 2024, 06:49:16 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Is there a REAL guide for starting from the PRINCIPLES?  (Read 1932 times)
99bitcoins (OP)
Member
**
Offline Offline

Activity: 65
Merit: 10


View Profile
November 03, 2012, 04:30:47 PM
Last edit: November 03, 2012, 04:42:09 PM by 99bitcoins
 #1

I want to start mining but I'm not the type to just go along with what everone else is doing. I don't feel confortable with just going to buy some video cards without understanding the principles. Yes I've looked at the "Beginner's Guide" but that's not helpful at all for me because it assumes that I'm just a crowd follower. Just look at the first link under "3. How To Get Started With Mining" The first link is "What is Pool Mining" ...um... you see where I'm going with this? Undecided

 I'm trying to find an article or ebook that explains everything in detail. For example i see this a lot: mining is to find nouce so that sha256(sha256(data+nounce)) < difficulty. Wait a minute, if a hash if unpredictable, how can it be quantified and thus be "smaller" than a given amount. I though a hash was just a random set of strings (not a number Huh)... And if a miner solved a block with only one txn(say #404) in it and another miner solves a block with ten in it which also includes txn #404, then what, will that txn be in both blocks?

These are just an example of the many ways I'm confused about this. There has to be a good resource out there (no I'm not talking about the Wiki - which is good but too fragmented) and I'm hoping somebody can point me to it. Sorry for the rant...
1714891756
Hero Member
*
Offline Offline

Posts: 1714891756

View Profile Personal Message (Offline)

Ignore
1714891756
Reply with quote  #2

1714891756
Report to moderator
1714891756
Hero Member
*
Offline Offline

Posts: 1714891756

View Profile Personal Message (Offline)

Ignore
1714891756
Reply with quote  #2

1714891756
Report to moderator
1714891756
Hero Member
*
Offline Offline

Posts: 1714891756

View Profile Personal Message (Offline)

Ignore
1714891756
Reply with quote  #2

1714891756
Report to moderator
It is a common myth that Bitcoin is ruled by a majority of miners. This is not true. Bitcoin miners "vote" on the ordering of transactions, but that's all they do. They can't vote to change the network rules.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
Stephen Gornick
Legendary
*
Offline Offline

Activity: 2506
Merit: 1010


View Profile
November 03, 2012, 05:06:44 PM
 #2

I'm trying to find an article or ebook that explains everything in detail.

Free download:

Introduction to Bitcoin Mining
 - https://www.coindl.com/page/item/201

For example i see this a lot: mining is to find nouce so that sha256(sha256(data+nounce)) < difficulty. Wait a minute, if a hash if unpredictable,
It is not unpredictable.   sha256(sha256(data+nonce)) will determine the same result every time.  What is unpredictable without doing the work is which nonces will result in a hash that results in a low enough value.

how can it be quantified and thus be "smaller" than a given amount. I though a hash was just a random set of strings (not a number Huh).

Strings have binary representations.  Binary representations can be compared.    So there is no difference between a string and a number.  

The example in this Bitcoin wiki article shows an example of multiple nonces until a low enough hash is found:
 - https://en.bitcoin.it/wiki/Proof_of_work


And if a miner solved a block with only one txn(say #404) in it and another miner solves a block with ten in it which also includes txn #404, then what, will that txn be in both blocks?

Yup, but only one block will end up winning, as eventually the longest chain will include one of those blocks and orphan the others.   A miner should work off the block greatest height.  If multiple blocks are at this height, whichever block arrives first is the one to mine against.

Unichange.me

            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █


DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
November 03, 2012, 05:15:56 PM
Last edit: November 03, 2012, 05:29:29 PM by DeathAndTaxes
 #3

Quote
Wait a minute, if a hash if unpredictable, how can it be quantified and thus be "smaller" than a given amount.

Well that might make understanding things difficult.  Hashes are never unpredictable.

The SHA-256 hash of
Code:
password
will ALWAYS be
Code:
5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8

Always, always, always.  Today, tomorrow, 100,000 years in the future.  On any OS, any hardware, anywhere on the planet the hash of password will always be the number above.  If ever the SHA-256 of password wasn't the number above it would mean a catastrophic failure of SHA-256.  It would render Bitcoin useless overnight.  How could you verify tx and blocks if the hash you computed was different than what the creator computed?

"wait number?".  Yes the otuput of a hash function is a number.  Rather than try to represent than number as binary (it would be a sequences of 1s and 0s 256 digits long) or base 10 (a useless representation as no computer works on base 10 and no human can compute numbers that large in any reasonable timeframe)  they are often represented as strings (either in hexadecimal as above) or in other encoded formats (base58).
99bitcoins (OP)
Member
**
Offline Offline

Activity: 65
Merit: 10


View Profile
November 03, 2012, 05:26:13 PM
 #4

Thanks for the replies so far. Stephen, I actually read that ebook the other day an I thought it was useless for me, it just didn't have any valuable info in it for me. I felt like more like a glancing over than an intoduction. But I think it maybe helpful to complete freshie but I doubt that too.

As for you're answers to my other questions, it was helpful. I understand now we are comparing the binary values. This is the kind of info I hoped to find in an introductory writing. So I guess I'll have to just piece together bits of knowledge and learn that way. Shame I'm willing to pay for a decent ebook.


99bitcoins (OP)
Member
**
Offline Offline

Activity: 65
Merit: 10


View Profile
November 03, 2012, 05:29:22 PM
 #5

The SHA-256 hash of
Code:
password
will ALWAYS be
Code:
5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8

Always, always, always.

I know this but what confuses me is that we are looking for a value that is LESS than a "target". This suggests to me that the hash value will INCREASE or DECRESE depending on the nounce. When something is increasing, or decresing, it has a predictable quality doesn't it? This is that part that REALLY puzzles me.

Or to put it in another way, if the output of the hash function is completely unpredictable, wouldn't it be possible for the first nounce I try will be less than the target and the 1000th one be over the target?
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
November 03, 2012, 05:36:46 PM
 #6

http://www.xorbin.com/tools/sha256-hash-calculator

Here is a hash calculator.

Take the hash of password + nonce for nonces 1 through 1000 (or until you get board).

Write down the outputs and let me know if they are increasing or decreasing in any predictable pattern.  If you could predict the output of SHA-256 it wouldn't be a cryptographic hashing function and it would have security ramifications that go far beyond Bitcoin.
99bitcoins (OP)
Member
**
Offline Offline

Activity: 65
Merit: 10


View Profile
November 03, 2012, 05:43:02 PM
Last edit: November 03, 2012, 05:55:56 PM by 99bitcoins
 #7

Take the hash of password + nonce for nonces 1 through 1000 (or until you get board).
DeathAndTaxes, I took you up on your offer but took a shortcut Cheesy here we have it...Honestly I have no idea which hash is larger or smaller...

password1
0b14d501a594442a01c6859541bcb3e8164d183d32937b851835442f69d5c94e
password999
29fe5f91a54c416bd44a48640b7b286a205cc1bd85741fa2a599e6d41ed5884b

So is it possible that the hash of password1 could be LESS than hash of password999 or viceaversa?

I mean why zeroes, would it be just as difficult if the target started with 8s instead of 0s?
bcpokey
Hero Member
*****
Offline Offline

Activity: 602
Merit: 500



View Profile
November 03, 2012, 06:24:27 PM
 #8

Take the hash of password + nonce for nonces 1 through 1000 (or until you get board).
DeathAndTaxes, I took you up on your offer but took a shortcut Cheesy here we have it...Honestly I have no idea which hash is larger or smaller...

password1
0b14d501a594442a01c6859541bcb3e8164d183d32937b851835442f69d5c94e
password999
29fe5f91a54c416bd44a48640b7b286a205cc1bd85741fa2a599e6d41ed5884b

So is it possible that the hash of password1 could be LESS than hash of password999 or viceaversa?

I mean why zeroes, would it be just as difficult if the target started with 8s instead of 0s?

The hash of password1 will always be the same, and the hash of password999 will always be the same, so the question doesn't make sense. The two hashes will always be what they are, and if one is less than the other (depending how you are defining less) that is what they will always be.

I'm curious as to why you want to start from first principles? Doesn't really sound like you have the background to do such a thing. Not meaning to sound insulting or anything.
99bitcoins (OP)
Member
**
Offline Offline

Activity: 65
Merit: 10


View Profile
November 03, 2012, 06:33:37 PM
 #9

The hash of password1 will always be the same, and the hash of password999 will always be the same, so the question doesn't make sense.
You're right, my question was poorly worded there. Fair enough.

But what about my other question?...
Could we use another leading number for the target (assuming the protocol was redesigned to accept it)?
Quote
would it be just as difficult if the target started with 8s instead of 0s?


Quote
I'm curious as to why you want to start from first principles? Doesn't really sound like you have the background to do such a thing. Not meaning to sound insulting or anything.
I think I have ADD (a learning disability, I think) so it's hard for me to 'grok' concepts unless I start from the bottom. But I don't consider myself disabled in anyway.
MoonShadow
Legendary
*
Offline Offline

Activity: 1708
Merit: 1007



View Profile
November 03, 2012, 06:39:31 PM
 #10

Shame I'm willing to pay for a decent ebook.


Well, you do have a point.  So once you know what you need to know, write that ebook.

"The powers of financial capitalism had another far-reaching aim, nothing less than to create a world system of financial control in private hands able to dominate the political system of each country and the economy of the world as a whole. This system was to be controlled in a feudalist fashion by the central banks of the world acting in concert, by secret agreements arrived at in frequent meetings and conferences. The apex of the systems was to be the Bank for International Settlements in Basel, Switzerland, a private bank owned and controlled by the world's central banks which were themselves private corporations. Each central bank...sought to dominate its government by its ability to control Treasury loans, to manipulate foreign exchanges, to influence the level of economic activity in the country, and to influence cooperative politicians by subsequent economic rewards in the business world."

- Carroll Quigley, CFR member, mentor to Bill Clinton, from 'Tragedy And Hope'
MoonShadow
Legendary
*
Offline Offline

Activity: 1708
Merit: 1007



View Profile
November 03, 2012, 06:44:41 PM
 #11

it's hard for me to 'grok' concepts unless I start from the bottom. But I consider myself disabled in anyway.

You mean that you need to understand why you're doing particular things rather than just following a recipie, and I can relate.  However, I actually some background in cryptology and economics; and it took me weeks to wrap my brain around Bitcoin's elegant protocol.  I think that he's right, you might not have the technical background to understand from "first principles".

"The powers of financial capitalism had another far-reaching aim, nothing less than to create a world system of financial control in private hands able to dominate the political system of each country and the economy of the world as a whole. This system was to be controlled in a feudalist fashion by the central banks of the world acting in concert, by secret agreements arrived at in frequent meetings and conferences. The apex of the systems was to be the Bank for International Settlements in Basel, Switzerland, a private bank owned and controlled by the world's central banks which were themselves private corporations. Each central bank...sought to dominate its government by its ability to control Treasury loans, to manipulate foreign exchanges, to influence the level of economic activity in the country, and to influence cooperative politicians by subsequent economic rewards in the business world."

- Carroll Quigley, CFR member, mentor to Bill Clinton, from 'Tragedy And Hope'
99bitcoins (OP)
Member
**
Offline Offline

Activity: 65
Merit: 10


View Profile
November 03, 2012, 06:56:28 PM
 #12

it's hard for me to 'grok' concepts unless I start from the bottom. But I consider myself disabled in anyway.

You mean that you need to understand why you're doing particular things rather than just following a recipie, and I can relate.  However, I actually some background in cryptology and economics; and it took me weeks to wrap my brain around Bitcoin's elegant protocol.  I think that he's right, you might not have the technical background to understand from "first principles".

When I say principles I'm not talking about physics/electrical engineering. I have been doing computer programming for many years so I feel I'm competent enough. For example computers can be explained from first principle to user-facing apps in a handful of pages and still get the reader to comfort level where he can start creating apps prepare what he needs to start creating apps in the most efficient way.
MoonShadow
Legendary
*
Offline Offline

Activity: 1708
Merit: 1007



View Profile
November 03, 2012, 07:01:43 PM
 #13

it's hard for me to 'grok' concepts unless I start from the bottom. But I consider myself disabled in anyway.

You mean that you need to understand why you're doing particular things rather than just following a recipie, and I can relate.  However, I actually some background in cryptology and economics; and it took me weeks to wrap my brain around Bitcoin's elegant protocol.  I think that he's right, you might not have the technical background to understand from "first principles".

When I say principles I'm not talking about physics/electrical engineering. I have been doing computer programming for many years so I feel I'm competent enough. For example computers can be explained from first principal to user-facing apps in a handful of pages and still get the reader to comfort level where he can start creating apps.

Well, I'm not a programmer myself but understand computers and how they function to that level.  Particularly with regard to GNU/Linux from the kernal, posix commandline tools, to Xservers, to window managers up to the GUI suites.  I question whether either the cryptographic functions, nor the economic theories, that Bitcoin is based upon could be explained in a handful of pages.  Everything seems simple enough, once you're on this side of the enigma, but this is not a topic that many people can ever understand.  Satoshi was a polymath.

"The powers of financial capitalism had another far-reaching aim, nothing less than to create a world system of financial control in private hands able to dominate the political system of each country and the economy of the world as a whole. This system was to be controlled in a feudalist fashion by the central banks of the world acting in concert, by secret agreements arrived at in frequent meetings and conferences. The apex of the systems was to be the Bank for International Settlements in Basel, Switzerland, a private bank owned and controlled by the world's central banks which were themselves private corporations. Each central bank...sought to dominate its government by its ability to control Treasury loans, to manipulate foreign exchanges, to influence the level of economic activity in the country, and to influence cooperative politicians by subsequent economic rewards in the business world."

- Carroll Quigley, CFR member, mentor to Bill Clinton, from 'Tragedy And Hope'
99bitcoins (OP)
Member
**
Offline Offline

Activity: 65
Merit: 10


View Profile
November 03, 2012, 07:18:26 PM
 #14

When I started this thread I was just hoping to get links to some good reads...but it took a turn into the unknown  Roll Eyes
bcpokey
Hero Member
*****
Offline Offline

Activity: 602
Merit: 500



View Profile
November 03, 2012, 09:19:31 PM
 #15

When I started this thread I was just hoping to get links to some good reads...but it took a turn into the unknown  Roll Eyes

I don't think that's ADD, I think that is how everyone is who takes 'understanding' seriously.
For myself though, I 'understand' bitcoin, as well as I need to, because I accept my high-level ignorance in favor of a more practical understanding. I read some of the early treatises of bitcoin explanations (you might want to dig into the forum archives, people were more interested in discussing the low-level bitcoin foibles in '09, '10), and recognized my limitations on understanding and caring.
Once you find your own level of acceptance I think that will help with bitcoin adoption. There are many reductions of bitcoin, and very few of them require understanding of SHA-256 protocol in-depth, simply acceptance that it does what it needs to.


Hope that is somehow helpful.
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
November 03, 2012, 09:22:53 PM
 #16

But what about my other question?...
Could we use another leading number for the target (assuming the protocol was redesigned to accept it)?
Quote
would it be just as difficult if the target started with 8s instead of 0s?

Yes however (potential hash) < (target) it simple, easy (well relatively easy) to explain, and gets the job done.  There is no way to do it in a more difficult or complex manner.  You could for example look at some other characteristic of the blockhash (like the number of sequential same digits i.e. a hash containing 4444444444 is higher difficulty than one containing 999999999.  You gain nothing by doing that (or looking at the number of 8s) over simply comparing two hash values.

The choice to check if a hash is BELOW the target is arbitrary.  Satoshi could have just as easily decided to make valid hashes ABOVE the target.   

The target is simply a way to split the SHA-256 hash space into valid and invalid hashes.  The lower the target the fewer valid hashes there are and thus it will on average require more attempts to find a valid hash.

Forget cryptography for a second lets say you ran a store and wanted to give away 1 prize per day on average.  Right now you have roughly 20 customers one method you could use is to have a bucket with 1,000 numbers on it.  You could then daily publish the "magic number".  Each customer after a sale could draw one number from the bucket.  If it is smaller than the "magic number" then they win, otherwise they lose.  Now since you want to award on average one prize per day and you have roughly 20 customers per day you could start the magic number at 50.  (1/20*1000 = 50).  Note the magic number is arbitrary and depends on:
a) how often you want to award a prize (daily)
b) how many attempts will be made per unit of time (20 customers per day)
c) how many potential numbers there are (1,000)

If you used this system somedays you might award 4 or 5 prizes and some days you might award none.  You could even go weeks without awarding a prize but in the long run (say over a year) the average number of prizes awarded would be 1 per day. 

However what happens if the number of customers changes?  If you don't get 20 customers a day then your magic number is incorrect and your won't award prizes at the right frequency.  You could however once every two weeks look at all the sales in the last two weeks and divided by 14 to get the average customers per day.   You then could change the magic number to be = (numbers in the bucket) / (number of customers in prior two weeks / 14).

That is all Bitcoin is doing.   The goal of Bitcoin is that regardless of the amount of hashpower used one block will be found on average every ten minutes.  The protocol estimates the amount of haspower every 2016 blocks (by looking at how long it took) and adjusts the difficulty to make is easier or harder to find blocks in the future.
99bitcoins (OP)
Member
**
Offline Offline

Activity: 65
Merit: 10


View Profile
November 03, 2012, 10:20:52 PM
 #17

The choice to check if a hash is BELOW the target is arbitrary.  Satoshi could have just as easily decided to make valid hashes ABOVE the target.

So the game could have been to find a hash higher than a target beginning with FFF..... or FFFFF.... etc.

It's amazing how understanding one tiny detail can open up bigger knowledge. So I see understanding almost like exponentiation; one leads to another, leads to another, leads to another...

That details (of the target being arbitrary) was nagging me, thanks for clearing it up. Now I can move on...
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!