Building a Blockchain in .NET Core - Proof of Work

NXTBlocks.Blockchain.Demo05 v2019.1
Released on December 20, 2018 (AssemblyVersion: 2019.1.101.21)
Description: NXTBlocks Blockchain Demo #05
Reference: NXT_2019.1.101.21_DEM_05
Version of the .NET Framework: .NET Core 2.1


In my previous article, Building a Basic Blockchain In .NET 4.5, I created a basic blockchain that was used to store transactions. The basic blockchain can be tampered with easily. Even though there was a validation mechanism, by updating a block and re-calculating hashes of all blocks after it, the tampered-with blockchain passed validation. The situation could become worse in the real world because re-calculation can be done in a short period of time with a modern computer. We must come up with a solution to stop attackers from tampering with a blockchain. The solution actually is pretty simple and straightforward. That is Proof of Work.

Source Code Files

Program.cs (PDF)
Blockchain.cs (PDF)
Block.cs (PDF)

Source Code Package

Source Code Package v2019.1 (ZIP)

Archived Versions

Old versions of NXTBlocks Blockchain Demo #05 can be downloaded here.

There are no previous versions available.

Please note:
Archived builds are unsupported and may contain security issues. It is highly recommended not to use them except when there is no better choice.

Instructions And Other Documentation

Output Console (TXT)
Output Console (PDF)

Warranty Information
No Warranty. NXT Blocks disclaims all warranties, either express or implied, including but not limited to implied warranties or merchantability and fitness for a particular purpose, with respect to the software and the accompanying written materials. No liability for consequential damages. In no event shall NXT Blocks or its suppliers be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use this NXT Blocks product, even if NXT Blocks has been advised of the possibility of such damages.

Copyright Information. This file and its contents are protected by United States and International copyright laws. Unauthorized reproduction and/or distribution of all or any portion of the code contained herein is strictly prohibited and will result in severe civil and criminal penalties. Any violations of this copyright will be prosecuted to the fullest extent possible under law.

Privacy Policy. NXT Blocks is committed to protecting and respecting your privacy. In this privacy policy ("Privacy Policy"), we explain how NXT Blocks collects, uses, discloses and protects the Personal Information you submit to us, including, for example, when accessing and using NXT Blocks websites or applying for job offerings.

Our Privacy Policy has been drafted to comply with applicable data privacy laws, in particular, the EU General Data Protection Regulation (“GDPR”). If the GDPR does not apply to you, not all terms of this Privacy Policy may be relevant to you.

Technical Support

Have more questions? Submit a request