Does timestamp also change with nonce to calculate block hash in blockchain How hash is calculated

0 votes

Do we need to update date timestamp on every hash calculation update and also could someone explain how it's implemented in most popular cryptocurrencies?

function isValidHashDifficulty() { //validate calculated hash to fit requirements } function calculateHash(nextIndex, previousHash, timestamp, data, nonce) { //calculate hash } let nonce = 0; let nextIndex, previousHash, data; let timestamp = new Date().getTime(); // do we use this timestamp? while (!isValidHashDifficulty(nextHash)) { nonce = nonce + 1; timestamp = new Date().getTime(); //or do we get new date on every calculation attempt? nextHash = calculateHash(nextIndex, previousHash, timestamp, data, nonce); }

Mar 8, 2022 in Blockchain by Soham
• 9,710 points
609 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Blockchain

0 votes
1 answer
0 votes
1 answer

In a Blockchain, how difficult is it to modify the third to last block?

Technically, it's not difficult at all, all ...READ MORE

answered Apr 20, 2018 in Blockchain by Christine
• 15,790 points
1,027 views
0 votes
1 answer
+1 vote
1 answer
+1 vote
3 answers

How to convert timestamp to readable format in blockchain.info?

You are talking about the block_time property ...READ MORE

answered Apr 29, 2019 in Blockchain by Raghu
10,640 views
+1 vote
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured ...READ MORE

answered Aug 6, 2018 in Blockchain by aryya
• 7,460 points
1,428 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,923 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,451 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP