Bitcoin Forum
August 05, 2021, 05:58:24 AM *
News: Latest Bitcoin Core release: 0.21.1 [Torrent]
  Home Help Search Login Register More  
  Show Posts
Pages: [1] 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 ... 53 »
1  Alternate cryptocurrencies / Altcoin Discussion / Re: How To Create Your Own Digital Currency! Get Paid!!! on: January 18, 2014, 03:33:48 AM
Part 2

 LINE 2017 block.nTime    = 1300000000; //epochtime
You can get the current epoch time from: or you can generate it from the command line of most *nix systems with this code:

 $ date +%s
 $ 1369590088
It is customary to also change this line of code to a headline from the day of coin creation in order to relate it to the block.nTime with some human-readable bit:


 LINE 2005 const char* pszTimestamp = "Traditionally one puts something timely here coinciding with the epoch";
Now, notice the other lines near the block.nTime, they are called block.nNonce. A 'nonce' is a unit of measurement that is unique and occurs after the nTime is set. The code uses nTime+nNonce to formulate and validate timestamps for blocks and transactions. This is a VERY rough overview of how this really works, but I hope it gives you an idea. We will come back to the nNonce in a moment when we mine a genesis block.

Generate a Merkel Hash

Thankfully, this forum post: gives us a method to generate the Merkel Hash via the coin's test net feature. Right now would be a good time to do the following and copy your files out to your Github repository:

 barcoin% git add -A *
 barcoin% git commit -m "changes"
 barcoin% git push origin master
Doesn't it feel good to know you're using Github like a pro?

First Build

Now that you have a fresh copy with all of your cut and pasting uploaded to Github, we're ready to build a copy of our command line only version of the coin:

 barcoin% cd src/
 barcoin/src% make -f makefile.osx USE_UPNP=- (or makefile.unix if you're on Linux/BSD/etc)
The code should build cleanly if you've only changed what you're supposed to and you ahve the right dependencies installed. You'll end up with a single executable called the name of your coin with a d on the end if you're on Linux (i.e. barcoin (osx/windows) barcoind (Linux). "Stripping" the extra code will create a smaller file if you so desire:

 barcoin/src% strip barcoin (add the d on Linux, barcoind)
Now, we want to run barcoin from the command line using the -testnet switch like so:

 barcoin/src% ./barcoin -testnet (add the d on Linux, ./barcoind)
It will immediately fail on first run, throwing out an error like so:

 Assertion failed: (block.hashMerkleRoot == uint256("0x")), function LoadBlockIndex, file main.cpp, line 2031.
 zsh: abort      ./barcoin
We now have a Merkel hash wait, but where? Its is in your coin's "Application Data" directory. On Linux, that's in your home folder, then a .coinname like:

On OSX, it's going to be in your Library folder:
 /Users/username/Library/Application Support/barcoin
If you want to see it graphically, hold the option button and click the Finder's Go menu, then choose Application Support and the barcoin folder. On Windows it will be in the Application Data Roaming folder:
In this folder you'll find a few files this is also the folder you'll put your coin's .conf file when we're ready to mine it so remember how you got here. Now, open debug log and it will look like this:

Thanks to tyrion's amazingly helpful post, we can decipher this debug out put as so:

 b1753ec3845a48ddc4618bc595af6dc89dac328cd48f9f8db178df5dd3b302fc Block hashed using the non-existent Merkel, based on the pzTimestamp from main.cpp
 0000000000000000000000000000000000000000000000000000000000000000 Genesis block, no good because all the nNonces are set to 0 in main.cpp
 2fc1b7ef46270c053711fbae934cf7f83378efd4b3e158079451d9c6c90e4700 Valid Merkel Hash, generated using the epoch time in main.cpp
Now, take the valid Merkel Hash and insert it in to main.cpp:


 LINE 2031 assert(block.hashMerkleRoot == uint256("0x2fc1b7ef46270c053711fbae934cf7f83378efd4b3e158079451d9c6c90e4700"));
Genesis Blocks

Dang, we're cooking with gas now eh? How does one mine a genesis block? Luckily the code is already in the source to do just that so don't fret. Who gets the initial coins? Well, no one really there is a way to do it: but personally I leave them to cyber space as a token of good karma to the bit gods at the church of development (FinShaggy, this means you, mate.)

Testnet Genesis Block

Ok, now you don't need to re-upload to Github just yet, because we need to generate genesis blocks for our network first. With the Merkel hash in place, this line:


 LINE 2034 if (true && block.GetHash() != hashGenesisBlock)
if set to true (as above) will mine a genesis block upon the next time the program is run beginning with the nNonce in the code (0). Let's recompile the code with the new Merkel Hash:

 barcoin/src$ make -f makefile.osx USE_UPNP=- (or .unix, whatever)
Recompilation should be pretty quick as most of the files have already been built. Once its done, start it again using this command:

 barcoin/src$ ./barcoin -testnet
You will hear your hard drive start to churn and it will seem like the coin has frozen in the window but its not frozen, its mining a genesis block for the testnet based on your freshly working generated Merkel Hash. If you open the debug.log you'll see this in action:

Isn't that nifty? Its hashing a block happily, each nonce is ticking by. How long will this take? On an i7-2600 it can take 5-10 minutes. On a Core2Duo (like my iMac) it can take 20-30 minutes, maybe longer. Just let it do its thing, and go get some runts eventually it will find one that it likes. This time it will write it in to the testnet3 folder under your coin's conf folder in a file called debug.log:

 Assertion failed: (block.GetHash() == hashGenesisBlock), function LoadBlockIndex, file main.cpp, line 2065.
 zsh: abort      ./barcoin -testnet

Ah ha! See it there? There's a noonce and a genesis block hash, ripe for the plucking!

 block.nNonce = 440824
 block.GetHash = 5813d4cfab0eeda94a15d11c5e7d6895e667fbbe67c59ef9a1b3bc232c9a0b7f
Now, put these in to the main.cpp file:


 LINE 1984 hashGenesisBlock = uint256("0x5813d4cfab0eeda94a15d11c5e7d6895e667fbbe67c59ef9a1b3bc232c9a0b7f");
Yes, you need to leave the 0x in front of the hashes. You also need to enter the nNonce:


 LINE 2024 block.nNonce   = 440824;
Note that the sections of the main.cpp file we just edited correspond to the testnet and we haven't done the main net quite yet. This is because at this point, I usually get two systems up and running on the testnet to make sure they can mine coins and then I move on to the main net. Lets save our changes, and upload them to Github and then we'll move on to mining on the testnet:

 barcoin% git add -A *
 barcoin% git commit -m "changes"
 barcoin% git push origin master
Mining Testnet Coins

First things first, rebuild your coin's executable on your local PC:

 barcoin/src% make -f makefile.osx USE_UPNP=- (or .unix, whatever)
Now comes the part where you need two computers with distinct IP addresses. I find this easy to do with a Linux VPS and my home PC, so that's my example. Two machines on a LAN should work, and I believe 2 or more virtual machines should work too, as long as you're able to keep up with the IP addresses. Connect to your second machine and build the coin's file just as we did before since you sent the code to Github, may as well use your new elite github skillz:

 $ git clone
 cloning in to barcoin
 $ cd barcoin/src
 barcoin/src$ make -f makefile.unix (I'm on Linux here).
 barcoin/src$ strip barcoind
Now I'm ready to run it in testnet mode and with a connection to my "other" computer. This is kind of tricky, because you need to start the coin on both computers with the -connect=x.x.x.x variable, each with the IP of the other PC:

Home PC - iMac:

 barcoin/src% ./barcoin -testnet -connect= &
VPS - Linux:

 barcoin/src$ ./barcoin -testnet -connect= &
Add the & to the command will allow it to process in the background and allow you to continue to feed the coin commands without opening a second console window.

On the first run, it will complain about not having a .conf file:

 error: You must set rpcpassword= in the configuration file:
 /Users/username/Library/Application Support/barcoin/barcoin.conf
 If the file does not exist, create it with owner-readable-only file permissions.
 It is recommended you use the following random password:
 (you do not need to remember this password)
 If the file does not exist, create it with owner-readable-only file permissions.
Create this file, in whatever format you prefer, nano works great for this and assign an RPC user/password. If you want to use CGMiner/CPUMiner to mine solo later, make this something you'll remember. If you plan to only use the client's built in miner for solo mining, just cut and paste the auto generated info. This is the same file you may want to set up some of the bitcoin.conf commands in, here's a good reference:

On OSX this file is: /Users/username/Library/Application Support/barcoin/barcoin.conf
On Linux this file is ~/.barcoin/barcoin.conf
On Windows, this file is c:\users\username\appdata\roaming\barcoin\barcoin.conf
Side note: because I use a VPS for this, I don't really need to worry about port forwarding at that end. On the home PC, you will want to forward the port you chose for P2Pport in the cut and paste section to the PC you're using. For this example, that is port 55884.

Now start the coin again:

Home PC - iMac:

 barcoin/src% ./barcoin -testnet -connect= &
VPS - Linux:

 barcoin/src$ ./barcoin -testnet -connect= &
Now's a good time to brush up on the command line API calls syntax for interacting with the bitcoin client from this wiki page:

First you'll want to send:

 barcoin/src% ./barcoin getinfo
It should return something like this:

Home PC - iMac:

 barcoin/src%./barcoin getinfo                         
     "version" : 1000000,
     "protocolversion" : 60001,
     "walletversion" : 60000,
     "balance" : 0.00000000,
     "blocks" : 0,
     "connections" : 1,
     "proxy" : "",
     "difficulty" : 0.00024414,
     "testnet" : true,
     "keypoololdest" : 1369621665,
     "keypoolsize" : 101,
     "paytxfee" : 0.00000000,
     "mininput" : 0.00010000,
     "errors" : ""
The other side should look the same and the numbers should match. Note that testnet doesn't verify checkpoints, so they should connect pretty easily (oooh, that's the 1BTC question, but more on that in a bit the other side:

VPS - Linux

 /barcoin/src$./barcoind getinfo
     "version" : 1000000,
     "protocolversion" : 60001,
     "walletversion" : 60000,
     "balance" : 0.00000000,
     "blocks" : 0,
     "connections" : 1,
     "proxy" : "",
     "difficulty" : 0.00024414,
     "testnet" : true,
     "keypoololdest" : 1369622277,
     "keypoolsize" : 101,
     "paytxfee" : 0.00000000,
     "mininput" : 0.00010000,
     "errors" : ""
Lovely, they line up and each have a single connection. Now we can make one of them (or both) begin generating coins by using the following command:

 barcoin/src% ./barcoin setgenerate true 16
The number is how many threads of your processor you want to devote, at the insanely low difficulty we're starting out with, this should be plenty to generate a few blocks. You won't see the results in real time, rather you'll need to issue the following command and evaluate the info:

 barcoin/src% ./barcoin getmininginfo
     "blocks" : 0,
     "currentblocksize" : 1000,
     "currentblocktx" : 0,
     "difficulty" : 0.00024414,
     "errors" : "",
     "generate" : true,
     "genproclimit" : 16,
     "hashespersec" : 1432,
     "networkhashps" : -9223372036854775808,
     "pooledtx" : 0,
     "testnet" : true
Success! See that hashespersec? The internal scrypt miner is now doing its thing and making you some blocks. You'll have to issue the getmininginfo command a few times before it starts to count up in the block count. In just a few minutes you should be able to see:

 barcoin/src$./barcoind getmininginfo
     "blocks" : 1,
     "currentblocksize" : 1000,
     "currentblocktx" : 0,
     "difficulty" : 0.00024414,
     "errors" : "",
     "generate" : true,
     "genproclimit" : 16,
     "hashespersec" : 1376,
     "networkhashps" : 32,
     "pooledtx" : 0,
     "testnet" : true
Woah doggie, we have blocks. Now verify that your other sees the blocks by doing a getinfo on your other computer:

barcoin/src%./barcoin getinfo

     "version" : 1000000,
     "protocolversion" : 60001,
     "walletversion" : 60000,
     "balance" : 0.00000000,
     "blocks" : 1,
     "connections" : 1,
     "proxy" : "",
     "difficulty" : 0.00024414,
     "testnet" : true,
     "keypoololdest" : 1369621665,
     "keypoolsize" : 101,
     "paytxfee" : 0.00000000,
     "mininput" : 0.00010000,
     "errors" : ""
Well, whatta ya know? Whatta ya say we mine some mainnet coins?

Main Net Genesis Block

So really all we need to do now is update main.cpp with a new epoch time, in the main net section this time and mine a genesis block the similarly to the way we did it on testnet. First, stop the coind from running on both your local and remote computers by issuing the command:

 barcoin/src% ./barcoind stop
 Barcoin is stopping
Next, go back to your development PC and edit main.cpp with a new block.nTime:


 LINE 2017 block.nTime    = 1369623856; //epochtime
Now, recompile the coin again from the command line:

 barcoin/src% make -f makefile.osx USE_UPNP=- (or .unix, whatever, ha!)
Now run the coin again, but this time don't include the -testnet switch:

 barcoin/src% ./barcoin &
It will again seem to be frozen while it mines the genesis block and your processor will likely go to 100% utilization. Be patient, this took Satoshi 6 days or some shit, right? Again, if you have a Mac, watching it mine with the system log viewer is pretty fun and then Success:

Now, we just do the same as we did on the testnet, and make these changes to main.cpp:


 LINE 32 uint256 hashGenesisBlock("0xbf9385c680c3a7aec778b6dcf87dbfb105369d55143fc99ebe86f469cd53ddca");
 LINE 2019 block.nNonce   = 1345972;
 LINE 2034 if (false && block.GetHash() != hashGenesisBlock)

Changing line 2034 to false will keep clients from trying to hash their own genesis block should something be awry. One more file to change:


 LINE 27 (         0, uint256("0xbf9385c680c3a7aec778b6dcf87dbfb105369d55143fc99ebe86f469cd53ddca"))
This is the "trick." Remember I said, there was a trick? This is it. Hash 0 in this file needs to be set to the genesis block hash, so do it and rejoice as you've now nearly finished creating your clone! Should you want to make your coin "legit" you'll want to revisit this file in the future and add other checkpoints in to it but that's a bit we'll save for the end of the guide. Lets send our changes to Github before we build:

 barcoin% git add -A *
 barcoin% git commit -m "changes"
 barcoin% git push origin master
Ok, we're ready to rebuild on the first pc:

 barcoin% cd src/
 barcoin/src% make -f makefile.osx USE_UPNP=- (or .unix, blah...)
 strip barcoin
Now on the second pc (assuming its Linux here):

 ~$ cd barcoin
 barcoin$ git pull
 updating git...wait wait...done!
 barcoin$ cd src/
 barcoin/src$ make -f makefile.unix USE_UPNP=-
 strip barcoind
Ooo laa laa, we're done here. Now we can mine us some coinz!

Mining Main Net Coins

The process here is the same as the testnet, but without the -testnet switch. Start'er up:

Home PC - iMac:

 barcoin/src% ./barcoin -connect= &
VPS - Linux:

 barcoin/src$ ./barcoin -connect= &
Verify with getinfo:

 barcoin/src%./barcoind getinfo                   
     "version" : 1000000,
     "protocolversion" : 60001,
     "walletversion" : 60000,
     "balance" : 0.00000000,
     "blocks" : 0,
     "connections" : 1,
     "proxy" : "",
     "difficulty" : 0.00024414,
     "testnet" : false,
     "keypoololdest" : 1369627515,
     "keypoolsize" : 101,
     "paytxfee" : 0.00000000,
     "mininput" : 0.00010000,
     "errors" : ""
Get a new address:

 barcoin getnewaddress
Start one of them (or both of them mining) and verify it:

 barcoin/src%./barcoind setgenerate true 16
 barcoin/src%./barcoind getmininginfo
     "blocks" : 0,
     "currentblocksize" : 1000,
     "currentblocktx" : 0,
     "difficulty" : 0.00024414,
     "errors" : "",
     "generate" : true,
     "genproclimit" : 16,
     "hashespersec" : 1417,
     "networkhashps" : -9223372036854775808,
     "pooledtx" : 0,
     "testnet" : false
Ooooooh myyyyyy gooooooooood, right? Its making blocks of our new Barcoin (or is it a BAR to consolidate your digital wealth? I mean, shoot, there's only a weeks worth at pump and dump mining rates right?) Soon you will see: "blocks" : 1, and then that number will start to climb. Now's the time you could set up the barcoin.conf client to accept connections from your LAN and point your dualie-7970 boxen at it or perhaps a minerd. Its ready to rock and roll at this point.

Things to remember:

You're basically done here. The command line version can do everything the -Qt can.
Blocks take 120 confirms, so you'll need to leave a system mining even at just a few hashses to keep your network going. I like to leave my VPS mining at just a few Kh/s and use it as the seed node so that the network is always confirming even if its very slow.
You're basically done here. But no, you're not lets make some GUI wallets.
Compiling the -Qt Wallets

Ok, so this will make or break your coin if you plan to distribute it. Before I go deep in to this, know that the source code for foocoin is customized to make building as easy as possible on Windows (the hardest system to build for). It is also fairly easy to build a Mac version, but at this point I'm having trouble redistributing the Mac versions with the other PC having the same dependencies installed. As for Linux, surprisingly enough, its the easiest to build for and if you installed all the dependencies from the top section of the guide you'll be able to knock it out with two commands.

Mac OSX -Qt

I'm starting with this one simply to go inline with dependencies order above. In order to keep things tidy on my iMac I created a virtual machine loaded with OSX 10.6.8, Snow Leopard. This was pretty straight forward using VMWare Fusion. After install and software updating, I installed XCode 3.2.6, which contains a working non-llvm version of gcc and its free from Apple here: A simple install, no frills, make sure all the objects are checked for installation.

Next, I installed MacPorts this version: and then the dependencies listed in the first section ala:

  xcode%sudo port install boost db48 qt4-mac openssl miniupnpc git
After a bit of time, all goodies are installed so we'll clone the coin's software in the regular fashion:

 xcode% git clone
 xcode% cd barcoin
Now, something a tad different this time, we need to run qmake instead of make. Do that like so:

 barcoin% qmake "USE_UPNP=-"
Yes, you need the " " around USE_UPNP=- and yes, this may produce some strange looking results, something like this:

 Project MESSAGE: Building without UPNP support
 Removed plural forms as the target language has less forms.
 If this sounds wrong, possibly the target language is not set or recognized.
Now, lets build it:

 barcoin% make -f Makefile
Go, go, go, do not look back. After a bit you'll see it finish and an icon should appear in the barcoin folder:

Now launch that and voila! A Mac barcoin wallet:

Just like the Windows and Linux wallets, you may want to add addnode=x.x.x.x where the x.x.x.x is the IP of your seed node. This won't be needed after a few clients begin connecting to the network, eventually they will begin talking to each other via IRC.

Linux -Qt

This is by a long shot the easiest wallet to compile, but its hindered by two things for distribution: Linux has very small market share, though for a personal or club coin, what the hell right? and Most Linux users will compile their own software so you'll not likely get far distributing a Linux executable (as well you shouldn't). My example here is based on Debian and should equate to most Debian/Ubuntu flavors.

Now, since we already built a system and installed the dependencies in the first bit wait, you didn't? You did it all on Windows? Nice. You should write a guide next time! Now, where were we oh yes, you already have a working coin building system, so lets just stick with it. First things first:

 cd ~/barcoin
 barcoin% qmake "USE_UPNP=-"
Thinking, thinking, output:

 Project MESSAGE: Building without UPNP support
 Removed plural forms as the target language has less forms.
 If this sounds wrong, possibly the target language is not set or recognized.
Now, build it:

 barcoin$ make
Yeah, seriously, that's it. Just 'make.' Ha Debian is so beautiful, is it not? Ok now after a bit of churning and burning it will finish.

Windows -Qt

This is the trickiest one to crack of the GUI wallets. I am going to detail how I got this to work and offer you an easy way to get the dependencies in an attempt to make this work for you too. That said, it may not and I've already said I won't do tech support. So here's the deal. I got this to work and then duplicated it on a second machine to ensure it wasn't a fluke! Most of the information needed to compile the basic coind.exe or GUI wallet is in this thread: Unfortunately nothing is as easy as it seems, and although the MinGW and QT installs went fine, I couldn't compile it without a few tweaks to the .pro file.

If you don't want to install these dependencies by hand, clone in to C:\ If not, here's how to do it manually:

Begin by installing MinGW32 from here: Go ahead and install the whole bloody thing if you like, but at least the "C Compiler", "C++ Compiler" and "MSYS Basic System" components. Everything else leave stock, next, next, next kind of thing.

Next, install ActivePerl 32 or 64 bit from here: Again, standard install, next, next, next and so forth.

Now open the "MinGW System Shell" from Start - Programs and you'll basically have a Linux prompt:

Now make a /c/deps folder to keep our files in:

 $mkdir /c/deps
 $cd /c/deps
Now download the following files and put them in C:\Deps:

Install it like so:

 /c/deps$ tar xvfz openssl-1.0.1e.tar.gz
 /c/deps$ cd openssl-1.0.1e
 /c/deps$ ./config
 /c/deps$ make
Berkeley DB 4.8:
Install it like so:

 /c/deps$ tar xvfz db-4.8.30.NC.tar.gz
 /c/deps$ cd db-4.8.30.NC/build_unix
 /c/deps$ ../dist/configure --disable-replication --enable-mingw --enable-cxx
For this one, open a regular command (CMD) window and do the following:

 cd \deps\boost-1.53.0\
 bootstrap.bat mingw
 b2 --build-type=complete --with-chrono --with-filesystem --with-program_options --with-system --with-thread toolset=gcc stage
For simplicity's sake, my versions are simply named deps\boost; deps\ssl; etc. If you build your own, either rename the folders in \deps OR change the paths to suit your changes in the file. Remember to change the Boost suffix too to match the version you compile with!

At this point you're ready to build normal non-Qt coin wallets on windows. Go ahead and check the thread at the beginning of this section if you'd like to know how. We're making a GUI though:

Next, install the Qt-MiniGW32 4.8.4 Build from here: Again, all normal installation options, next next next you know the drill. Once QT is installed, you will find a program in Start - All Programs - Qt by Digia - Qt Command Prompt:

Fire it up and it will look pretty much like a DOS box:

Now since we don't have git on this our Windows computer (you can install it if you want, Cygwin is a good way to do that) you must download the file from and extract it to the PC. For this example, we'll put it in c:\. One last thing we need to do before we compile for Windows. We need to edit the "" file to enable the Windows libs, includes, and correct ordering for some of the syntax:


 #windows:LIBS += -lshlwapi
 #LIBS += $$join(BOOST_LIB_PATH,,-L,) $$join(BDB_LIB_PATH,,-L,) $$join(OPENSSL_LIB_PATH,,-L,) $$join(QRENCODE_LIB_PATH,,-L,)
 #LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX
 #windows:LIBS += -lws2_32 -lole32 -loleaut32 -luuid -lgdi32
 #LIBS += -lboost_system-mgw46-mt-sd-1_53 -lboost_filesystem-mgw46-mt-sd-1_53 -lboost_program_options-mgw46-mt-sd-1_53 -lboost_thread-mgw46-mt-sd-1_53
IF YOU BUILT YOUR OWN dependencies, then also change the paths in the file above to suit their locations, use / instead of \, yea its odd. Now go back to your Qt Command Shell window and build the same way we built on the other platforms:

 c:\Qt-Builder> cd \barcoin-master\src
 c:\barcoin-master\src> qmake "USE_UPNP=-
 c:\barcoin-master\src> make -f Makefile.Release
Wait for a bit and once its done, you'll find a folder called "release" under the main barcoin-master folder containing the .exe and a .cpp file:

This isn't enough to redistribute though, to make the file run you'll need to include the QT and gcc libs along with the file. I've put them on a git repository here: Just download the 6 files and insert them in to the "release" folder along with the .exe and .cpp:

To redistribute, simply rename the "release" folder and zip it up! You can now run the .exe file on Windows:

Woah, hey look at that, we already have a balance! Actually, I'd sent the 10 BAR to this computer from the one I left mining all night. If you don't have many connections to the network, you may need to add a line like so to your %appdata%\barcoin\barcoin.conf:

If you created a seed node, it should connect but if not, simply add a node. Once a few clients begin connecting they will use IRC to connect to each other, so the addnode should only be needed for the initial wallet connections.

2  Alternate cryptocurrencies / Altcoin Discussion / How To Create Your Own Digital Currency! Get Paid!!! on: January 18, 2014, 03:33:22 AM
* To get paid sign up with my referral link for Digital Ocean: Read more below and PM me to get paid.

Hello Everyone,
Some of you guys may know me from m previous guides or other things that I have written. Throughout my time with keeping my guides running, I have gotten multiple requests for a guide for how to create your own Digital Currency, so I have decided to finally sit down and write one. Here it is I hope you enjoy it!

To manage your coin you need some cloud servers. You can get cloud servers with any provider but for the first timer I highly recommend Digital Ocean due to how it works. This guide is designed for Digital Ocean. Plus if you sign up with my referral link and spend $10, I'll give you $4 in a currency of your choice or via. Paypal in order to help you cover your costs. Sign up here: PM me to get paid. Or you can just let it run and PM me whenever you total $10 in billings getting paid then.

After you have your account you need 2 droplets to create your coin. I personally recommend 2 of the $40/month droplets as I find those are what work best. Name and location don't really matter. Once you create your droplet you will be emailed the necessary information to log in. Also make sure to use Debian 7.0 x64 as your image.

First things first. You'll need some source code. Since I doubt you can write it from scratch, you should be happy to know there are a bazillion different options in the scrypt-coin family for you to clone and alter. The most excellent research coin is good, SmallChange, by lightenup. His git diff output: is nearly enough information to completely create your own alt-coin and as such should be lauded. His code is copy & pasted litecoin with some changes but he added some good comments throughout.

For the purposes of this tutorial and to preserve a "clean" copy of the SMC code, foocoin has been created: This guide will show you how to turn 'foo'coin in to 'bar'coin and you can take it from there. Enough has already been changed to make this coin compile-able if you follow this guide. If you'd prefer to start with the original SmallChange code, it is here: or you could use the Litecoin, Franko, YAC, CHN, MIN, whatever source we'll change enough of it to make it work.

Now you need to find a coin name. You'll need to go to to see if the name is available If you get an error page where what your looking for isn't found then you know the name is available. Once you know your coin create a username email (normally and whatever password you want - just make sure to make it secure!

Now you want to make one of those url's everyone can pull code from and use it. In the upper right hand corner next to your username click Create Repository. Fill in the blanks and you're done. Take note of the information.

*Note for the rest of this tutorial you will need either a Mac or Linux machine or Cygwin.*

Yes, you need one of them. For this tutorial, I will be using a MacBook with OSX 10.8.something and a Debian 7.0 64 (you can use 2 x 2 CPUs from DigitalOcean instead of Mac). I suppose you can use Cygwin, but I prefer the *nix's to Windows any day and you may as well learn one more thing too, right? Shoot, if you need a good LiveCD with the dependencies already built in that is set up to be run in a VMWare session, try CDEbian. Otherwise this guide uses Debian which means most mainstream clones should work (i.e.: Ubuntu, XUbuntu, Mint).

Setting up a PC or VM with Linux or OSX is outside the scope of this tutorial, but suffice to say I can vouch for VMWare and its ability to run multiple VMs simultaneously and its ability to virtualize OSX 10.6.x. You will need to install some dependencies on which ever OS you choose to be able to build the daemon and -Qt wallet.

Dependencies for OSX

The easiest way I've found to install dependencies on OSX is to use MacPorts or Homebrew. Personally, I like MacPorts better than Homebrew, but its simply because MacPorts installs in /opt (where I think it should go) and because MacPorts offers universal builds by default. If you prefer Homebrew, the formulas are the same, but I'd recommend building with the 32-bit flag. For the purpose of this tutorial, we're going to use MacPorts.

One needs to install the following dependencies:

boost (C++ libraries)
db48 (Berkeley DB 4.Cool
qt4-mac (Open Source QT 4.8.4, includes qmake)
openssl (ssl dev libraries)
git (to move source back and forth to the repository)
miniupnpc (UPNP dev libraries, optional honestly I say skip this crap)
After installation of the basic MacPorts for your version of OSX, this can be accomplished with this command:

 %sudo port install boost db48 qt4-mac openssl miniupnpc git
Once all of the dependencies are built and installed, the next step is to clone the source from git. In this example, I will be cloning foocoin, rename it, re-git initialize it, and push the initial copy out to Github to ensure git is working:
 %git clone
 cloning in to foocoin
 %mv foocoin barcoin
 %cd barcoin
 %rm -rf .git
 %git init
 initializing git repository in ~/barcoin
 %git add -A *
 %git commit -m "first commit"
 %git remote add origin
 %git push -u origin master
 username for barcoin
 password for **********

Now what did we just do? We cloned the existing source, deleted its link to git, reinitialized the folder for Github, added all the existing folders and files in to the repository, committed our changes (made them permanent and put them in the "Master" branch, renamed it in to our new *bigger *better *faster coin, set it back up to link to Github but to the *new* coin's account, and pushed a copy out to Github. Now if you go and look at your page it should look like so:

Oh, look at all that fresh source code just awaiting to be tweaked.

Dependencies for Linux

On Debian based Linux, dependencies and build requirements can be installed in a single command like so:

 $sudo apt-get install sudo apt-get install build-essential libboost-all-dev libcurl4-openssl-dev libdb5.1-dev libdb5.1++-dev git qt-sdk libminiupnpc-dev
This will install all the needed packages as apt is very smart. Once that's complete, the same bits as above should be applied:
 $git clone
 cloning in to foocoin
 $mv foocoin barcoin
 $cd barcoin
 $rm -rf .git
 $git init
 initializing git repository in ~/barcoin
 $git add -A *
 $git commit -m "first commit"
 $git remote add origin
 $git push -u origin master
 username for barcoin
 password for **********
Dependencies for Windows

Ugh, I knew you'd ask. Windows is tricker than it should be when it comes to building with the GNU toolchain. First, you'll need mingw32 installed and dependencies built by hand for each of the listed items above. You'll also need to customize your file with the location of those dependencies. To simplify this, I've already compiled and assembled the needed dependencies in to a nice Github repository for you. If either downloaded and extracted as c:\deps or git cloned to C:\, this pacakge: will give you everything you need to build foo(bar)coin using the source you've already got. More about building the long way when we get to the Windows client compilation bit a little further along in the project.

Now you're ready to Cut and Paste!

Search and Replace

Ahh, now we've come to the creative part. The bit where you change the things you want to change to make your coin yours. As this is a *cloning* tutorial, I am not going to focus on the intricacies of programming (I'm not qualified). I'm simply going to show you where to make the changes you need to make to get a coin up and running. For this step, I really prefer TextWrangler on my Mac. It allows for multiple file searching and replacing which makes this portion of the process go quite quickly. If you're going to set up a VM to build -Qt wallets for Mac anyway, you should/could simply install the dependencies above and build within OSX completely. TextWrangler is free.


TextWrangler will allow you to open an entire folder of files. Just open the program and choose File, the Open, highlight the "barcoin" folder and click Open:

Ahh, nice, all of the code in one easy to use interface. Be aware, that editing these files most certainly can be done via nano or Netbeans, or whatever other text editor, even Notepad I suppose. I just like this one, 'cuz of this next feature. Now we need to replace all instances of "FooCoin, foocoin, and FOOCOIN" in our source with "BarCoin, barcoin, and BARCOIN." Note the 3 different case settings most code has all three in it. To change this in TextWrangler, choose Search, then Multi File Search and select the "barcoin" directory:

Do this for all three case settings, or if you prefer e.e.cummings style, replace them all without the "Case Sensitive" box checked in one fail swoop. TextWrangler will show you the whole list of changed files and allow you to browse the changes once completed:

You will also want to replace all instances of "FOO" with "BAR." This is the 3 letter designation for your coin, like BTC or PPC. Finally, you will need to manually change the name of in the main source folder. Hey this is starting to come together, no?

Ports and Network Changes

Ok, now we need to give the new coin a unique port range to use. You'll need two ports, one for RPC connections (for miners to connect to) and one for P2P Connections. You can find a good list of reserved ports here: Most any ports will work assuming they are 1: Over port 1024 and 2: not used by something else. I'd suggest something in the high numbers, good examples include 56679 and 56680 or 12365 and 12366.

For this example we're going to use 55883 for RPC and 55884 for P2P. In the foocoin sources, these ports are already set, so go ahead and modify them using your text editor of choice.

Change the RPC/P2P Port in the following files:

src/bitcoinrpc.cpp: (RPC PORT)

 LINE 2893:  ip::tcp::endpoint endpoint(bindAddress, GetArg("-rpcport", 55883));
 LINE 3169:  if (!d.connect(GetArg("-rpcconnect", ""), GetArg("-rpcport", "55883")))
src/init.cpp: (P2P PORT + Testnet Port)

 LINE 235 "  -port= " + _("Listen for connections on  (default: 55884 or testnet: 45884)") + "\n" +
You can set the testnet port to any other random port, but remember what you set it to.

src/init.cpp: (RPC PORT)

 LINE 271 "  -rpcport= " + _("Listen for JSON-RPC connections on  (default: 55883)") + "\n" +
src/protocol.h: (Testnet Port + P2P PORT)

 LINE 22 return testnet ? 45883 : 55884;
You can also set an initial "seed node" or always on system that the new coin wallets coming online will check for additional addresses:


 LINE 1000  {"some website name", " or ip x.x.x.x"},
Coins Per Block/Block Intervals/Max Number of Coins

These changes are also pretty simple. Change the following lines of code in the following files:

src/main.cpp: (Number of coins per block awarded)

 LINE 831 int64 nSubsidy = 1 * COIN;
src/main.cpp: (How *should* blocks be found and how often difficulty retargets)

 LINE 837 static const int64 nTargetSpacing = 120; // FooCoin: 2 minute blocks
 LINE 836 static const int64 nTargetTimespan = 1 * 24 * 60 * 60; // FooCoin: 1 days
In this example, we want our coin to produce 1 coin blocks every 2 minutes and readjust difficulty once per day (1 day x 24 hours x 60 minutes x 60 seconds). You can adjust these, but know since this is a scrypt clone and we're not changing the starting difficulty this target rate will be skewed until the hash rate levels out on your new coin. This is tricky stuff and I don't quite understand all of it yet.

src/main.h: (Total number of Coins ever and Estimated # of Blocks per day)

 LINE 43 static const int64 MAX_MONEY = 10000 * COIN; // maximum number of coins
 LINE 550 return dPriority > COIN * 720 / 250; // 720 blocks found a day.
You'll need to do some math to figure out your blocks per day target based on how many coins you want to create over what timespan and how far apart your blocks are. I'm not doing all the work for you! This coin is set to give 1 coin blocks every 2 minutes, targeting 720 blocks per day through a maximum of 10,000 coins which means if mined hard, it will run out of coins in a week's time.

Address Starting Letter/Number

The first digit or letter of the new coin's address is determined by a base-58 code. You can see a list of all of the available options here: To change your coin's address edit this:


 LINE 280 PUBKEY_ADDRESS = 38, //Set the address first bit here
Icons and Splash Images

You will find all of the supporting images and icons for the wallet in the src/qt/res folder. There are two folders with icons you should pay attention to:


Foo and bar coins both use the default Litecoin imagery. You should use an image editing program of your choice (I like Photoshop CS3, but GIMP is also nice) to edit the images. If you want rounded icons/images, use transparent .png files. Also, don't forget to generate an .ico (Windows/Linux) and an .icns (Mac) icon file for your program. A great website I like to use for this is here:

Merkel Hash

The Merkel hash is the root of your coin's network. Its the hash that all of the blocks will be measured against and the basis for mining a genesis block. My methodology is to get a coin working on the testnet first and then the main network by building and testing in a staged progression. The Merkel hash is not actually the first thing you need to change though.

Epoch Time

Since Midnight UTC on New Years Day, 1970, Unix (or Epoch or POSIX) time has been used to coordinate various system calls and functions of Unix systems (and many others by default). Since this kind of time is simple seconds and doesn't account for leap seconds, its an easy way to calculate unique time-based values for programming. To that effect, the first thing one must change when building a new coin is the base time for the birth of the coin or the genesis of the coin.

This is set in two places in the code, one for the test net:


 LINE 2023 block.nTime    = 1300000000;
and one for the main net:


3  Alternate cryptocurrencies / Altcoin Discussion / Re: [DIME] Unique DimeCoin Giveaway! on: December 31, 2013, 11:51:39 PM
Would you mind posting this giveaway at I could help fund you if you do.
4  Alternate cryptocurrencies / Altcoin Discussion / Re: Sell Dimecoins (DIME) on: December 31, 2013, 11:51:00 PM
I would post this offer at in order to get more views for it.
5  Economy / Services / Re: Forum Posters on: December 31, 2013, 11:00:32 PM
whats the highest you will pay in btc for valuable post, with large word count?

Depends on what you mean by large post count. I am looking for someone to write a guide for how to make your own alternate currency and that guide would probably be pretty long. I would probably pay 0.015 BTC or more for a guide like that.
6  Other / Off-topic / Re: New Forum Advice? on: December 31, 2013, 10:58:55 PM
Make a lending sub-forum so that you can contain all panhandling chatter within an neat, organized framework.

I have a lending board, why do you think it would be advantageous to make it into a sub-forum?
7  Economy / Auctions / Re: KNC MINER 673 GH+ Auction 48 hour! on: December 31, 2013, 06:45:41 AM
8  Alternate cryptocurrencies / Altcoin Discussion / Re: Want To Buy Litecoin/Bitcoin/Infinitecoin on: December 31, 2013, 03:11:04 AM
post at, maybe you'll get some more replies there.
9  Other / Beginners & Help / Re: Hi, every one new to the forum but not to bit coin on: December 31, 2013, 02:57:28 AM
Welcome. If you want more help try posting about this at
10  Economy / Services / Re: Forum Posters on: December 31, 2013, 02:56:48 AM
make it .40 cents per and you got post!

Too high I can get it cheaper elsewhere, sorry.
11  Other / Off-topic / Re: New Forum Advice? on: December 31, 2013, 12:45:15 AM
Trying out the signature for marketing, what do you guys think?
12  Economy / Services / Forum Posters on: December 31, 2013, 12:44:15 AM
Hello Everyone,
I'm looking for forum posters for my website

Please PM me if you are interested, I'm looking for around 15 people. Payment is $0.15/thread and $0.08/post or BTC equivalent.
13  Other / Beginners & Help / Re: Finally someplace to post! How do you get access to other areas? on: December 31, 2013, 12:37:45 AM
When I joined it was 5 posts + 4 hours to gain access to the other areas but it sounds like you've already done the 4 hours part. Yes, newbie restrictions can be quite annoying, try visiting, we don't have any newbie restrictions there.
14  Other / Beginners & Help / Re: This forum is incredibly glitchy on: December 31, 2013, 12:36:46 AM
If you want a less glitchy or faster forum try
15  Alternate cryptocurrencies / Altcoin Discussion / Re: Is Cat coin *really* going to the moon? on: December 31, 2013, 12:36:11 AM
I don't think so I haven't heard about it before.

Discuss this more at
16  Other / Beginners & Help / Re: Crypto Mining Rig With Case $800+ to spend on: December 31, 2013, 12:34:47 AM
I wouldn't buy asics. Post your question at in the alt coin mining section and I'll provide you a build.
17  Other / Off-topic / Re: New Forum Advice? on: December 31, 2013, 12:10:08 AM
the forum looks nice-simple and easy to read. you did pretty good in sorting the topics. all you gotta do now is make more people know about it Grin

Thanks that's what I'm working on. Any advice for marketing it more. Funds are kinda limited for me but I would say I can put in roughly $100 for paid marketing. The thing is with services like adwords that's like 80 clicks so I'm looking for more effective things and currently focusing on free marketing.
18  Other / Beginners & Help / Re: Getting Ross Ulbricht his coins back and screwing the FBI on: December 30, 2013, 09:32:56 PM
In my opinion, it is a good thing he got arrested. That is also not the way bitcoin works.


I don't think what he was doing was right and I believe it was a good thing that he got arrested - I thought it was a bad image that whenever I read about bitcoins it was to buy drugs and I think the community will look way worse if you're reading about them spending effort to get a drug dealer who paid for murders among other things his money back. Plus its not like he can use the Bitcoins sitting in jail. I don't believe your fix would work and I'm certain that I and many other users probably don't want to spend their time and effort to allow him to get his coins back.

Discuss more w/ no newbie board restrictions at
19  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN][UNIC] Unicoin Launching January 1st at Midnight GMT-5 for the New year on: December 30, 2013, 09:27:41 PM
Please post about your project here for extra promotion Smiley I'll go make a basic thread for you soon and then adopters can post there.
20  Other / Off-topic / New Forum Advice? on: December 30, 2013, 09:18:51 PM
Hello Everyone,
I've just tried my hand at creating a new forum - one about digital currencies. The forum url is:

I was wondering if you guys could give me any advice about the forum and how I could improve it or how you would market the forum.

Thanks and I appreciate it a lot!
Pages: [1] 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 ... 53 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!