Bitcoin Forum
June 25, 2026, 07:39:02 PM *
News: Latest Bitcoin Core release: 31.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: how to generate genesis bloack hash using randomx algo  (Read 68 times)
marvic4 (OP)
Newbie
*
Offline

Activity: 31
Merit: 0


View Profile
February 19, 2025, 12:01:09 PM
 #1

Hello, how to generate genesis hash using randomx algorithm. Any tool appreciated. I tried with Randomx source code integrated into bitcoin core source code getting globalCahinparams initialization problems.
Thanks
pooya87
Legendary
*
Offline

Activity: 4144
Merit: 12362


The only path to victory is Resistance


View Profile
February 19, 2025, 01:01:33 PM
 #2

If you are trying to create an altcoin by copying Bitcoin's source code, you'll have to do a lot more than just swap a file or two. For example in case of the Genesis block, since it is the only hard-coded block, there is an "assert check" to make sure the hash of it is generated correctly. Which means when you start replacing hash algorithms it will start becoming a different hash. Not to mention that you'll have to mine Genesis block yourself, you won't be able to use bitcoin's anymore.

███████████████████████████████████████
██░░░░░░░░░░░░░████████████████████████████████████
███░░░██░░███████████████████████████████████
███░░░░░░░░░░██████████████████████████████████
██░░░░░█████████████████████████████████
███████████████████████████████
████████████████████████████████
███████████████████████████
███████████████████████████████████
██████████████████████████████████
██████████████████████████████
████░░░░██████████████████████████████████
██░░░░░░░░░███████████████████████████████████
 
   FREE PALESTINE   
███████████████████████████░░░██
█████████████████████████
███████████████████████░░░░░░░░░░██
███████████████████████░░░██░░██
███████████████████████
█████████████████████████████
███████████████████████░░░██████░░██
███████████░░██████████████
███████████████████████████░░████
███████████████████████░░░░░░░░░░░░██
███████████████████████░░████
███████████████████████░░░░░░██
█████████████████████████████░░██
DaCryptoRaccoon
Hero Member
*****
Offline

Activity: 1251
Merit: 633


OGRaccoon


View Profile
February 19, 2025, 03:22:35 PM
 #3

You might want to start with a early version of Bitcoin if your looking to make changes.

The later versions are not suitable for a new blockchain.

If you are looking to make changes and mine a new chain I would do so in a VM with older versions of Bitcoin bitcoin-0.10.0.tar.gz is a good one for making altcoins with.  Just be aware the packages used and code DO have security issues so local VM with no internet for the build is advised.

Once you have created your chain and mined some blocks you can then start for forward port the software the real issue is Bitcoin today is just not as suitable a codebase for making new chains.


┏━━━━━━━━━━━━━━━━━┓
┃     𝔱𝔥𝔬𝔲 𝔰𝔥𝔞𝔩𝔱 𝔴𝔬𝔯ⱪ 𝔣𝔬𝔯 𝔶𝔬𝔲𝔯 𝔟𝔞𝔤𝔰       ┃
┃                ➤21/M                      ┃
┃ ███▓▓  ███▓▓  ███▓▓  ███▓▓┃
marvic4 (OP)
Newbie
*
Offline

Activity: 31
Merit: 0


View Profile
February 19, 2025, 05:04:05 PM
 #4

@pooya87 , @DaCryptoRaccoon Thanks for replay, need to generate genesis hash using Randomx. How to generate it any tool to do? or any source code to do it? just genesis hash only. Yes, older version better to create, but using RandomX hash not using SHA256
Kalam001
Jr. Member
*
Offline

Activity: 129
Merit: 6


View Profile
February 19, 2025, 05:17:38 PM
 #5

Hello, how to generate genesis hash using randomx algorithm. Any tool appreciated. I tried with Randomx source code integrated into bitcoin core source code getting globalCahinparams initialization problems.
Thanks
There are numerous algorithms that can be used to generate or create a Genesis hash in Bitcoin, such as the MD-5 algorithm, which was among the first to gain popularity, the RIPEMD-160 algorithm, and the SHA algorithm, which most people consider to be somewhat secure. Therefore, in my opinion, if you are having trouble creating or generating a Genesis hash using a Randomx algorithm, try using another algorithm, and if you are unsure, perhaps consult a professional—I think we have a lot of them in our midst.
stwenhao
Hero Member
*****
Offline

Activity: 715
Merit: 1905


View Profile
February 19, 2025, 07:40:15 PM
 #6

Quote
the MD-5 algorithm
Don't do that, it is unsafe. First, because the output hash has only 128 bits, so just bruteforcing will make collisions after 2^64 hashes. And also, there are known MD5 collisions, which means, that users could make colliding blocks in seconds, and then send different versions to different nodes.

Quote
the RIPEMD-160 algorithm
If you don't want to make weak chain for testing, then don't use 160-bit hashes. The current Bitcoin network can produce blocks with 80 leading zero bits for double SHA-256, so for 160-bit hash functions with similar complexity, you could have a single collision per 10 minutes, if your network would be successful.

Quote
and the SHA algorithm
Which version? SHA-1 is broken, and has known collisions. And the original SHA-0 is unsafe, because you can break it after around 2^32 hashes. The easiest choice is of course double SHA-256, just like in Bitcoin, but then you have to know, how to implement Merged Mining properly. Of course, using next versions like SHA-3 is also an option, but they have different internal structure.

Quote
using randomx algorithm
Why exactly this algorithm? Because if you want to block ASIC mining, then be aware, that if your hash function will be too complex, then it will also slow down blockchain validation significantly. I saw CPU-mined coins, with just few GB blockchain, which can take months to validate.

And also note, that you don't have to replace SHA-256 everywhere, like some altcoins did, because then, it may slow down merkle tree construction, transaction hashing, change meaning of opcodes like OP_HASH256, and so on.

Quote
You might want to start with a early version of Bitcoin if your looking to make changes.
Not only that, but you can also improve many things, instead of copy-pasting some design mistakes. For example: you probably don't have to support uncompressed public keys, DER signatures, FindAndDelete way of hashing transactions (and clearly separate hashed data from signatures from the very beginning), and so on.

Proof of Work puzzle in mainnet, testnet4 and signet.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!