Introduction to the development technology of encrypted digital currency

Introduction to the development technology of encrypted digital currency

If you ask what is the most popular application among all blockchain applications, it must be cryptocurrency. Looking at various discussion groups related to blockchain, they discuss the market conditions of various currencies all day long. Even in technical discussion groups, in addition to some hot discussions, the most attention-grabbing topics are the rise and fall of local currencies and the ICOs of various tokens.

First of all, what is encrypted digital currency? First of all, it is a digital currency. Long before the emergence of Bitcoin, "digital currency", "virtual currency", "electronic currency" and so on had already appeared. In recent years, Bitcoin has emerged, and encrypted (digital) currency has officially been born, followed by thousands of encrypted digital currencies such as Litecoin, Ethereum, Dogecoin, BitShares, Ripple, Dotcoin, Yuanbaocoin, etc. Encrypted digital currency is a digital currency that uses cryptographic algorithms. It now refers to the English word Cryptocurrency. Its main features are decentralization, encryption and decryption technology, blockchain technology, and consensus mechanism. These technologies support each other and become a whole through the consensus mechanism, realizing the unique security, openness, and traceability of payment and transactions of cryptocurrency.

The core technical value of encrypted digital currency is blockchain. Just as various legal currencies are backed by national credit, blockchain carries credit, which is a credit that does not require physical collateral, government or financial institution guarantees. Without blockchain, various encrypted digital currencies, including Bitcoin, will become worthless.

There are currently three main scenarios for encrypted digital currency. One is digital currency, which is used for circulation and settlement; the second is to pay for specific operations in their respective networks, which is the fuel (Gas) burned in the process of transactions and use of related blockchain resources. Users only use their computing power to receive it in order to verify transactions and promote its development; the third is as an incentive mechanism and operating tool for product or community operations, that is, the role of tokens or virtual currencies. It can be said that encrypted digital currencies still play a big role in many decentralized applications.

Back to the topic of this time, Elwin briefly introduced his related development technology for encrypted digital currency, a typical application of blockchain.

1. Technical systems of well-known encrypted digital currencies

The following is an introduction to the technical systems of several well-known encrypted digital currencies:

Bitcoin :

Bitcoin technology, the symbol is BTC, the consensus algorithm is PoW, the SHA-256 encryption algorithm is used in the proof of work algorithm, the issuance method is mining, mining machine support, the total amount is constant at 21 million, the block time is 10 minutes, and the development language is C++.

Litecoin :

Bitcoin technology aims to improve Bitcoin algorithm technology. Its symbol is LTC, its consensus algorithm is PoW, and the Scrypt encryption algorithm is used in the proof-of-work algorithm. Its issuance method is mining, supported by mining machines, and its total amount is constant at 84 million. Its block time is 2.5 minutes and its development language is C++.

NXT :

NXT is a newly designed and developed binary token with the symbol Nxt. NXT is a pure POS coin that uses transparent forging to forge new blocks. Nxt is and is the first 100% proof-of-stake (PoS) electronic currency. Nxt no longer generates new currency by consuming a lot of resources to "mine", but "forges" blocks through the balance of existing accounts and rewards the account that successfully "forges" the block with transaction fees. This feature of the PoS algorithm makes it sufficient to run on small devices such as smartphones or Raspberry Pi. It has completed the distribution of all coins through IPO, with a total currency of 1 billion, a block time of 60 seconds, and a development language of JAVA.

Ethereum :

Ethereum technology, symbol ETC/ETH (different forks), consensus algorithm is PoW, the proof of work algorithm used is called Ethash (a modified version of the Dagger-Hashimoto algorithm), the issuance method is mining, mining machine support, support for running nodes on Raspberry Pi. Ethereum (ETH), as the encrypted fuel to promote distributed applications on the Ethereum platform, will be issued in a constant amount every year through mining. The annual issuance amount is 0.3 times the total amount of pre-sold Ethereum, the inflation rate decreases every year, the latest ETH block time is 16 seconds, and the development language is GO.

BitShares :

BitShares technology, the core ledger uses Graphite technology, the symbol is BTS, the consensus algorithm is DPoS, and the total amount of currency is 3.7 billion. It is released in a pre-mining manner (the initial BitShares BTS consists of two parts, one part is converted from PTS holders, and the other part is generated by mining, and the whole system is still constantly distributing dividends to investors holding BTS). BitShares distributes initial currency through regular sales, and Counterparty uses proof of burn (POB) to issue currency. In addition to being a transaction fee and incentive mechanism, BTS is also an important collateral for asset transactions. The block time is 3 seconds, and the development language is C++.

Ripple :

Ripple technology, symbol XRP, consensus algorithm is Ripple's own consensus mechanism, using OpenCoin (now Ripple Labs) original algorithm, total currency is 100 billion, released in pre-mining mode, half of which is owned by the founder, part of which is wholesaled to trading gateways, and a small part of which is gradually distributed to the public to promote the Ripple project, and developed in C++ language. Ripple is the world's first open payment network, through which any currency can be transferred, which is simple, easy and fast, and transaction confirmation is completed within a few seconds. It is worth mentioning that another branch of Ripple, Stellar (XLM), was created by Jed, one of the founders of Ripple. Stellar is the basic digital currency in the Stellar payment network created based on the modification of Ripple code, with a total of 100 billion and an annual increase of 1%. The Stellar payment network uses Stellar as the basic currency, and users can transfer any currency through it. The main difference from Ripple is that it targets all mass users and is currently in the stage of technical improvement.

Peercoin :

Bitcoin technology, symbolized by PPCoin, abbreviated as PPC, is named after P2P currency, i.e. peer-to-peer currency. The R&D team of PPC is the same as that of prime currency XPM, with strong technical strength and recognized by the industry. The mining method is a mixture of PoW proof of work and PoS proof of equity, supported by mining machines, with a block time of 600 seconds. PPC uses the SHA256 algorithm, which is improved and optimized on the basis of BTC. The greatest contribution of PPC is that it has created the original POS interest system to prevent deflation, with no upper limit on the total amount of currency, inflation of 1% per year, and the development language is C++.

Yuanbao Coin :

Developed by Taiyi Technology, the symbol is YBC. The original algorithm of Yuanbao coin originated from the relatively innovative digital currency YAC (YAC) at that time. The algorithm of YAC was modified based on PPC. The old Yuanbao used the POW algorithm based on Scrypt-Jane. In the second generation of Yuanbao coin, the POS interest recursive mechanism was adjusted. In the third generation of Yuanbao coin, the VPOW mechanism was invented innovatively. The new Yuanbao will completely stop POW mining and adopt a pure POS method to maintain the network. The distribution of coins will be carried out in the VPOW method. The VPOW distribution mechanism is also known as the virtual proof of work mechanism. Specifically, it refers to the use of the POW mining power of other coins to provide a fair digital currency issuance mechanism similar to POW for Yuanbao coin. By applying the VPOW distribution mechanism and the "Babao Pool" allotment plan, the buying of Yuanbao coin in the market has increased. Yuanbao coin has maintained more sufficient liquidity in the market, maintained the coin price, and completed fair distribution, which can promote the stable development of Yuanbao coin applications. The use of the master node distribution mechanism (master node distribution interest) can promote the robustness and high availability of the node network. The total amount of currency is 3 million, the block time is 60 seconds, and the development language is C++.

Dash :

Dash is a digital currency that supports instant transactions and aims to protect user privacy. It uses a branch of Bitcoin technology. The symbol of Dash is Dash. It is a coin born for anonymity. Through anonymous technology, transactions cannot be tracked and queried. There is no pre-mining. It is based on 11 encryption algorithms x11 algorithm (blake, bmw, groestl, jh, keccak, skein, luffa, cubehash, shavite, simd, echo) super secure hashing. Its block reward is also different from most altcoins. Its block reward is automatically determined by a formula. It adopts a hybrid mining method similar to PoW+PoS, and Masternodes receive 10% of the mining reward. The Dark Gravity Wave (DGW) difficulty adjustment algorithm is introduced for the first time to protect the blockchain network. The total amount is about 22 million, the block time is 2.5 minutes, and the development language is C++.

2. Basic technical system of encrypted digital currency

The core foundation of currency is trust. There is trust based on physical objects such as gold, and more trust based on state endorsement. Only when the value stability and value storage capacity of currency are guaranteed can currency gain people's trust.

In the virtual and digital age, in addition to solving the trust problem, network security is another key factor of digital currency. Any currency before Bitcoin, whether it is physical gold or electronic legal tender, does not have network security problems, but hacker attacks and cracking, technology monopoly and other unstable security factors have greatly restricted the development of digital currency. Digital currency has put forward higher requirements for financial security. On the one hand, the decentralized nature of digital currency has weakened centralized management and institutional supervision, and it is not easy to stop and correct problems (such as the handling of the DAO incident). On the other hand, innovative financial systems such as blockchain and digital currency have not experienced much wind and rain, and are slightly unable to cope with the impact of big data, hacker destruction, and network attacks.

The goal of encrypted digital currency is to establish a decentralized and automatically operated economic system, which should have seven characteristics: circulation, storability, offline tradability, controllable anonymity, non-forgeability, non-repeatable tradability, and non-repudiation. The blockchain, the technical basis of encrypted digital currency, is tamper-proof, and all ledgers are open, transparent and traceable. It basically solves these technical problems in the circulation of digital currency. However, for the real implementation and operation of digital currency, it has higher requirements for the two most critical core factors of trust and network security. These two factors are specifically in the technical foundation system of encrypted digital currency, which is the mechanism to support the issuance of this system and maintain network security. There are many mechanisms, such as PoW, PoS, DPoS, etc., each with its own advantages and disadvantages. PoW has high energy consumption and the risk of 51% attack, while PoS and pre-mining methods will result in a large number of coins being retained by the founders and a few people, the credit foundation is not solid enough, and the liquidity is uncertain. Therefore, a comprehensive mechanism is often adopted. At present, many studies believe that the coin of "proof of work mechanism Pow + proof of equity mechanism Pos/DPoS" is the most perfect. Which mechanism strategy you adopt will largely determine the prospects for the development of your digital currency.

3. Building a technical platform for encrypted digital currency

We have introduced several well-known encrypted digital currency technology systems above. Are you eager to build your own encrypted digital currency?

Elwin recommends two technical routes to choose from. One is to build your own native digital currency by building a blockchain platform, and the other is to create digital assets and digital currency based on the existing blockchain public network.

Solution 1 : Build your own native digital currency. From Bitcoin and various competing coins (altcoins), you can see that the technology systems used by these digital currencies are nothing more than Bitcoin, Ripple, BitShares and Futurecoin, or improved or branched versions of these technology systems. For these technology systems, you can refer to the introduction of several mainstream open source blockchain systems in Elwin's previous article "Introduction to the Mainstream Open Source Technology System of Blockchain". The uses of these native digital currencies mainly include: transactions and payments, exchange means, mortgage means, incentive mechanisms, proof of rights and interests, and resource control, etc. In addition, there are extensions with some characteristics of different blockchain systems.

In terms of mainstream blockchain open source technology systems, Elwin recommends five technology architectures: Bitcoin or its branches, Ripple, NXT, BitShares, and Ethereum. If you are a pure currency business and do not consider other derivative products and business expansion in the future, Bitcoin, NXT, and Ripple are more recommended. The code of each technology system can be modified in the source code of the relevant digital currency published on GitHub, so as to create your own encrypted digital currency.

To start making our first digital currency, we first need to download the source code of a blockchain system from git. For example, we can choose the main code of Bitcoin. We download the relevant source code from https://github.com/bitcoin/bitcoin, and prepare the corresponding compilation environment (Linux is recommended for C++) and install the corresponding development environment and tools (each system has a detailed installation tutorial document on the Internet).

However, the process of setting up the system and development environment, and compiling programs are relatively cumbersome and have many pitfalls (many of which are related to the environment, dependent libraries, and versions, so please pay attention). It is not recommended for ordinary users to make them by themselves. For developers, you may need to expect 2-3 days of installation and configuration time for the first time.

Take Bitcoin development as an example. It is a development environment of Qt. After downloading the source code and configuring the environment, open the source code of the Bitcoin core in Qt Creator, configure the relevant files and compiler, and start trying to compile the Bitcoin core client. After this step is completed, you can boldly transform it into your own digital currency. Open each source file and find the corresponding place to adjust the parameters, such as adjusting the number of coins per block, total output, difficulty, etc. Then the most critical point is to change the name to your own coin. At this time, search the full text of bitcoin or other bitcoin words and change it to the name of your own currency, such as ElwinNB. You can name it whatever you want, and don't forget to replace the relevant icons in the resource folder. If everything goes well, after recompiling, your new coin will be successfully invented.

In the early stage, many copycat coins followed this routine, modifying texts here and adjusting some parameters there based on Bitcoin. Many people did not understand the entire system and principles, and did not even read the main code. Later, when everyone became experienced, new currencies would consider some micro-innovations, make some adjustments and optimizations in consensus algorithms and encryption algorithms, and innovate their own new algorithms. Elwin believes that digital currency is also an Internet product and belongs to a relatively complex technical system. Even if you modify it based on someone else's mature code, it needs to be continuously updated and maintained. Even if it is just a simple version follow-up, you always have to invest technical strength to follow up. Therefore, what I mentioned before is just an entry attempt. To really maintain your digital currency, you still have to read the code carefully, understand the architecture and principles, and continuously optimize and adjust according to your business and the characteristics of the new currency.

Of course, these simple routines are no longer feasible. If you want to issue a new digital currency now, either your algorithm really has unique advantages and characteristics, or you have a good model based on the vertical business and game rules under the digital currency (such as e-sports coins or cultural coins). Otherwise, it will be difficult for people to pay attention to and support your new currency.

The second option is to create digital assets and digital currencies based on the existing blockchain public network. From the perspective of the mainstream blockchain open source technology system, except for Factom, other technology systems can be used to create digital assets, that is, they can support the creation of encrypted digital currencies.

Ethereum: Based on Ethereum's smart contracts, we can easily create our own digital assets or digital currencies. In addition to the basic functions of creating digital currencies and currency transactions, it also supports centralized currency managers, blacklists and whitelists of digital currencies, currency issuance, mining implementation, and automatic exchange of tokens and other currencies. The development language is Solidity. On the homepage of Ethereum's official website, three smart contract DEMOs are given: virtual currency contract Token, crowdfunding contract Crowdsale, and decentralized autonomous organization contract DAO. The virtual currency contract Token can be used as the best reference code for your encrypted digital currency.

Ripple and BitShares: Technically, based on the public networks of Ripple and BitShares, you can easily create and manage your own digital assets or digital currencies. However, the current Ripple public network seems to be limited to 2B business, and can only be used as a gateway for banks and financial institutions, so that ordinary players cannot create their own digital assets in the gateway. In BitShares' decentralized on-chain trading platform, we see that digital assets anchored to various assets are issued and traded with each other on BitShares. Various gateways based on the BitShares blockchain provide docking for various assets in the virtual world and the physical world on the blockchain. Unlike Bitcoin, BitShares can expand its scope and support multiple completely independent and parallel blocks. Because each blockchain can trade bit asset derivatives bundled on other blockchains, it is easy to move value between blockchains. BitShares' asset issuance function allows global users to issue their own digital assets at a very low cost and anchor them with specific real assets, and further realize transaction transfers on the blockchain, without the interference of centralized human factors in this process. BitShares' asset issuance and management functions are very powerful, including blacklists and whitelists, advanced multi-signatures, price feed input, mortgage issuance, internal and external market interaction, low latency, and smart contract waiting conditions. Using Ripple and BitShares to issue digital assets does not require additional code development.

Bubi: Bumeng is a digital asset platform based on the Bubi blockchain. Digital assets issued on the Bumeng platform can establish multi-party trust between asset circulators and ensure the authenticity and validity of digital assets purchased and used by users. Bumeng has a set of standardized protocols. Applications developed on the Bumeng platform do not need to be connected to each other, and data information flows and value flows between Bumeng users can be interconnected and communicated. At the same time, digital assets issued on the Bumeng platform can be delivered point-to-point. It is relatively simple to connect with Bumeng. Bumeng provides enterprises and developers with services such as asset issuance, asset transfer, and asset query, and supports multiple development languages.

In Option 2, the advantage of the Ethereum solution is that it is relatively flexible and powerful, and you can basically write your digital currency and its derived business system at will. The disadvantage is that the operation and circulation of the currency requires the consumption of native digital currency (Gas fee), which is worth considering; for the BitShares part, the issuance and management functions of digital assets are very complete, but they are also limited to the BitShares platform to a certain extent, and transaction fees (Gas fees) are also required; the advantage of the Bumeng platform is that it is simple, easy to use and free to use (no Gas fee), and the disadvantage is that the functions of the provided interface are not rich enough.

Solution 2 is based on the digital assets of the existing blockchain public network. While it is convenient, the advantage is that you don’t need to consider building your own node group like in Solution 1. However, the disadvantage is that it is limited to a certain extent in the framework of each blockchain system (in fact, in most cases your needs can be met), and the block performance will be restricted by the performance of the public network (in addition, the risk of stopping maintenance or hard forking of some blockchain public networks must also be considered).

4. Digital Currency Application Layer Development

After building your own native digital currency system, in addition to promoting the official website and social media, you also need to develop corresponding mining software, ICO crowdfunding websites, communication communities, wallets, trading markets and other application layer software.

Mining software: This is for Pow systems like Bitcoin, which require corresponding mining software. Professional ones require corresponding mining machines. First, download the ready-made mining tools (usually supporting sha and scrypt algorithms) and mining pools from git, rename them, compile them, and deploy them. They can also be used directly. Usually, they are developed in C++ language.

ICO crowdfunding website: mainly for the initial fundraising of digital currency, currently more for raising Bitcoin and Ethereum. This can be built by yourself, or you can use a third-party ICO crowdfunding website such as BiChongChou. Development language: mainstream Web development language.

Communication community: mainly used to publish information and communicate with coin users and traders. This can be built directly using third-party open source code. There are many such codes. Just choose according to the development language you are familiar with. Development language: mainstream Web development language.

Wallet: This is a very important and critical user client. You can spend more time designing some UI for it and provide multi-terminal wallets. Development language: mainstream Web development language or App development language

Trading market: Generally, this trading market is provided by Taobao or third-party trading markets, but it is not ruled out that you want to develop similar trading markets to provide exchanges between this digital currency and other digital currencies. Development language: mainstream Web development language.


<<:  Attention! The central bank has made a big move! Will paper money disappear?

>>:  A powerful tool to solve the three major problems of blockchain

Recommend

How to read the fortune line in palmistry

The money line, also known as the Mercury line, i...

What is the personality and fate of a woman with a low forehead?

The forehead represents a person's wisdom. It...

Is your marriage ok? Teach you how to tell marriage from face reading

If we look at a woman's marriage through her ...

What does a curved philtrum mean for people with diamond-shaped faces?

Nowadays, many people will look at a person's...

How to tell if a man is loyal and honest?

In the traditional Chinese perception, a loyal an...

Your physical appearance can tell whether you are blessed or not

Your physical appearance can tell whether you are...

Ransomware variants can steal cryptocurrency or control mining, study finds

According to itprotoday, researchers from Fortine...

What does the m palm line mean for women

There are many different lines in our palms, and ...

Analyzing the palm lines of women

Fingerprints are usually divided into two types: ...