As I wrote a semi-decentralized cryptocurrency in PHP. (Part 1 - Collecting Libraries)

Foreword


You probably remember the last article in which I developed a centralized cryptocurrency. The idea was, as you know, a bad one. I decided to restart the line of these tutorials, but more or less normal than in the past. In this line we will try to β€œchew” all that has been said. Therefore, if you saw the last article, you can see here something that was in the last article.

What happened during two months of radio silence
  1. .
  2. .
  3. (P2P- PHP, - ).
  4. .
  5. , .
  6. β€” :).


I hope that at least I will not abandon this line.

Article lists


  1. As I wrote a semi-decentralized cryptocurrency in PHP. (Part 1 - Collecting Libraries)
  2. As I wrote a semi-decentralized cryptocurrency in PHP. (Part 2 - Development)

Compare


First: A decentralized cryptocurrency will be much more reliable than a centralized cryptocurrency, in which any person having his time in his hands will manually try to rewrite its blockchain.

Secondly: Unlike centralized coins, wallets will not be stored in a decentralized database. In this connection, anyone who has a balance in their hands can burn a part, even if they make a mistake in one letter in the wallet address.

Thirdly: Unlike decentralized coins, in a centralized one any fraud can erase the balance for everyone. But nobody wants this.

Getting started!


Before we start looking for libraries, I’ll immediately say the following:

  • I will write under console PHP 7.4
  • Composer is a good thing. I do not forget to use it.

Library Search


P2P. Peer-to-Peer is used in cryptocurrencies to ensure that the network is independent of anyone, so that neither the government nor other power structures can independently control the accounting of monetary units, no one can rewrite the blockchain. The advantages of this method is that if the cryptocurrency was centralized (i.e. something like an API on a simple web server), no one would guarantee the safety of the blockchain and the integrity of the creator. We arm ourselves with a simple library, BPN is called a Bit Points Network. Although it is half-decentralized and requires a tracker, it can rightfully be considered decentralized. Link .

Blockchain One of the important libraries in our project. It is on the blockchain that the click will be built
Regarding the installation of these packages.
, . β€” Composer, , Packagist .


BIP39. We want to restore the wallet anywhere, from all over the world. But we don’t know how ... Thanks to the BIP39 standard, you can restore your wallet. And here is the URL - click
BIP44. Suddenly, we want to create several wallets with only one SEED phrase from the very first wallet. It’s worth thinking about. However, in the same github you can find a library that implements this standard in PHP. Click .

Here is a list of required libraries. I threw the first two into one directory, I installed the last two through Composer.

To summarize


I had to start all over again, already more similar to other cryptocurrencies.

Decentralized, without government control, free for all. After about a few hours, I will publish the second part, where we will write the client, configure the tracker. Good luck to all! See you.

All Articles