Functions, Hash Functions, Cryptography - Discussion

Hi @vidyasethu, sorry for the late answer, but I had work with others homework and couldn’t engage in a discussion :slight_smile:

So basically the Merkle tree is a tree like data structure consisting of hashes. Each leaf node in a tree represents the data (or txid) and all intermediary nodes are hashes of the of the neighbouring nodes. When you want to validate if the hash is part of a merkle tree root, you must know the intermediate nodes and the neighbour, which means you don’t need to recalculate the entire tree this is a method SPVs use to verify transactions without requiring the complete block. Not sure how exactly this is represented in math, but it basically looks like this:

So for example if you would want to verify hash Hc, you would only need to calculate Hcd - Hash(Hc + Hd) and the merkle root, which you get by hashing Habcd - Hash(Hab + Hcd), notice we didn’t require hashes Ha and Hb to verify that the transaction Hc is part of the Merkle Root.

The two characters are used to represent a byte in hexadecimal, which has the size of 8 bits, which corresponds to using two digits in a hexadecimal system (FF -> 1111 1111).

Well to be precise a hash is a buffer in memory which has a fixed size, which means it always uses the same amount of memory no matter the actual value the hash is. For example if somehow you would get a hash result 1, this would still be seen in the memory as 0000…248 MORE ZEROS…001. Sou it would have the same size, but the value would be 1 :slight_smile:

3 Likes

Thank you so much! I didn’t make the connection about the hash taking up the same amount of memory each time. I think I understand the Merkle tree a little better. Time to do more reading :slight_smile:

1 Like

I think the course is messed up. The discussion is placed before in information. Are you trying out something knew. First you give the information than you ask for discussion why is this portion the first in this section. I think this is misplaced, I tried to go back to previous lecture and see if I missed something but it wouldnt allow me.

Hi Ivan. I have no idea what Hash is, again, I am here to learn, teach me.

I would find this discussion more useful once I’ve gone through the lecture. I find hashing very interesting, especially as a way to explain to people that asks about hackers and the security of bitcoin

1 Like

Maybe someone already shared this resource, but I want to post it anyway because it was useful for me and maybe it can help someone else to understand some of the concepts revised in this section.
Blockchain Demo by Anders Brownworth

2 Likes

this is great! thanks for sharing:)

So…I think I understand Function is a computation of an input requiring an output…and has something to do with hash function and cryptography , but how does that benefit knowing?

1.Hashing is generating a value or values from a string of text using a mathematical function. It is one way to enable security during the process of message transmission when the message is intended for a particular recipient, only.
2. A cryptographic hash function is a special class of hash functions which has various properties making it ideal for cryptography.
3. Hash rate, basically, means how fast the hashing operations are taking place while mining.

2 Likes

I get the private and public keys, but I am not sure process to obtain my
Private key…Do I ask my central exchange site or my Hard wallet to generate my Private key Number? Could I get the correct procedure please ?

You can’t get private keys from a central exchange (at least from exchanges I know of).

The point of the hardware wallet though is that the private keys never leave the device. The transaction is sent on it and it uses the private keys to sign the transaction and sends it back to the PC.
For that reason there is no way to directly get the private key from the hardware wallet. But if you want you can import the mnemonic seed you use and import it in a wallet that can do that. I wouldn’t recommend though since this poses a potential risk of your key being compromised.

There is this interesting website I found a while ago that lets you import or generate mnemonics and derive keys and addresses from it, you can check it out and play around. :slight_smile:
Again I strongly recommend you do not use the mnemonic you used for your hardware wallet!
https://iancoleman.io/bip39/

2 Likes

Thanks again…really appreciate it :smile:

In Ivan’s discussion on private and public keys and encription , he mentioned that your computer generates that number. If that is true , what is the procedure to accomplish ?

Hash functions create hash ,which is a unique input that give a unique output which creates a digital finger print.
Cryptographic hash is produced from a special class of hash function that must pass 5 steps.
Private Wallet keys need to be encrypted in unsecured setting in order to protect coin algorithms you hold and your digital finger print

Random number generation is actually quite a difficult task to accomplish in a world where everything is deterministic. There is in fact no true random on a computer, but algorithms have been develop to achieve a degree of pseudo randomness.

The key generation is highly dependent on a good RNG algorithm, but unfortunately I haven’t studied them (and its been years since I learned about them in school :stuck_out_tongue: ) so I can’t give you a good answer about how modern algorithms actually work.

A good resource you can check out is https://www.random.org/

1 Like

o.k. , I understand ( I THINK ) that it is the “recovery phrase” that determine number to your private key.

The recovery phrase or mnemonic is actually a random set of words that are mapped to a specific set of bits that represent the private key. Its a representation of that number in words so to say :slight_smile:

1 Like

All of this is good for the future of the human race.

1 Like

if there is no way to get to inputs given the hash, how is the fact that the new block’s hash is made using the previous block’s hash, realized?

The previous block hash is the input to the new block hash.

1 Like