Bitcoin Forum
April 19, 2024, 08:16:51 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 3 4 5 6 7 8 9 10 11 »  All
  Print  
Author Topic: *** Complete Guide on How to Create a New Alt Coin ***  (Read 165864 times)
fisheater (OP)
Hero Member
*****
Offline Offline

Activity: 770
Merit: 605



View Profile
June 05, 2013, 02:12:45 AM
Last edit: March 24, 2014, 05:42:22 PM by fisheater
Merited by strasboug (5), ABCbits (2), kaedcoin (1)
 #1

Since there are so many garbage coins out there, I decide to create
this course to teach you how to create a new alt coin. It's so simple,
that I can usually do within 2 hours.

You need to have some basic knowledge of C++ programming. No need
to be an expert, but you need to understand the basic compiling errors
and how to fix them.

Follow the following steps to create a new alt coin:

Preparation Step:

Download the Litecoin full source code, you can find it in github, just
do a google, you'll find it.

If you use windows, follow the steps in this thread:
https://bitcointalk.org/index.php?topic=149479.0

set up environment and libs, and compile the Litecoin. If you are successful
in compiling it (and run it), then your environment is good.


Design your coin:

Now that you have env set up, before doing coding, you need to do some design of
your coin, this is simple math calculations, but you need them for parameters
in the coding.

Basically you need to determine what you want:
- name of the coin. Let's call it AbcCoin in our example. Also determine the symbol, we call it "ABC"
   in our example.
- block time: this is the average target time between blocks. Usually you set it between 15 sec and 2 mins.
   You can also do 10 mins if you want (like bitcoin), but it's too long imo.
- difficulty retarget time: this is important, since otherwise it could cause serious instamine problem.
   Usually it's between 1 hr to 1 day.
   (diff retarget time)/(block time) gives you how many blocks a diff retarget will happen. This is
   an important parameter to consider.
- what's the initial coin per block. People set it to 2 to 100, usually. You can set any you want.
   Also you can do coins per block based on the block number, or even randomly (like JKC/LKY etc).
- How long you want coins per block be halved. Usually it's 6 month to 3 years. But again you set whatever
   you like.
- Ports, you need two: connection and RPC ports. Choose the ones that are not used in common apps.
   You can google for a particular port usage.

There are some other things you may want to adjust, such as initial diffculty etc. But usually I don't want to bother with these.

Now with these parameters defined, one important thing is that you want to calculate how many blocks/coins
generated in a month, a year etc, and total coins ever will be generated. This gives you a good idea how overall
your coin will work, and you may want to re-adjust some parameters above.


Now the code change part.

Before you begin, copy the whole directory of Litecoin to Abccoin. Then modify the code in Abccoin.

Follow the below steps for code changes:

1. In Abccoin/src dir, do a search of "litecoin", and change most of them to "abccoin", note you may want
to do a case-sensitive replace. You don't have to replace all, but most should be replaced.
You can reference to smallchange code first commit
https://github.com/bfroemel/smallchange/commit/947a0fafd8d033f6f0960c4ff0748f76a3d58326
for the changes needed.

Note: smallchange 1st commit does not include many of the changes I will outline below, but it is a
good reference for what need to be changed.


2. In Abccoin/src dir, do a search on "LTC", and change them to "ABC".

3. Change the ports: use the ones you defined in coin design, and change in the following files:
- connection port: protocol.h and init.cpp
- rpc port: bitcoinrpc.cpp and init.cpp

4.  Change parameters, all in main.cpp:
   - block value (in GetBlockValue())
   - block time (right after GetBlockValue())
   - diff retarget time (right after GetBlockValue())
   - adjust the diff retarget scale to avoid instamine (in GetNextWorkRequired())

for the last item, refer to Luckycoin code, you will see how this is done.
For random coin values in block, refer to GetBlockValue() function in JKC and Luckycoin code.

5. According to your coin design, adjust the value in main.h:
   - max coin count
   - dPriority

6. Change transaction confirmation count (if you want say 3 confirmation transaction etc) in transactionrecord.h
also change COINBASE_MATURITY which affects the maturity time for mined blocks, in main.h/cpp.

7.  Create genesis block. Some people get stuck there, it's really easy:
- find LoadBlockIndex() function, inside, change:
    - paraphrase (pszTimestamp) to any recent news phase.
    - get the latest unix time (do a google), and put in block.nTime.
    - set any nNonce (doesn't really matter)
you can change the time/nonce for testnet too, if you want to use it.

After you are done, save it. Now the genesis block will not match the hash check and merkle root check, it doesn't matter.

The first time you run the compiled code (daemon or qt), it will say "assertion failed". Just exit the program, go to
config dir (under AppData/Roaming), open the debug.log, get the hash after "block.GetHash() = ", copy and paste it to the beginnig of main.cpp, hashGenesisBlock. Also get the merkle root in the same log file, paste it to the ... position in the following code, in LoadBlockIndex()
Quote
       assert(block.hashMerkleRoot == uint256("0x..."));

recompile the code, and genesis block created!

BTW, don't forget to change "txNew.vout[0].nValue = " to the coin per block you defined, it doesn't matter to leave as 50, just be consistent with your coin per block (do this before adjust the hash and m-root, otherwise they will be changed again).

Also you need to change the alert/checkpoint key, this depends on the coin type and version, you can find it in main.cpp, main.h, alert.cpp and checkpoint.cpp.

8. Set the correct address start letter in base58.h. You may want to do some trial and error to find the letter you want. I never can calculate precisely the letter location.

change corresponding "starts with " in sendcoinsentry.cpp
change example in signverifymessagedialog.cpp

9. Checkpoint: you want to disable the checkpoint check initially, otherwise you may get stuck.
You have multiple ways to disable it, my way is:
- open checkpoints.cpp
- there are 3 functions, comment out the normal return, and make them return either true, 0, or null, like this:
Quote
   bool CheckBlock(int nHeight, const uint256& hash)
    {
        if (fTestNet) return true; // Testnet has no checkpoints

        MapCheckpoints::const_iterator i = mapCheckpoints.find(nHeight);
        if (i == mapCheckpoints.end()) return true;
        // return hash == i->second;
      return true;
    }

    int GetTotalBlocksEstimate()
    {
        if (fTestNet) return 0;
   
        // return mapCheckpoints.rbegin()->first;
      return 0;
    }

    CBlockIndex* GetLastCheckpoint(const std::map<uint256, CBlockIndex*>& mapBlockIndex)
    {
        if (fTestNet) return NULL;

        BOOST_REVERSE_FOREACH(const MapCheckpoints::value_type& i, mapCheckpoints)
        {
            const uint256& hash = i.second;
            std::map<uint256, CBlockIndex*>::const_iterator t = mapBlockIndex.find(hash);
            if (t != mapBlockIndex.end())
                // return t->second;
            return NULL;
        }
        return NULL;
    }

Now this is disabled. Once everything works, you can premine 50 blocks, and extract some hashes and put them in the checkpoints, and re-enable these functions.

That's about it. You can do compilation all the way along, no need to do in the end, you may get a lot compilation errors.

Oh, icons:

10. Find a nice image for your coin, then make 256x256 icons/images. You have 5 images to replace in src/qt/res/icons, and 1 to replace (splash) in src/qt/res/images.

11. Oh also edit those files in qt/forms. These are files for help etc, better make them look nice, display your coin names than litecoin ones.

12. Now for compilations:
- qt: modify the .pro file under abccoin, and follow the make process in
https://bitcointalk.org/index.php?topic=149479.0

- daemon: update one of the makefile for your system, and in my case I use mingw32 shell to make.


That's it, voila, you have your own alt coins!!

1713514611
Hero Member
*
Offline Offline

Posts: 1713514611

View Profile Personal Message (Offline)

Ignore
1713514611
Reply with quote  #2

1713514611
Report to moderator
"This isn't the kind of software where we can leave so many unresolved bugs that we need a tracker for them." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713514611
Hero Member
*
Offline Offline

Posts: 1713514611

View Profile Personal Message (Offline)

Ignore
1713514611
Reply with quote  #2

1713514611
Report to moderator
1713514611
Hero Member
*
Offline Offline

Posts: 1713514611

View Profile Personal Message (Offline)

Ignore
1713514611
Reply with quote  #2

1713514611
Report to moderator
fisheater (OP)
Hero Member
*****
Offline Offline

Activity: 770
Merit: 605



View Profile
June 05, 2013, 02:13:17 AM
 #2

reserve
Hazard
Legendary
*
Offline Offline

Activity: 980
Merit: 1000



View Profile WWW
June 05, 2013, 02:14:52 AM
 #3

Missing some key parts, but I'm not gonna be the one to fill in the gaps for you.

arlington
Sr. Member
****
Offline Offline

Activity: 476
Merit: 250


View Profile
June 05, 2013, 02:15:44 AM
 #4

Missing some key parts, but I'm not gonna be the one to fill in the gaps for you.

Learn Hazard, your 0.5BTC has no business, lol Grin
dreamhouse
Hero Member
*****
Offline Offline

Activity: 1073
Merit: 666



View Profile
June 05, 2013, 02:18:52 AM
 #5

destroryed Hazard's business... heck fish, you revealed also all my secrets too, wth..

it is the complete list to create an alt coin, it shortens Hazard's learning curve.
dreamwatcher
Legendary
*
Offline Offline

Activity: 1064
Merit: 1000


View Profile WWW
June 05, 2013, 02:19:33 AM
 #6

8. Set the correct address start letter in base58.h. You may want to do some trial and error to find the letter you want. I never can calculate precisely the letter location.


https://en.bitcoin.it/wiki/List_of_address_prefixes   Wink
bitcoiners
Sr. Member
****
Offline Offline

Activity: 322
Merit: 250



View Profile
June 05, 2013, 02:27:58 AM
 #7

Most wont read this and be like...  Why isn't my coin worth more?  Look at the feathercoin idiots.
arlington
Sr. Member
****
Offline Offline

Activity: 476
Merit: 250


View Profile
June 05, 2013, 02:41:57 AM
 #8

Most wont read this and be like...  Why isn't my coin worth more?  Look at the feathercoin idiots.
lol, I still don't get why bitcoin worth more, everything is created from nothing, and it worth nothing.  Grin Grin Grin
fisheater (OP)
Hero Member
*****
Offline Offline

Activity: 770
Merit: 605



View Profile
June 05, 2013, 02:54:13 AM
 #9

Missing some key parts, but I'm not gonna be the one to fill in the gaps for you.
missing? lol.  Grin

I noticed in your coins many of the above-mentioned steps are missing, that's why your coins are all crappy ones.
Elwar
Legendary
*
Offline Offline

Activity: 3598
Merit: 2384


Viva Ut Vivas


View Profile WWW
June 05, 2013, 03:02:43 AM
 #10

When will AbcCoin be ready for mining?

First seastead company actually selling sea homes: Ocean Builders https://ocean.builders  Of course we accept bitcoin.
jgm_coin
Full Member
***
Offline Offline

Activity: 230
Merit: 100



View Profile
June 05, 2013, 03:09:57 AM
 #11

Most wont read this and be like...  Why isn't my coin worth more?  Look at the feathercoin idiots.
lol, I still don't get why bitcoin worth more, everything is created from nothing, and it worth nothing.  Grin Grin Grin


Its simple: Bitcoin is worth more because it has value.  Even the banks value bitcoin as of late.  New coins haven't got the track record to accumulate value yet.  Most wont ever accrue the trust.

Rent out your rig for up to 100% more than you can mine http://tinyurl.com/lc5axo2
hendo420
Sr. Member
****
Offline Offline

Activity: 420
Merit: 250



View Profile WWW
June 05, 2013, 03:27:08 AM
 #12

I'm still waiting on someone to make a gui to make alt coins. Pick your icon and set some values and hit create. Cheesy

ebmarket.co
DPoS
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250



View Profile
June 05, 2013, 03:33:56 AM
 #13

time to make RNG coin...  random values in everything fisheater said.. after every block created new values so no one can predict anything except of course RNG coin would be worth crappo

~~BTC~~GAMBIT~~BTC~~Play Boardgames for Bitcoins!!~~BTC~~GAMBIT~~BTC~~ Something I say help? Donate BTC! 1KN1K1xStzsgfYxdArSX4PEjFfcLEuYhid
fran2k
Hero Member
*****
Offline Offline

Activity: 784
Merit: 500


View Profile WWW
June 05, 2013, 04:09:17 AM
 #14

Oh man. We need a script that can do the whole thing Tongue

And then someone please make the metarandomcoin that makes random forks of itself.
arlington
Sr. Member
****
Offline Offline

Activity: 476
Merit: 250


View Profile
June 05, 2013, 05:24:51 AM
 #15

Oh man. We need a script that can do the whole thing Tongue

And then someone please make the metarandomcoin that makes random forks of itself.

good idea to do a script for it. Cheesy
justabitoftime
Full Member
***
Offline Offline

Activity: 154
Merit: 100


CoinTropolis


View Profile
June 05, 2013, 05:27:51 AM
 #16

Most wont read this and be like...  Why isn't my coin worth more?  Look at the feathercoin idiots.

Clueless.. just completely clueless.

LTCMINER2013
Newbie
*
Offline Offline

Activity: 19
Merit: 0


View Profile
June 05, 2013, 05:31:44 AM
 #17

is there any reason why all these alt litecoins have issues with the wallet?  After syncing  , it tries to sync back to the litecoin blockchain?
zerodrama
Sr. Member
****
Offline Offline

Activity: 364
Merit: 250


View Profile
June 05, 2013, 12:51:55 PM
 #18

Most wont read this and be like...  Why isn't my coin worth more?  Look at the feathercoin idiots.

Clueless.. just completely clueless.

It's easy to call people idiots. It makes it easier for us to actually reach our goals. Better signal to noise ration back at home base.

EASY CALCULATION FOR TRADES: 1 Million is 1x10e6. 1 Satoshi is 1x10e-8. 1 M sat is 1x10e-2. 100 M sat is 1. If 1 herpcoin = 100 derptoshi then
1 M herpcoin @ 001 derptoshi = 0.01 derpcoin, 1 M herpcoin @ 100 derptoshi = 1.00 derpcoin
Post Scarcity Economics thread https://bitcointalk.org/index.php?topic=3773185
digicoin
Legendary
*
Offline Offline

Activity: 1106
Merit: 1000



View Profile
June 05, 2013, 05:23:10 PM
 #19

People who creates scam coin are smart guys. People who mine scam coins are idiots.  Tongue
m3ta
Sr. Member
****
Offline Offline

Activity: 435
Merit: 250



View Profile WWW
June 05, 2013, 05:57:29 PM
 #20

just do a google

I LOLd.

Why the frell so many retards spell "ect" as an abbreviation of "Et Cetera"? "ETC", DAMMIT! http://en.wikipedia.org/wiki/Et_cetera

Host:/# rm -rf /var/forum/trolls
Pages: [1] 2 3 4 5 6 7 8 9 10 11 »  All
  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!