Some Context

I am creating my own altcoin for learning purposes and have successfully built the bitcoin code from source with my own genesis block.

Now is it time for me to change the name of the coin, so that it is truly my own alt coin.

To do this, I presume that I must change every instance of bitcoin to myaltcoin in the code, so that when I run bitcoin-qt (after the change I hope to be able to run myaltcoin-qt), everything inside the GUI will say myaltcoin and not bitcoin.

How I propose to do this...

I figure that the best way to do this would be to do some kind of case sensitive find and replace, to recursively go through all files and directories and the strings in the files, changing every instance of bitcoin to myaltcoin

The Question

What is the safest way to do this in the linux terminal? To do this safely I assume I must:

  1. Account for case sensitivity.
  2. Replace file names of bitcoin to myaltcoin
  3. Replace text instances of bitcoin to myaltcoin within files
  4. Replace bitcoin to myaltcoin in directory names

I presume there is some way to do this with find, but I'm not sure what the best way is.


To find string with in the files (including binary files), issue the command:

grep -rnw '/home/user/' -e 'bitcoin'

It will return every single entry for the word bitcoin in your code.

But I do not think that's the best way to get what you have in mind, what about "if" you have a CONST or a variable in the code called const BITCOIN or bitcoin ?

Your approach would be catastrophic for the base code and probably it will not compile. Just do not do that, instead try to find all the points with the command above, once you find all the entries, change it manually (read the code before you do that) and not using find and replace option from your code editor.

| improve this answer | |

there is no faster way to rename , but there are steps you have to rename the bitcoin source code.. for ex let your altcoin's name be : andracoin

First :

inside the src folder use this command :

find ./ -type f -readable  -writable -exec sed -i 's/bitcoin/andracoin/g' {} \;


find ./ -type f -readable  -writable -exec sed -i 's/Bitcoin/Andracoin/g' {} \;

then :

find ./ -type f -readable  -writable -exec sed -i 's/BitCoin/AndraCoin/g' {} \;

then :

find ./ -type f -readable  -writable -exec sed -i 's/BitCoin/AndraCoin/g' {} \;

then :

find ./ -type f -readable  -writable -exec sed -i 's/BTC/ADC/g' {} \;

then :

find ./ -type f -readable  -writable -exec sed -i 's/bitcoind/andracoind/g' {} \;

of course after you rename you will have some issues , but this is the safest way to replace names ...if you don't have a basic information about bitcoin and its blockachain you will have alot of problems during the building process. I recomand to watch this course :

How to Create Your Own Cryptocurrency in C++

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.