Perhaps this is too simplistic for this board, though hopefully you can help me. I'm currently trying to interpret general crypto code, as a basic coder. Is it agreed that bitcoin code is inherently very inefficient. To me it appears much code is duplicated unnecessarily. Ultimately, to me, bitcoin's code is still pre-beta, with minimal comments and few modules.
Can someone please advise which .cpp file states which hashing algorithm, the coin is using. ie what differs between sha265 hashed coin's code vs an equihash.
Take bitcoin gold for example. How does their wallet know how to interpret both equihash and sha265, depending on which block is being interrogated.
Bitgoin gold has significantly more lines of code than bitcoin. Is this purely to allow the blockchain to cope with two completely different hashes?
I can recall older coins changing algorithm over the years, though most did a 1 to 1 swap at an exchange. To me that is cheating. Obviously it cant be done eg Bitgoin gold, though is an algorithm change mid blockchain difficult to implement?