Functions, Hash Functions, Cryptography - Discussion

After watching and observing the required links, I learned that the private keys are generated randomly, from a 256 bit set of numbers, hence 256 bit encryption.

Once the two random private keys are generated, then the private key is generated. Using an elliptical curve, set on a grid of x and y numbers, the third tangent is derived from the first two by drawing a straight line. The numbers on the curve are astronomical so it is almost impossible to generate the same number twice. Those two sets (x,y) are then combined to form the public key.

I think then, that public address is hashed by performing a re-ordering and shrinking process, making the public key shorter in length. This hashing process is a mathematical process called a Markel Tree structure.

This new public key has also added zeroes in front so as to make it the correct length and another number set of numbers at the end of the address so that it detects errors so as to not send it to the wrong entity.

There was on thing I did not get (at all) when watching the clip in the top link. At 18:50 he explains elliptic curve multiplication and here I can’t get the numbers: If the private key is a 256 binary number, it translates to a base-10 number with 77 digits, 10^77. Then he says the multiplication is done key number of times. The age of the universe is less than 10^18 seconds so if I am rounding a bit, we must do 10^55 calculations per second just to generate the public key if we go on for 10^9 years. I created keys in a few seconds, he must be getting the numbers wrong?? I do hope I’ll get a better explanation from the Academy. :man_student:

When you hash your current block and hit the target number bull eye, would this be classified as you solved the puzzle or not?

Sorry if this has been answered already.

Thank you @FrankB to point out this aspect.
I think to had the same problem in understanding the use case of Merkle Tree a part from a more efficient way to store all the information of a bunch of transaction in one and make them strictly linked by each other (through hashing) in order to verify any tampering.
I really can’t understand how Merkle root can be used to “reduced the number of information have to be stored in order to verify a transaction”. Ok if you want to verify one single transaction thanks to Merkle Tree you can easily improve the number of computation of about log2(n°transaction into the block), but I mean if do not know the other transaction I can’t retrieve the needed information, so however I have to stored all transaction indeed.
Stefano

Yes, you need to know, it seems to me, which transaction at which leaf position you want to examine in order to make use of any kind of log2 reduction. But when you pick a particular position, you may as well just look at that position (or the hash of the leaf in that position). And if you don’t know the position, then you also don’t know which branch to pick, and since the number of leaves is equal to the number of branches, the log2 reduction no longer works. So where is the practical use case? In the end, the answer may be that it really doesn’t matter because as far as Bitcoin is concerned all you are ever interested in is the encoding, not the search.

Yeah I think you are right.
Probably the fact is that Merkle Root is simply put into the Block Header and hash with previous block hash and nonce to find the “solution of the puzzle”, hence, a Merkle Root is a easy way to stored information about all the transactions in one.
So Block will contain all the data while the Block header only those bunch of info easy to manage. In fact, if I don’t say wrong, big part of the 1MB Bitcoin’s block is occupied by transactions so as you said probably the Merkle Root is more concern on encoding.

Thanks to shared your doubt it was a pleasure to find someone with same doubt :slight_smile:

Functions were clear to me until I looked at the questions we needed to answer. I had no idea I was supposed to apply

^2 to question and +10 to question 2a and 2b. So my answers were wrong. Now I understand the 'lingo" and got the answers right.

I found this section of the course to be the most interesting and challenging. I’ve watched it about four times and just about got it.

Please correct me if I have misunderstood this but the way I understand the hash function is that it is a mathematical procedure that generates a lengthy alphanumeric code that is unique to that file and every single bit that comprises the file. If even one bit out of millions or even billions of bits is altered, this has the effect of changing the hash dramatically. Because the hash function can be very quickly calculated,it is a super effective way of detecting whether a file has been altered in any way. The hash function is ALMOST impossible to reverse but this is what I understand miners do to “solve” a block of bitcoin transactions; ie: they hash the block with one added key value that they guess trillions upon trillions of times until one of the miners produces a hash value of the block + key with a specified number of leading zeros. By requiring that the hash contain a bunch of leading zeros, this effectively modifies the difficulty associated with guessing the correct key that, when hashed with the block produces the required number of leading zeros. Adding leading zeros pumps up the difficulty, deleting them decreases the difficulty. The key is then added to the next block of transactions to create the block chain. Because each block contains the hash of all prior blocks, if even one bit in all of the gigabytes of the blockchain is altered, by the nature of the hash function, it is almost instantly flagged as a corrupted chain record. Am I close?

3 Likes

Yes, you have hit the point! :wink:

Is the guessed value that, when hashed with the block, produces the required number of leading zeros in the hash called the nonce? ie: this is the value that is guessed by miners to “solve” the block ?

No, the nonce is just a random number that miners use to help themselves with finding the right hash :slight_smile:

1 Like

HI
just a question how, concretly (software? what concrete manipulation ) is generate a public key from a private Key ?
tks

Hi @Zubus, welcome to the forum! :slight_smile:
For deriving the public key elliptic curve cryptography is used.

1 Like

Is still MD5 considered as a hash function as some succeed to reverse it?

Hmmm :thinking: I guess its considered an obsolete hash function :stuck_out_tongue:

1 Like

Hi! I have some questions about some of the content from the Hashing Reading Assignment in Bitcoin & Blockchain 101:

  • Looking at the Merkle tree + hashing. So I understand that hash functions allow you to get a fixed output no matter the size of the input. So with the Merkle tree, the data goes on the very bottom in the leaf nodes, with each layer on top being concatenated with the layer next to it and hashed again, so on so forth until you reach the top root node, and then the hash of the root node goes into the block header (I think). When it’s talking about “hashing” this data at every step, does that mean running it through the H(k|x) = Y function? In which case would the data represented in this function be “x”? Like if the data was about transactions on the BTC blockchain, how would you format all the data about various transactions to be inputted into that hash function?

  • Even though I understand the sections about hash functions and cryptographic hash functions, I am still not sure I totally get what it means to “hash a block”, similar to above in that I’m not sure if it means taking all the data in a block and putting it into H(k|x)=Y to get hash output Y? And if so how the data is formatted to be x in that situation.

  • Hexadecimal system - I understand base10 with respect to our regular number system and how binary uses base2. I am struggling a bit to connect the hexadecimal base16 system to binary. I read that “since SHA-256 returns a hexadecimal representation, 4 bits are enough to encode every character, so the 256 bits would represent 64 characters” and so the output hash of SHA-256 would always be 64 characters. From my understanding to convert binary to hexadecimal you group the binary number in 4 digit groups and then match each to a hexadecimal value, and they have hexadecimal values from 0-9 and then from A-F so 16 possibilities for each digit in total. But the hexadecimal representation system uses two digits (00-FF) and if each digit represents 4 bits, wouldn’t that be an 8 bit system? Also 256 bits would be 32 bytes right, so I’m wondering how I get from there to the 64 characters being outputted. I feel like I’m mixing up some concepts.

  • Difficulty target - I understand the general principle that difficulty is adjusted upwards/downwards depending on # of miners on the network. I read that the difficulty target with respect to BTC is a 64 character string beginning with a bunch of zeroes, and the required number of zeros in front of the number increases as the difficulty level increases. So is this saying that each time the output hash must be 64 characters, and simultaneously satisfy the condition of however many zeroes must be in front of the number?
    When they talk about mining they say “hash of contents of the new block is taken” (x) and they keep trying different values of the nonce (k) by brute force until they can solve for the output hash (Y) and “compare with the difficulty level to see whether it’s actually less than or not”. I thought that no matter what the output for SHA-256 always has to be 64 characters, is it saying that an output of 64 characters or less for Y is what’s necessary to solve the puzzle?

thank you in advance for any help!! really appreciate it :slight_smile:

MD5 is one of the easiest hash to reverse right now, its insecure by now.

If you have any more questions, please let us know so we can help you! :slight_smile:

Carlos Z.

1 Like

Lots of information to take in on this one but definitely gives a good foundation of whats to come. Great info and lots of note taking.

Hello all, I assume that hash functions and cryptography are a total new concepts for me and I look forward to begin learning them.

Cheers,