The concept of the blockchain is most often mentioned along with the topic of crypto-currency, although it can find a much wider application. Why? Let us try to discover it. In fact, a blockchain is a certain distributed database that interacts with a dynamic list of ordered records. The main idea is that existing records cannot be modified and new ones require a specific verification to be accepted. The most popular blockchain implementations were created for Bitcoin and Ethereum. The blockchain is closely related to e-money transfers and crypto-currency transactions, smart contracts, supply chain logistics, etc.
From the technical point of view, each block can be presented by five components (this is the base model, with the minimum necessary data set): index, mark, data, hash and hash of the previous block. That is why the implementation of the basic blockchain system is quite simple and can be put into 200 lines. The key element of such a structure is security, which is ensured by:
- well-thought organization of access rights;
- encryption keys generated using the highest security standards;
- the “right” programming language.
Metamask is a specialized Chrome plugin, which is a bridge between blockchain nodes and the browser, thus providing opportunities to use Web3.js. Metamask works very simply — it attaches this library to each page directly. In turn, Web3.js automatically connects to Metamask RPC servers. As a result, you get full access to the Ethereum functionality through the JS scripts embedded into the site’s pages.
Swarm and IPFS
Swarm and IPFS are two slightly different decentralized content storage and delivery technologies that use a peer-to-peer protocol developed for Ethereum — ERC20. In fact, both depositories use multiple computers via an internet connection to create a kind of public cloud storage outfitted with the benefits of blockchain (security, anonymity and trustability) and content delivery network (the content is shipped to the requester from a node that is closest to them). In the case of blockchain systems, they also allow providing the JSON interface to ABI, which is necessary for the implementation of smart contracts.
As for the key differences between Swarm and IPFS, they are as follows:
- SWARM can be used as a cloud hosting;
- SWARM was developed as part of the Ethereum ecosystem, which means that it provides the developer with optimal opportunities for deeper interaction with this blockchain than IPFS;
- SWARM is a part of the Ethereum Foundation tech stack, while IPFS is developed and supported by the Protocol Labs company, which recently got a lot of attention after their crypto-currency’s (Filecoin) closed ICO broke an all-time record and collected USD 257 million;
- IPFS scales better;
- IPFS has a much larger number of users due to its time validity.
If you need a more detailed analysis of their similarities and differences, you can read more on this at Github.
The ccxt library is a set of software tools that are designed to support the integration with cryptocurrency exchanges and can be implemented at any e-commerce site. It provides a unified API consisting of public and private parts. Public API makes it possible to discover the market data, design diagrams that display the exchange rate plots, and also review the trade history. In turn, the private API is used to trade the currencies, for which you will also need the user credibilities for particular markets. To date, this solution supports more than 102 cryptocurrency exchanges and is available for three languages: JS, PHP and Python. Ccxt is easily installed using npm.
Gekko is an open source trading bot with a graphical web interface that integrates easily with the 24 most popular cryptocurrency exchanges, supports the creation of custom flexible trading strategies, has an extensive plugin repository and versions for all the leading desktop OSes — Windows, Linux, and macOS.
KryptoWar is a simple but captivating wargame in which players build their armies and fight each other to earn experience and resources and become the strongest warlord on the blockchain.
LightWallet is a lightweight implementation of cryptocurrency wallet that can work both locally and remotely. Moreover, thanks to the in-built private key storage, LightWallet also supports running Ethereum Dapps without hosting the local node.
Educational Projects: Learn the Principles Behind Blockchain
The projects described below are greatly documented and commented, providing the possibility to understand the blockchain mechanics better.
SavjeeCoin, being a simple and intuitive implementation of the blockchain, can serve a template or a learning example.
Blockchain demo is also a basic interpretation of the blockchain, which can be used for the purpose of a study. In order to make a viable solution out of this blockchain system, you will need to take great care of security and additional functionality.
Naivechain is also an excellent option for getting the hands-on acquaintance with the blockchain, which employs the HTTP and Websockets interfaces to manage data connections between nodes.
Originally published at blog.webbylab.com.