Homework on Hash Functions - Questions

Yes, through my research it I sounds to me that the private key is randomly selected and multiplied using ‘elliptic curve scalar multiplication’ to produce a public key. “Elliptic curve scalar multiplication” is the operation of successively adding a point along an “elliptic curve” to itself repeatedly and used in “elliptic curve cryptography” or “ECC” as a means of producing a one-way function so that the private key can never be used to produce itself through a two-way function like standard databases do with “hash keys”…

That said, the public key is then put through both the “SHA-256” and RIPEMD160 hashing algorithms to make it impossible to determine the private key from the public key and to shorten in to 160 bits or 40 characters instead 256 bits or 64.

I think the reason why the private key is selected randomly is so that it can never be recreated, copied or 2 way hashed. Unlike the public key, the private key must be the absolute safest string of characters in the Bitcoin program. The public key must be able to withstand all attacks and must not include any possibility of the private key being determined from it which is why it must not subjected to the SHA256 and RIPEMD160 hashing algorithms in the process.

1 Like
  1. a hash function is turning data into a unique numerical identity.

2.A hash function is used in bitcoin by by taking a mathematical input value and converts it into another compressed numerical value. the input is arbitrary length but the output is always a fixed length.

  1. it has to be collision resistant so two inputs dont get the same outputs from the hash function.
1 Like
  1. Describe hash functions with your own words

Functions where you can get outputs from inputs but not the other way around. The outputs are always the same length, regardless of the input.

  1. How are hash functions used in cryptocurrencies like bitcoin? (Try to research this on your own, we will cover this later in the course but challenge yourself and see if you can find information on this already now).

Miners use hash functions to combine recent, transaction-based inputs, with a number known as a nonce so that the resulting hash value starts with a certain number of zeroes. If the hash value starts with that certain number of zeroes, it means that it is lower than the difficulty target.

This lower than the difficulty target hash value allows the miner who found the correct value to add a new block of transactions to the Bitcoin blockchain, and get paid in newly minted BTC for their “proof of work”.

  1. What does it mean when we say that hash functions need to be collision resistant? (We didn’t use the term “collision resistant” in the lecture, but you will easily find this on Google, we add this question intentionally to make you research information on your own, that’s how you learn best).

Given two different inputs x and y, their respective hashes in h(x) and h(y) must be unique and different from both each other as well as other hashes. Otherwise, systems reliant on collision-resistant hash functions, such as Bitcoin, would break.

1 Like
  1. Hashing takes an input (string of any length) and outputs a fixed length hash (unique data string). Main point, cannot (or infeasible) to ascertain the input string form the output hash (in the case of Bitcoin).

  2. For a typical blockchain, the sequential data blocks contains a hash pointer which links the prior block. For a speedy and secure blockchain, a hash function is used to hash all the data from the prior block. Even subtle changes are immediately known and apparent. In short, hash functions transmit data more efficiently and securely than legacy methods. Anything from signing transactions, verifying transactions, minting bitcoin via mining, etc.

  3. As no hash function is completely “collision resistant,” in that different inputs share the same output hash. E.g., for SHA-256, there is an extremely low possibility that different inputs share the same output hash.It’s important that a hash function minimizes the chance for collision as a system that effectively states different inputs are the same would render system worthless.

1 Like

Great answer! :raised_hands: I was just checking if you will got it right. Some think that hash functions are used to derive the public key from the private key. :slight_smile: I had to make sure :wink:

This is the property of a hash function, can you give a practical example where they are used in Bitcoin? :slight_smile:

1 Like

a hash function on bitcoin is used to write new transactions into the blockchain through the mining process.

1 Like
  1. Describe hash functions with your own words
    With Hash functions there is a 1 way result. It is difficult to take the Output to figure out the Input function for specifically SHA-256

  2. How are hash functions used in cryptocurrencies like bitcoin? (Try to research this on your own, we will cover this later in the course but challenge yourself and see if you can find information on this already now).
    Miners create blocks that they keys are processed through SHA-256 to hide the original keys.

  3. What does it mean when we say that hash functions need to be collision resistant? (We didn’t use the term “collision resistant” in the lecture, but you will easily find this on Google, we add this question intentionally to make you research information on your own, that’s how you learn best).

So you don’t have a repetitive output which is difficult already with hash functions. They should be collision resistant finding two different inputs will not give you the same output.

1 Like
  1. Describe hash functions with your own words
    –> A Hash function is a function that can be used to generate a value or values (fixed length) from a string of text using mathematical function or algorithm.
  2. How are hash functions used in cryptocurrencies like bitcoin?
    –> In the context of cryptocurrencies like bitcoin, the transactions are taken as input and run through a hashing algorithm (SHA-256) which gives an output of a fixed length. Hashing is one way to enable security during the process of message transmission when the message is intended for a particular recipient only since it is deterministic, Quick computation, Pre-Image resistance, a small change in input changes the output, collision resistant and puzzle friendly.
  3. What does it mean when we say that hash functions need to be collision resistant?
    –> It means that a hash function is hard to find two inputs that hash to the same output. Cryptographic hash functions are usually designed to be collision resistant otherwise it causes less security.
1 Like
  1. A hash function is a special function that always gives the same outputs for a given insert, and in a way that prevents a computer or person from figuring out the function or going from output back to input.

  2. Hash function are used as the cypher that secures the crypto information and keeps it protected from corruption. It is like encryption.

  3. collision resistance means that 2 different inputs produce the same output.

1 Like

A hash function takes a unique string of text or numbers then produces a unique one way fixed length output

hash functions are used to hide private and public keys ,as well as to expose the public and private keys when needed for authentication.

collision resistant is avoiding the situation in which 2 unique variables produce the identical output

1 Like

Homework on Hash Functions - Questions

  1. Describe hash functions with your own words

Hash functions apply cryptographic encoding algorithms to an input. They produce the effected output which has been hashed. This output has been changed in such a way that you can not find out the input data, it merely represents it.

  1. How are hash functions used in cryptocurrencies like bitcoin? (Try to research this on your own, we will cover this later in the course but challenge yourself and see if you can find information on this already now).

Hash functions are used in cryptocurrencies in an overlapping manner, The data in each block has been hashed and then appended to a nonce and then hashed again. All blocks reference the previous block of data with a hashed reference.

  1. What does it mean when we say that hash functions need to be collision resistant? (We didn’t use the term “collision resistant” in the lecture, but you will easily find this on Google, we add this question intentionally to make you research information on your own, that’s how you learn best).

Collision resistance protects against the feasibility of two inputs producing the same output (hash).

1 Like
  1. Describe hash functions with your own words

hashing is using an algorithm and data set to create a unique output from a unique input that can not be reversed. if it can be reversed there is no point to the purpose of hashing.

  1. How are hash functions used in cryptocurrencies like bitcoin? (Try to research this on your own, we will cover this later in the course but challenge yourself and see if you can find information on this already now).

Hash’s are utilised in a number of was I believe how bitcoin use the hash’s is by creating blocks with unique hash’s which hold the data of the transactions for example there will be a genesis block that will not have a hash function however once the next block is formed with the data from the transaction history it will have a unique hash, the next block formed will reference this previous Hash or last hash to confirm the validity of previous transaction history. so the previous hash has to match the hash of the data if it doesn’t it is known then to be corrupt because changes have been made.

  1. What does it mean when we say that hash functions need to be collision resistant? (We didn’t use the term “collision resistant” in the lecture, but you will easily find this on Google, we add this question intentionally to make you research information on your own, that’s how you learn best).

Collision resistant means two different things not getting the same hash.

1 Like

Miners don’t hide any keys, they just secure the block data with a hash to make it immutable. :slight_smile:

1 Like

I would rather use public key cryptography for transmitting messages. :slight_smile: hashes are traditionally used to store passwords in a db.

1 Like

How would you use a hashed private key? I would rather not even share my key with anyone and keep it private all the time. :slight_smile:

Thank you for the clarification, It helps us understand better.

  1. Describe hash functions with your own words
    A hash function gives a unique output to every input. Change a single digit in the input and the output will be completely different.

  2. How are hash functions used in cryptocurrencies like bitcoin? (Try to research this on your own, we will cover this later in the course but challenge yourself and see if you can find information on this already now).
    Hash functions are used in Bitcoin mining. So bitcoin miners use hash functions when validating incoming transactions in the blockchain.

  3. What does it mean when we say that hash functions need to be collision resistant? (We didn’t use the term “collision resistant” in the lecture, but you will easily find this on Google, we add this question intentionally to make you research information on your own, that’s how you learn best).
    Being collision resistant means that no two inputs will generate the same output. Technically getting the same output from 2 different inputs is possible in most hash functions, but actually finding those 2 inputs is just not feasible.

1 Like
  1. Hash functions create a unique fixed length output for a given input of any length.
  2. Hash functions are used in Bitcoin to write new transactions into the blockchain through the mining process.
  3. When we say hash functions need to be collision resistant means it is hard to find 2 inputs that hash to the same output.
1 Like
  1. In a hash function a specific input always gives you the same output. An output won’t let you figure out the specific input easily.

  2. Miners have to guess the input to get the mining rewards.

  3. Collision resistant means it is hard to find two inputs that hash to the same output.

1 Like