Start with bitcoin
The positioning of this article will be more popular, and try to explain the basic principles of bitcoin by analogy. This article will not touch on the details of algorithms and protocols. I intend to write another article on bitcoin principle from the perspective of programmers, where we will explain some key data structures, algorithms and protocols from the perspective of technicians.
In this article, I will give a virtual village called “bitcun”. The whole article will gradually tell you the motivation of bitcoin, what problems it has solved, and the goals and design schemes of some key components.
- What is the principle of bitcoin?
- Why can this unmanned system work successfully?
- What’s the process of bitcoin trading?
- What is its relationship with blockchain?
Next, I will try to answer these questions, hoping to help you understand bitcoin. Aside from the technical details, it’s easy to explain.
Last year, bitcoin soared, and other currencies have sprung up like mushrooms, with more than 1000 kinds.
Many people are asking, is the era of cryptocurrency really coming? In the future, will human beings no longer use US dollar and RMB, but use cryptocurrency instead? So many varieties, which currency should I use? Do you want to invest now?
This paper proposes an e-cash system which is completely implemented by point-to-point technology. It enables online payment to be initiated by one party and paid to the other party directly without any financial institutions.
My goal of learning blockchain is very clear. From a large perspective, there are two goals:
- 1. In order to enter into the blockchain development in the future, do technical reserves;
- 2. In order to guide me how to invest in virtual currency.
So, in order to achieve these two goals, what needs to be learned?
The first goal is to learn the relevant technologies of blockchain, which include the technologies involved in blockchain and the technical principles of blockchain;
The second goal is to learn the related knowledge of virtual currency, including the need to solve the problems of which virtual currency is available, where to buy it, how to buy it, and how to understand the future prospect of virtual currency.
After combing, it becomes a problem to be solved.
Next, I’ll try to write a best understanding of the blockchain tutorial. After all, it is not very difficult. The core concept is very simple and can be explained clearly in a few words. I hope that after reading this article, you can not only understand blockchain, but also understand what mining is and why mining is becoming more and more difficult.
I like to learn in practice, especially to understand the whole working mechanism based on one code. If you and I like this way of learning, you will know how blockchain technology works when you finish this tutorial.
- Step 1: create a blockchain
- Step 2: blockchain as API interface
- Step 3: running blockchain
- Step 4: consistency (consensus)
As an implementation of architecture design, blockchain is quite different from basic language or platform. Blockchain is the technology behind cryptocurrency. It is one of the popular technologies that are comparable with vr virtual reality. It is not a new technology in itself. Like Ajax, it can be said that it is a kind of technical architecture. Therefore, we talk about the technical implementation of blockchain from the perspective of architecture design.
No matter what programming language you are good at, you can refer to this design to implement a blockchain product. At the same time, sort out the related knowledge map and system to help everyone to study systematically.
Ethereum is a new and open blockchain platform, which allows anyone to build and use decentralized applications running through blockchain technology in the platform. Like bitcoin, Ethereum is not controlled by anyone, nor owned by anyone – it is an open source project created by many people around the world. Different from bitcoin protocol, Ethereum is very flexible and adaptable. It is very easy to create new applications on the Ethereum platform. With the release of homestead, anyone can safely use the applications on the platform.
I suggest that you read this article completely, understand it from a higher level, and then select the ones you are interested in and study them one by one. It may take a few days.
In the end, you will find that blockchain is built on the simple basic technology, which is not magical at all. Although it has been stir fried by various ICOS recently. Everyone is standing on the shoulders of giants. If you are a programmer, you can understand these projects and technologies more deeply. So don’t lose an opportunity to improve yourself because of other dross.
This paper builds the development environment of Ethereum from 0, just like learning other languages at that time. This is our first hellowork program. After the completion of the construction, we tested the account creation, mining and transfer.
In this paper, the author gives the complete code, detailed steps and user interface of the smart contract written, deployed and interacted with Ethereum on the private blockchain. The author hopes that with his article, you can write and deploy a smart contract on the private Ethereum blockchain.
- This article refers to Ethereum related information, through personal practice installation, to avoid many detours
- When installing, make sure that the minimum running memory of the server is 2G, otherwise the installation may not succeed!
- This will introduce how to build Ethereum private chain on CentOS.
Now the basic operation of Ethereum is introduced.
- Account viewing
- transfer accounts
Last time, we built a private chain and simple account management operation, transfer and mining. This time, we demonstrated the compilation, compilation, creation and execution of smart contract through a very simple smart contract. The steps are as follows:
- Write and compile a simple smart contract through online IDE and solidness language
- Create a smart contract in the private chain environment we created earlier (in fact, the smart contract is the so-called “code on the chain”)
- Execute or call the contract through the method in the smart contract
In this paper, we have some simple methods of learning about Ethereum.
Through the methods described in this paper and the script in the project, we can quickly build our own private chain for blockchain development test. This paper is based on the Ethereum technology, which is divided into two parts: one is the method under Ubuntu, the other is the method under Windows OS.
There are a lot of articles about deploying smart contracts on the network, but they all have a common feature, which is to deploy by command line. First, build Solc compiling environment, then deploy geth or eth node, and then generate wallet, ABI and contract address step by step for deployment. It is difficult for beginners to understand and easy to fail. This paper mainly introduces how to deploy in the graphical world Next click to deploy and call the smart contract.
Currently, Ethereum supports the writing of smart contracts in three languages:
- Serpent: Python style.
- LLL: similar to LISP style, it has been terminated.
You can choose different high-level languages according to different habits. At present, solidness is the most popular one. All the smart contracts in this paper are written in solid language.
Hyperledger is one of many projects under the Linux foundation. It is a blockchain project proposed by IBM, Intel, financial companies, GP Morgan and other joint institutions in 2015. Super ledger also includes four framework projects: sawtooth, iroha, fabric and burrow. One of the most well-known is fabric. At present, there are about 140 members, of which 1 / 4 are from China. At present, Wanda, Huawei and IBM are mainly responsible for China’s technical team, which is responsible for providing Chinese members and China’s demand, as well as promoting code.
This tutorial will guide you through writing smart contracts for hyperledger.
- How to write chain code
- Realize your first chain code
- Interact with your first chain code
This developerWorks quick start guide is suitable for application developers who are not familiar with blockchain technology and want to quickly start building and experimenting with blockchain networks. The simple instructions will show how to set up an IBM blockchain network based on the open source hyperledger fabric, how to deploy chain code (business rules), and how to write client applications to simplify business processes and digital interactions.
This document demonstrates using hyperledger fabric v1.0 to deploy a developer environment and run a simple example. Documentation includes creating and joining channels (ledgers), client authentication, and deploying and invoking smart contracts. The CLI will be used to create and join channels (ledgers), and the nodejs SDK will be used for client authentication and smart contract functions for using ledgers.
Docker compose will be used to create a federation chain with three peer nodes, a separate orderer, and a certification authority (CA). In order to speed up the deployment process, encryption elements based on standard PKI implementation are pre generated and packaged into fabpre.tar.gz 。 Certification authority (CA) is responsible for issuing, revoking and maintaining encryption elements representing an enterprise, which are provided to the client (node SDK) for authentication.
The fabric network will be generated automatically by executing docker compose, and the API for creating channel and joining channel will be called automatically; at the same time, developers can also generate their own fabric network and channel (account book) by manual steps or directly use developer mode for application development.
Introduction to solidity
Let’s start with a very basic example. Don’t worry you don’t know anything about it yet. We’ll learn more details step by step.
In solidity, a contract consists of a set of code (the function of the contract) and data (the state of the contract). The contract is located at a special address on the Ethereum blockchain.
If you just want to try a small contract that uses solidity, you don’t need to install anything, just visit browser based solidity.
If you want to use it offline, you can save the page locally or clone one.
- Example 1: voting
- Example 2: blind shooting
- Example 3: secure remote shopping
This section provides all the information you need to know about solidity.
End of this issue
Welcome to the segmentfault workshop service number:)