{"id":3794,"date":"2021-03-03T15:51:41","date_gmt":"2021-03-03T15:51:41","guid":{"rendered":"https:\/\/afluxcoin.com\/51\/creating-simple-cryptocurrency-using-c-and-net-part-4-block-header\/"},"modified":"2021-03-03T15:51:41","modified_gmt":"2021-03-03T15:51:41","slug":"creating-simple-cryptocurrency-using-c-and-net-part-4-block-header","status":"publish","type":"post","link":"https:\/\/afluxcoin.com\/fr\/51\/creating-simple-cryptocurrency-using-c-and-net-part-4-block-header\/","title":{"rendered":"Creating Simple Cryptocurrency using C# and\u00a0.NET\u2014 Part 4. Block Header"},"content":{"rendered":"

In this post, I will write about the block header, which is very important, where the block header is the building block of the block hash. The block hash itself is the unique identity of the block or block fingerprint.To make it easier to understand this post, I advise you to read my previous posts here: the first post, the second post, and the third post.In the previous post, we have made transactions, blocks, and block hashes, but it\u2019s still simple. At this time, I am improving our crypto project to be closer to real Crypto.This article will cover:Block HeaderUnix Time \/ Epoch TimeCryptographic Hash FunctionMerkle RootCoinbase TransactionStakeBlock ValidatorNumber of TransactionsTotal AmountTransaction FeeBlock HashCreate a BlockVideo TutorialConclusionBlock header is some data belonging to a block that is used as a unique identity of the block. The block hash was created by hashing the block header through the SHA256 algorithm. It is essentially a digital fingerprint of the block. Below is the block header for Bitcoin.Image Source: mdpi.comAs you can see, Version, Previous hash, Merkel hash, Timestamp, and the Difficulty are part of the block header, but Block number, Block size, Transaction counter, Transaction list are not included in the Block header.Now we modify Block.cs and it will look like this:public int Version { get; set; }public long Height { get; set; }public long TimeStamp { get; set; }public string PrevHash { get; set; }public string Hash { get; set; }public string MerkleRoot { get; set; }public IList Transactions { get; set; }public string Validator { get; set; }public int NumOfTx { get; set; }public double TotalAmount { get; set; }public float TotalReward { get; set; }public int Difficulty { get; set; }Unix time or Epoch time refers to the starting point used to calculate the number of seconds that have\u2026<\/p>","protected":false},"excerpt":{"rendered":"

In this post, I will write about the block header, which is very important, where the block header is the building block of the block hash. [\u2026]<\/span><\/p>","protected":false},"author":0,"featured_media":2796,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[35],"tags":[],"_links":{"self":[{"href":"https:\/\/afluxcoin.com\/fr\/wp-json\/wp\/v2\/posts\/3794"}],"collection":[{"href":"https:\/\/afluxcoin.com\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afluxcoin.com\/fr\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/afluxcoin.com\/fr\/wp-json\/wp\/v2\/comments?post=3794"}],"version-history":[{"count":0,"href":"https:\/\/afluxcoin.com\/fr\/wp-json\/wp\/v2\/posts\/3794\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/afluxcoin.com\/fr\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/afluxcoin.com\/fr\/wp-json\/wp\/v2\/media?parent=3794"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afluxcoin.com\/fr\/wp-json\/wp\/v2\/categories?post=3794"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afluxcoin.com\/fr\/wp-json\/wp\/v2\/tags?post=3794"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}