Have you ever thought about creating a custom cryptocurrency? It isnโt as challenging as it was a few years ago. The blockchain is now closely connected with many other technologies. Many startups are designed to contain their own blockchain and be powered by their own cryptocurrency.
There are two common ways to create a custom cryptocurrency. The first is to use a blockchain framework. The key disadvantage of this approach is that youโll need the right specialists. Youโll need someone with particular skills and experience and excellent knowledge of your chosen framework. And at the same time, you may not even need all of your frameworkโs features; you might only need something simple and oriented to payments.
The second way is to start your own cryptocurrency by forking an existing blockchain. This option works best if your platform needs all the power of its own cryptocurrency but you want to simplify the implementation, integration, and support.
In this article, we talk about forking two promising blockchains: Dash and PIVX. We learn differences between Dash and PIVX, then describe how to make your own PIVX fork and how to make a Dash fork to start your cryptocurrency. We also explain how to create your own masternode coin based on these blockchain networks and talk about their key features and peculiarities.
This article will be useful for blockchain developers curious about creating new blockchain forks and using them in their projects.
Contents:
Starting a custom blockchain with a fork
Forking an open-source solution is common practice when starting a custom blockchain platform. This is a rather quick and easy solution, since you donโt have to develop all the parts of the blockchain network from scratch.
When you use a fork, you already have a ready networking layer and full node software. In most cases, you also get additional features:
- Wallets (desktop and/or mobile)
- Supporting software
- A voting system
- And more
You get all the advantages of the initial platform but are free to add your own features, change the existing protocol, and combine technologies the way you need.
The best example of this approach is the Bitcoin family of alternative cryptocurrencies, or altcoins. A lot of altcoins were developed as Bitcoin forks: Bitcoin Cash, Bitcoin Gold, Litecoin, Dogecoin, and dozens of others. Bitcoin has proved itself a successful cryptocurrency, so it comes as no surprise that many platforms have chosen it as a model.
Among the numerous Bitcoin successors are two blockchains that stand out: Dash and PIVX.
Choosing a blockchain to fork: Dash or PIVX
Is PIVX better than Dash?
Before we start describing the forking process, letโs take a closer look at these two blockchains and compare PIVX vs Dash.
Dash is a direct fork of Bitcoin, while PIVX is a next-generation fork of Dash. Both are present in lists of top cryptocurrencies and are available for trading on most exchanges. The communities around these blockchains are loyal and stable. Alongside the original Bitcoin features, Dash and PIVX bring their own advantages, including:
- Less energy-consuming consensus algorithms
- Coin mixing for increased anonymity
- Masternodes software
While the importance of the first two points is obvious, masternodes require special attention.
Masternodes are a specific type of blockchain network participant. Usually, a blockchain network consists of two types of nodes:
- Simple nodes that have access to the network, have accounts, participate in payment operations, etc.
- Full nodes that carry the whole blockchain history, validate transactions, create blocks, and make the whole blockchain system operate.
Yet in Dash and PIVX, thereโs a third type of node โ a masternode โ thatโs equipped more heavily than full nodes. Alongside the operations run by full nodes, masternodes can facilitate special events on the blockchain. For example, Dash and PIVX masternodes govern voting events and execute anonymous operations and other protocol-specific operations.
Masternodes also provide an additional level of security for the network. They are ruled by active community members, and running a masternode requires a one-time deposit of a large amount of the networkโs native cryptocurrency. Decentralization and the collateral deposit encourage masternode operators to act honestly.
Furthermore, masternodes are a good way of incentivizing network members: since these nodes execute a lot of operations and need to be available 24/7, masternode operators get additional payments from every block reward alongside the regular miners. And since the code for Dash and PIVX is open-source, youโre free to add any features you like: communication protocols, network operations, payment and fee structures, consensus protocols, etc.
These advantages make Dash and PIVX the most preferable candidates for starting a custom cryptocurrency. Letโs look closer at each of these networks.
Dash overview
What is the Dash cryptocurrency? Dash, an altcoin forked from the Bitcoin protocol, is an open-source cryptocurrency with masternodes. It has inherited the original Proof of Work (PoW) consensus algorithm from Bitcoin. But in contrast to Bitcoin, Dash uses the X11 family of hash functions and not SHA-256. Thanks to the use of X11 hashing algorithms, the Dash consensus algorithm is alleged to be less energy-consuming and more secure than algorithms used in traditional PoW mining.
Before you decide to create a Dash fork cryptocurrency, you need to learn the main features of the Dash network that differentiate it from Bitcoin:
Letโs see whatโs so special about each of these features.
1. PrivateSend is a payment anonymization service. Similar to cryptocurrency tumblers, it uses a coin mixing strategy to keep transactions anonymous and untraceable. Each payment is passed through masternodes in a few rounds of mixing.
Within any given transaction, Dash coins from one user are always mixed with Dash coins of the same value from other users: 10 Dash with 10 Dash, 1 Dash with 1 Dash, and so on. First, a userโs wallet divides coins into predetermined denominations (10 Dash, 1 Dash, 0.1 Dash, 0.01 Dash, and 0.001 Dash) and places these denominations into new, automatically created wallet addresses. Then the userโs wallet sends a mixing request to a masternode.
To start a mixing session, the masternode needs three different participating wallets. Once the session is started, the participating wallets each create new wallet address for receiving mixed coins.
When the masternode has all sending and receiving addresses from all three users, it prepares a mixing transaction (see Figure 1). It mixes all addresses created by the participating wallets so that the true receiving addresses never match the sending addresses. For instance, in the example below, the owner of sending address 1 may own receiving addresses 5 and 6, but they could not own receiving address 4.
Since each participant in the mixing session only signs the input of their transaction, itโs impossible to track where the money goes. Once all participants have signed their inputs, itโs sent to the network.
The mixing process can be repeated up to eight times. The more rounds of mixing are performed, the harder it is to track the original sender of the coins. Note that masternodes take a fee for this service.
2. InstantSend is a service for instantaneous transactions. A transaction is checked through the consensus of randomly selected masternodes. Then itโs added to the subsequent block. As a result, masternodes ensure almost instant confirmation of transactions, so thereโs no need to wait for standard block confirmations.
Similarly to PrivateSend, masternodes take a fee for instant confirmation of transactions.
3. Decentralized Autonomous Organization (DAO) is a service in the network that allows all members of the community to make proposals for network development and vote on them. DAO is funded from block rewards: superblocks that are periodically generated provide a greater percentage of the reward to the DAO. So, in a way, the DAO turns the Dash network into somewhat of a self-regulating entity.
4. Dash masternodes provide Proof of Service and additional network security. They run all the services mentioned above and are incentivized for doing so by the block rewards they receive alongside miners.
5. SPORKs are a mechanism for safely deploying and activating new features after node software is updated. This mechanism was first implemented by Dash. SPORKs are used for ensuring simultaneous updates of the entire network so that new logic is applied correctly. SPORKs are activated with a special service message broadcasted from one of the developer addresses across the whole network.
Self-regulation, anonymity, quick payments, masternode services, and the SPORK mechanism are what make Dash one of the best blockchains for creating custom forks. However, there is a feature that may scare away some users โ the Proof of Work consensus algorithm. While consensus is implemented more efficiently in Dash than in Bitcoin, it still consumes a lot of time and energy.
PIVX, on the other hand, uses a more friendly consensus mechanism. Letโs move to considering this network.
PIVX overview
What is the PIVX cryptocurrency? Private Instant Verified Transaction (PIVX) is an open-source cryptocurrency that combines a set of features originating from other popular platforms:
- The wallet format and core technology comes from Bitcoin.
- The governance model with masternodes comes from Dash (the part that regulates funding the development of new coins).
- The Zerocoin protocol used for transaction anonymity is the same one used by Zcoin.
- The Proof of Stake (PoS) algorithm is the same one used by BlackCoin.
There have been two major periods in the history of PIVX: the PoW consensus period (early) and the PoS consensus period (current).
First, let’s talk about Zerocoin and PIVX. The PIVX altcoin is the first Proof of Stake cryptocurrency to use the Zerocoin protocol. This is a payment anonymization protocol and an alternative to the PrivateSend service used in Dash. It provides coins (zPIV) that are created anonymously. However, these coins arenโt really a separate cryptocurrency; theyโre just native PIV coins held in an anonymous account.
Like Dash, PIVX provides a set of special services and features:
Letโs take a closer look.
- Zerocoin anonymous payments. PIVX employs an improved version of the Zerocoin protocol as the basis for making transactions anonymous and untraceable. This protocol has a built-in mechanism for mixing coins to provide better confidentiality for user operations.
- Anonymous consensus algorithms. The PIVX blockchain uses a combination of two consensus algorithms โ a traditional Proof of Stake (PoS) algorithm and the Zerocoin Proof of Stake (zPoS) algorithm. This combination guarantees the anonymity of a userโs stake and block reward. As a result, even by analyzing the public ledger, you wonโt be able to determine that a user received certain coins from staking.
- DAO. Similarly to Dash, the PIVX community is self-governed and operates on a DAO thatโs funded from block rewards.
- Instant transactions (SwiftX). SwiftX is a PIVX alternative for the Dash InstantSend service. SwiftX technology ensures near instant confirmation of transactions while mitigating the risk of double spending.
- Masternodes. The masternodes system implemented in PIVX runs all special services, provides additional security, and is a great incentive program for blockchain users.
- SPORKs. Since itโs a Dash fork, it was inevitable that PIVX would also implement the SPORKs mechanism for ensuring safe deployment and activation of new features within the network.
While using a different set of consensus protocols, PIVX has all the capabilities of Dash. This blockchain is a bit more complex to manage and set up than Dash, but it provides a richer selection of privacy-oriented features. PIVX uses the PoS consensus mechanism, which makes it easier for new users to participate in the network. For this reason, it may be preferable for startups. Itโs also noteworthy that PIVX can be quickly integrated into different platforms and services and has a very lightweight mobile wallet.
Dash, on the other hand, has very clear governance and a high degree of self-regulation. Because of the consensus algorithm used, Dash may be harder to implement than PIVX, but itโs good if your platform needs only the coins without any additional services.
So the final choice between these two blockchains will fully depend on the purpose of your project. Nevertheless, both cryptocurrencies are simple to set up.
Now letโs see how to create a PIVX fork or Dash fork to start your custom cryptocurrency.
Creating a custom cryptocurrency
Below, we describe the basic process of starting your custom cryptocurrency by forking the PIVX or Dash blockchains. We go over the key parameters for creating cryptocurrency and describe some additional features that might be helpful in the process.
In this example, we don’t use a fork coin generator. Instead, your custom cryptocurrency will start with Dash or PIVX coin wallet fork development. In both cases, youโll need to use the Qt wallet inherited from Bitcoin. This wallet contains both the core logic (consensus and networking) and the user interface (Qt GUI and RPC API) for your cryptocurrency.
Now letโs talk about the ways you can make your newly created fork different from the parent blockchain.
Cryptocurrency uniqueness
At this point, you only have some copied open-source code. The first thing you need to do is make your coin different from its parent. This means your coin should have a unique name and its protocol should separate the inner communications from other networks, including the original network and all cryptocurrencies forked from it.
1) Coin name. PIVX and Dash have the name of the coin distributed all over the code, but some of these places arenโt easy to find. However, both blockchains have common places that should be corrected first. In particular, you should start with these three files:
- src/amount.cpp (with the CURRENCY_UNIT variable)
- src/bitcoinunits.cpp (the file with the currency name for console application)
- src/qt/bitcoinunits.cpp (the file with the currency name for the Qt GUI)
This is the first step in creating unique coins. Now you need to make sure your fork can distinguish its transactions from messages received from other networks.
2) Magic bytes. All nodes in the cryptocurrency network communicate with each other using a set of templated messages. As nodes need to distinguish system messages from all others, each message starts and ends with special symbols, known as message start bytes. Sometimes theyโre called โmagic bytes,โ as they represent completely random values chosen by the network creators.
For example, the Dash โmagic bytesโ are defined in the src/chainparams.cpp file:
pchMessageStart[0] = 0xbf;
pchMessageStart[1] = 0x0c;
pchMessageStart[2] = 0x6b;
pchMessageStart[3] = 0xbd;
This separator allows nodes to identify if a message comes from a node in another network.
Nevertheless, thereโs a problem: after the fork is created and launched, you may receive messages from the original network, since they have the same message identifier. So the second step in creating a custom cryptocurrency is to change the message start bytes. After that, your network will be unique, and your nodes will simply ignore traffic coming from other networks.
3) Address prefixes. The last thing you need to do in order to make your blockchain unique is change the user account address format. For example, Dash addresses and private keys start with the symbols โ7โ or โy.โ By modifying the base58 prefixes structure located in the src/chainparams.cpp file, you can set any prefix you want.
Next, weโll talk about the blockchain economics needed for customizing your newly created blockchain.
Blockchain economics
There are a number of parameters that network developers can alter to set the internal economics of the blockchain:
- Total supply
- Premined value
- Block reward value
- Masternode reward rate
- Masternode collateral amount
- Superblock
- Budget reward rate
Almost all of these parameters influence the genesis block and determine further blockchain development. So the values of these parameters should be chosen carefully.
1) Total supply is the maximum number of coins that can be achieved in the network. Note that there are some differences in the Dash and PIVX implementations of total supply. Dash has a fixed total supply defined in:
src/amount.h:
static const CAmount MAX_MONEY = 5000000000 * COIN;
PIVX, on the other hand, doesnโt have a fixed maximum total supply. However, it has a fixed reduction rate, which is regulated by the block reward.
2) The premined value is the number of coins available before the first block is mined. Itโs an arguable concept in relation to crypto economics, but you have options to choose from.
Dash has a premined value that can be defined in the genesis block. PIVX has an already burned premined value, but a custom value can be defined in the genesis block. For example, for Dash, the premined value is defined in the src/chainparams.cpp file as follows:
genesis = CreateGenesisBlock(1390666206UL, 3861367235UL, 0x1e0ffff0, 1, 50 * COIN);
3) The block reward is the number of coins paid to a miner for creating a new block. This value can be changed periodically in order to make corrections to the internal economics. The general practice is to halve the reward from time to time. Nevertheless, you can set any reward strategy you want, since both of the networks weโre talking about have the logic encapsulated in a single place:
- In Dash: The GetBlockSubsidy() function in the src/validation.cpp file and the consensus.nBaseReward function in the src/chainparams.cpp file
- In PIVX: The GetBlockValue() function in the src/main.cpp file
4) Masternodes provide multiple features crucial for the blockchain network, so they must be available 24/7, contain the block database, and support the network ecosystem. They provide the so-called Proof of Service for the network.
Since masternodes are an essential part of the network, masternode holders get part of the block reward as an incentive for their services. For example, 50% of the block reward can be granted to a chosen masternode, and the other part can be granted to the miner who produced the block or PoS wallet (depending on the consensus algorithm). This scheme works for both Dash and PIVX, with only small differences for budget payments.
As the blockchain network grows, the masternode reward can be changed. As for the block reward, you can provide a custom strategy for masternode payments. And itโs convenient that all the needed logic is located in a single place:
- For Dash: The GetMasternodePayment() function in the src/validation.cpp file
- For PIVX: The GetMasternodePayment() function in the src/main.cpp file
The second important part of the masternode strategy is the masternode collateral amount, which is provided once as a promise that the masternode holder will act honestly. For Dash, this value is 1,000 DASH, and for PIVX, itโs 10,000 PVX. However, you can easily set your own price for masternode hosting.
Nevertheless, the new value should be implemented carefully, as it affects a lot of masternode behavior checks, private transaction services, the processing of blocks, and other processes.
5) Superblocks and budget reward rate. Both Dash and PIVX are self-regulated networks with a general budget for ecosystem development. From the source code level, theyโre regulated by the generation of superblocks and by having a part of the block reward delegated to the budget.
A superblock is a special block that pays out funded budget proposals collected from ordinary blocks during the most recent period (usually a month). All these parameters โ the superblock budget, budget rate, superblock period, etc. โ can be modified to customize your regulation strategy.
Starting point for features
The main advantage of using a fork is that we can take advantage of all the features that have been developed in the Dash and PIVX networks over many years. To put it simply, we can reset the block counters for special blockchain enhancements to the values we want. For instance, we can make our new currency use the PIVX staking consensus from the second block instead of block 259200. And there are a lot of other possibilities:
- Use PoS instead of PoW for PIVX, or use a better consensus mechanism for Dash
- Start and regulate masternode payments
- Start and regulate budget payments
- Start the Zerocoin protocol for PIVX and PrivateSend for Dash
- Activate Bitcoin Improvement Proposal (BIP) and Dash Improvement Proposals (DIP) for Dash
- Activate SPORKs for existing protocol improvements in a custom order
- And more
You can force features to start from a chosen block (from the second or the hundredth or any other), or you can split the process of enabling new features into several stages defined by different block numbers. For example, itโs common practice for PIVX forks to start PoS consensus from the 200th block and to quickly pass the PoW stage. This change has almost no influence on the speed of network growth, while users can benefit from a stable network fueled with premined coins.
After all the initial changes are chosen and implemented, the new cryptocurrency is born. All genesis parameters are set, the strategy for enabling features is implemented, and now itโs up to the community to run the nodes and grow the network.
Still, there are a number of additional features you should pay attention to when starting a custom cryptocurrency.
Read also:
How to Build a Parachain on Polkadot
Additional features to consider when starting a custom cryptocurrency
Cryptocurrency development doesnโt end with the launch of the mainnet. After all the initial values are set, a lot of improvements can still be made to optimize the evolution of your fork. Letโs take a look at some of the features you can use to customize and improve your newly created fork.
1) Seed connection strategy
Every new node or wallet needs peers to connect to in order to download the current state of the blockchain and needs neighbor nodes to translate transactions to. Some nodes can be launched in seeder mode, which means theyโll regularly translate their up-to-date list of peers to all connected nodes.
The problem is that such behavior may lead to the overload of seeder nodes. So an advanced connection strategy needs to be implemented for both seeder nodes and ordinary nodes. For example, say every new node in the network tries to connect to a seeder node (for instance, the one that was hardcoded in the wallet code) and requests a list of relevant peers. The seeder sends the list, the new node accepts it, and then one of them immediately closes the connection without performing any other operations. After that, the new node can check the received list in order to connect to the first few opened peers and download the blockchain. In this way, we can decrease the load on seeders while making sure that all new nodes know where to get information on the state of the network.
Of course, any other custom strategy may be implemented.
Additionally, a special tool can be used to optimize networking and node connections: the Bitcoin network crawler, also called a DNS seeder. This tool actively checks all known nodes for availability and requests lists of active peers from each node. As a result, at any moment in time, the DNS seeder contains a relevant list of active and accessible peers. If used together with a seeder node, a DNS seeder can significantly increase the quality of the connection strategy. The Bitcoin network crawler is open-source and may be adjusted for any network from the Bitcoin family, including Dash and PIVX forks.
2) Improvements to the masternode economics
As we mentioned, we can set the block reward value, masternode reward rate, and budget reward rate in response to the network growth. But thereโs another way you can improve the network economy. You can implement a multi-tiered system of masternodes, in which masternodes at different tiers require different amounts of investment from users. Such an approach makes running masternodes more affordable for new users, as they can choose a tier that requires a smaller investment and, respectively, provides smaller rewards.
This strategy encourages nodes with low stakes but powerful hardware to support the system. And itโs another way to earn coins within the network, stimulating the inner economy.
However, when using this strategy, you may face the problem of fairly choosing the masternode to receive the reward. There are some ready approaches and formulas that solve this problem, so youโre free to choose one of them or implement a custom formula. Our team suggests building a weighted solution by analyzing the number of masternodes required at each tier to produce a fair distribution of chances for getting a reward.
But once again, youโre free to customize the block reward logic, masternodes reward rate, and other economic parameters the way you need in order to create your own unique ecosystem.
3) Private transactions
Dash and PIVX both have native mechanisms for private transactions. And both networks can be further customized for business purposes. You can control the maximum and minimum size of private transactions, customize the strategy of transaction processing by masternodes, adjust the obfuscation, and even change coin limits for private transactions. In addition, you can simply turn off private transactions to let your network form and grow, then turn them on later.
4) Blockchain protocol
All nodes in the network communicate with each other using internal messages, thus completing the network protocol. The most critical types of internal messages are:
- Ping messages
- Synchronization messages
- Announcement messages
- Broadcasting messages
Your set of critical internal messages should cover all operations that are necessary for the uninterrupted work of the blockchain. However, you may need some additional internal messages for extra synchronizations, state transmissions, or additional features for masternodes. In this case, you can make custom changes to the protocol. For instance, you may add new arguments to existing messages, set new message senders and listeners, add extra message pushes, and so on. The original network protocol inherited from Bitcoin is flexible and can be reinforced with extra features.
5) Custom API and commands
The software for each node needs an interface so users can communicate with the network. One way to solve this problem is to improve the user interface (UI) of the wallet, although this option will mostly work for common nodes and regular users.
Integration services need a more advanced API to communicate with the blockchain, as a lot of processes happen almost without any interactions with the user.
In turn, masternode holders and miners need to be able to communicate on the protocol level. Therefore, they need a number of additional commands:
- Console commands
- RPC commands for network communications
- Commands for custom messages
- Commands for getting statistics
- Commands for status updates
- Commands for masternode interactions
All these components have their separate place in the full-node software, so all of them may be customized.
6) Proposal generator
The Dash and PIVX networks are self-regulated, and you can control the internal budget mechanisms. A platform for proposals and voting is available on both networks.
Community support is an ordinary method of network development. An improvement is first announced to the whole community as a proposal, then changes are discussed, community members vote on them, and the cost of implementing those changes is paid from the network budget.
Alongside the native platform, you can use an open-source tool called proposal generator. It allows users to create proposals backed by network coins, vote for them by sending coins to a special address, and fund the development with the accumulated amount. With small modifications, this tool will match any Dash and PIVX forks. Plus, it can be enhanced with additional logic.
7) Centralized version service
Network updates are critical for the blockchain. Regular software updates are standard practice for preventing security issues, providing new features, and fixing current protocols. But the more frequently updates are provided, the more difficult it is to maintain network integrity.
If you want your nodes to reach consensus, they should be running the same versions of node software. If updates are slow, it can bring many issues, false-positive bans, failed transactions, and other random misbehaviors. You can speed up updates using a special centralized version service โ a custom application containing all the up-to-date versions of software for nodes, mobile wallets, special tools, etc. Every node in the network should periodically access this service to get the correct version of node software so it doesnโt conflict with other nodes.
8) SPORKs
The speed of network updates is the key problem when it comes to delivering new features to your blockchain. In the ideal case, updates should be performed simultaneously for all nodes. There are several ways to enable a new feature โ for example, through a radical software update (hard fork) or by binding the update to an exact block number. The problem is that each of these methods may produce forks because of the slow speed of updates.
This is where the alternative solution called a SPORK comes into play. Hereโs how it works:
- You announce an update to the community.
- Members of the community upgrade their nodes to the newest version but keep the new features deactivated.
- Once the majority of nodes have the latest software version installed, a special address makes a broadcast distribution of the initiating key (the SPORK key).
- All upgraded nodes turn on the new logic nearly simultaneously, depending on the speed of the networkโs internal messaging.
Almost all updates can be provided through the SPORK mechanism, and both Dash and PIVX support this technology and already have a history of successful SPORK implementation.
Conclusion
Simple solutions can bring a lot of profit when implemented the right way. We showed you how you can make your own altcoin with a PIVX fork or Dash fork. Building your platform upon these forks allows you to increase the speed of developing and launching a blockchain, simplify support for and integration of a custom cryptocurrency, and add new features freely. In this way, you can get all the advantages of having your own digital currency in a short time.
Despite the simplicity of fork development, you should make any changes to your chosen network fork carefully. Any illegal parameter change can lead to a network freeze, coin loss, and other critical problems. Our team has experience in both starting new cryptocurrencies and fixing critical mistakes in existing forks.
At Apriorit, we have vast expertise developing custom blockchain solutions. Our experts constantly keep an eye on new blockchain-related technologies and frameworks. Contact us to start discussing and implementing your ambitious blockchain project.