This is a test post (˶˙ᵕ˙˶) Experimenting with blockchain SHA-256 hash value mining using Java
--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