Test post (SHA-256 mining for blockchain by Java)

This is a test post (˶˙ᵕ˙˶) Experimenting with blockchain SHA-256 hash value mining using Java 写真 2020-04-04 17 26 24.jpg

--Shasha-256 hash value calculation --For the input data to obtain the hash value, concatenate the following as a character string --Data body --Any fixed value (usually a timestamp) --Nonce (correct answer value required to obtain the desired value of SHA-256 mining calculation value) --Calculate the hash value 100000 times, adding 1 nonce. --If the hash value starts with "0000", that is the target value (correct answer value). --If it is not found after 100000 times, use the hash value for the blockchain.

Experimental environment: Java (openJDK 12 + Eclipse) Usually at this difficulty level, in the case of Core i5 on Windows 10 (64bit), it can be calculated in 1 to 3 seconds (๑ ・ ∞ ・ ๑) 30 seconds to a few minutes for Raspberry Pi

● Purpose of using blockchain ...

Blockchain is used for mining virtual currency (bitcoin), but instead of using a large-scale server such as a data center, multiple individual-level servers such as Raspberry Pi are connected to tamper with distributed secure data. The purpose is to realize safe and stable storage without being done. When building a core system for sharing personal information in a guest house or shopping district, it is easy to introduce it for about tens of thousands of yen per store without using an internet cloud service, so it is one of the system levels that contribute to the local community. Expected as (˘͈ ᵕ ˘͈) ♡

In the future, I am researching whether it is possible to operate the blockchain in P2P via Java Servlet ...

Recommended Posts

Test post (SHA-256 mining for blockchain by Java)
2018 Java Proficiency Test for Newcomers-Basics-
Screen transition by Post method [Java]
9 strongest sites for learning Java by self study
Primality test Java
[java] HttpURLConnection POST
For JAVA learning (2018-03-16-01)
2017 IDE for Java
Java for statement
Search by POST request with Azure Search + Java Apache HttpClient
Sample code for log output by Java + SLF4J + Logback
Credentials referenced by the AWS SDK for Java by default