The first part can be found
here , in it I told about what Blockchain, Ethereum, Ripple and Storj.io are. Today we will talk about interesting, new and not yet adequately covered technologies on
Habré Giktaimes, these are Sidechains and smart contracts.
Sidechains
A cryptographer, inventor and author of the sidechain concept, Adam Beck and a group of like-minded people, among whom are developers who are at the forefront of popularizing Bitcoin, as well as well-known figures in the online payment industry, have launched a startup
Blockstream . The former CEO of
Zero-Knowledge Systems Austin Hill was invited to the role of manager. According to the information on the official website, Blockstream aims to develop and accelerate innovations in the field of cryptocurrency, open assets and smart contracts, and sidechain - its first development, currently presented in the form of a
technical document .
The successful introduction of sidechains offers the following interesting perspectives:
Bitcoin can be the main reserve cell for many other distributed platforms and the main reserve currency for other cryptocurrencies. This change will accelerate the distribution and development of third-party platforms, such as Ethereum, Maidsafe, Ripple, Zerocoin and others, making it possible to directly link them to the basic Bitcoin functionality.
In case of successful application of the sidechain, this technology will be the next stage in the evolution of both cryptocurrency and decentralized distributed information exchange networks in general. Third-party platforms will become more accessible to a huge number of Bitcoin users and will gain strong feedback from its entire network.
')
Successful sidechain adaptation would also allow combining Bitcoin and many other alternative cryptocurrencies and distributed platforms into a single ecosystem, each participant of which will be able to use the whole variety of crypto products and choose those that will meet their particular needs.
Next, I would like to quote the main ideas from the article “
A simple explanation of bitcoin sidechains ”, which explains the basic principles of the technology:
The description of sidechains is now presented in the form of the
scientific work mentioned above.

This paper describes how to build “sided sidechains” (pegged sidechains). The sidechains themselves are not something new: the ways of their creation and the very idea of ​​their creation are being discussed for a certain time, and a
key breakthrough in this area was outlined earlier this year. This work, however, reveals in more detail the meaning of this concept, and has already attracted many comments.
And yet, what is sidechains? And why should you pay attention to them at all?
How do we imagine Bitcoin
The key to understanding most of the innovative changes that occur with Bitcoin is to make sure that you have the correct speculative model of how it works. In fact, it turns out that many people do not understand how it works and, as a result, have a wrong idea about it.
To help deal with this, a few months ago, the
author came up with an analogy for Bitcoin , based on a comparison of his “
unspent conclusions ” (see transaction output - note of a translator) with land. Here are its basics:
To get started, throw out of my head everything related to money, currency or payments. Also discard the phrase “transaction register”. Bitcoin’s astounding secret is that there is no register! There are only two structures that matter - transactions and their blocks. It is very important to understand this properly, so that the meaning of sidechains becomes clear to you.
When you "move" bitcoins, you say:
- Hello everyone ... I would like to move these specific bitcoins, please.
- Here is my confirmation that I have the right to move them.
- But in this way the recipient, in turn, will be able to prove that he has the right to move them.
The three key stages of a bitcoin transactionHere are some important points:
- Bitcoins cannot be perfectly measured ... when you move (i.e. spend) them, you spend a certain amount of certain, unique bitcoins.
- To spend it you need to prove that you have the right to do it. To do this, you first need to provide a solution to a certain task that you received when they were sent to you. Usually, the conditions of this task are: “prove to the rest of the world that you know the public key associated with a particular Bitcoin address and at the same time also have the private key associated with it”. However, this task may be even more complicated.
- When you send bitcoins somewhere, you set the task for the next owner. As a rule, you simply indicate that they need to know a pair of "public key-private key" that are associated with the Bitcoin address to which you sent the bitcoins. However, you can, again, make it harder. In general, you don’t even know who the next owner is ... anyone who meets this condition can be one.
These three points must firmly enter your memory!
So, the “fundamentals of science” of Bitcoin transactions are clear: “Here are the coins I want to move. Here is the proof of my rights to do this, but what the recipient must do if he wants to spend it. ”
This transaction enters the circulation within the common network, somehow finds its way into the block and, after other blocks are built on top of it, each member of the network can be completely sure that these changes are irreversible. Everything continues to go on as usual. It seems to be all right, what more could you ask for?
The basic fundamentals of Bitcoin generally work just fine ...And what's more, you, it turns out, can do with it really interesting things. For example, you can use the “non-ideal measurement” of bitcoins in order to “tag” them. The work of such ideas as "
Colored Coins " and "
Smart Property " is based on this.
However, there are problems, such as:
Block formation intervalsThe interval of the formation of a Bitcoin block is 10 minutes, so it takes an average of five to ten minutes for a new transaction to find its way to the block, no matter how big the commission you are willing to pay. For some people, this is too slow — to the point that they are experimenting with alternative Bitcoin-based cryptocurrency code that uses a smaller interval.
Transaction structureThe “three-step” transaction structure is very common, but it allows you to transfer only ownership of Bitcoins. Some people would like to transmit more diverse forms of information on such systems. An example is a decentralized exchange, whose participants need a way to place orders. As a result, projects such as Mastercoin, Counterparty, NXT and others either create their own levels of interaction on top of Bitcoin, or use completely different source code bases to achieve their goals.
Transaction TermsI wrote above that you can embed complex rules in a Bitcoin transaction to specify how ownership is checked. Be that as it may, the Bitcoin scripting language is intentionally limited, and the implementation of many ideas in the field of
Smart Contracts is difficult or impossible. Therefore, projects such as
Ethereum are building a completely new infrastructure to develop these ideas.
Same security policies for allRegardless of whether you are moving $ 1 billion or one-hundredth of a cent over a Bitcoin network, in both cases you get the same security guarantees. At the same time you lose time and pay a commission. What if you are willing to sacrifice safety for speed? In this case, today there is only one real option for you - send Coins to a centralized provider of wallets, which you will have to entrust their integrity and safety. And then, using their accounting system, you will be able to conduct any desired transactions with their other clients without in any way contacting the Bitcoin transaction register. However, in this way you lose all the benefits of a decentralized network of transferring valuable assets.
“Equal to all” does not mean “Convenient to all”
Applying experimental or rapid changes in Bitcoin technology is a very risky business, so changes in it are slow. At the same time, if such a constant, “the same for all” architecture is not suitable for a specific practical case, you have a problem. You need to either use a completely different cryptocurrency (maybe even create your own!), Or use (or create) a centralized service, and this leads to new risks.
This situation is very uncomfortable. It also creates risks, fragments and slows down the process of adding products, services and infrastructure to a Bitcoin network.
However, we can make an interesting observation. Imagine what happens when you send bitcoins to a central wallet, such as circle.com for safekeeping.
- You send your coins to a specific Bitcoin address.
- They appear inside your wallet in a circle, but now you cannot control them with blockchain technology.
- At some point in the future, you can send your coins back from a circle wallet to your Bitcoin address.
- Now you again have control over certain specific blockchain lines.
From the point of view of the Bitcoin network, Circle is a black box. You had coins ... you sent them to a certain address ... something happened that Bitcoin couldn't trace ... and after some time you got some coins back in control. It looks as if these coins were moved from the Bitcoin network somewhere else, and then returned.
The essence of sidechains
The key idea behind the sidechain concept is:
What if you could send bitcoins not only to individuals, to individual addresses or centralized services, but also to other blockchains?
Imagine that there is some kind of Bitcoin-like system you would like to use. Perhaps this is Litecoin or Ethereum or something completely new. Perhaps it forms blocks faster and has a richer scripting language. No matter how it was there, the essence is this: you would like to take advantage of this, but would prefer not to take risks and not spend efforts to purchase the title signs of this platform. You've got bitcoins, why can't you just use them?
Sidechains offer this idea:
- Send your bitcoins to a specially crafted Bitcoin address, which is designed in such a way that after this operation their use becomes unavailable for both you and anyone else. Now they are completely frozen and can only be unlocked if someone can prove that they are no longer used elsewhere (more on this later). In other words, you used the basic rules of Bitcoin transactions, which were explained above, in order to impose on them a condition about their future owner. Whoever he is, he will have to fulfill this condition in order to get the right to dispose of them.
- As soon as the freezing transaction receives a confirmation, you send a message to another blockchain - the one you wanted to use. This message confirms that the coins were sent to the special address of the Bitcoin network, and thus were frozen. But the most important part of this message is the information about who made this post.
- If the second blockchain has agreed to be a Bitcoin sidechain, it does something very special - it creates exactly the same number of title characters of its network and transfers them to your control.
- That is, everything looks as if you transferred your bitcoins to another blockchain. And remember: they are frozen within the Bitcoin network, so we didn’t create anything and didn’t destroy anything ... Just “moved” them.
- Now, with the help of these Coins, you can make transactions, in another chain, no matter what rules he uses.
- Let's say in this sidechain blocks are created faster. Suppose its transaction scripts are turing-complete. Suppose you need to pay commissions in order to stimulate the activities of sidechain owners. Specific rules will be what they want their owners to see. The only rule that matters is: if you can prove that you have made some bitcoins in the Bitcoin network unavailable, the same number of them will appear in the new talker who has agreed to follow this agreement.
- And now the second part of this clever idea. The above logic is completely symmetrical. Therefore, no matter who keeps these coins in the sidechain at one time or another, he can send them back to the Bitcoin network by creating a special transaction in the sidechain that will freeze the coins in it. They will disappear from the sidechain and will again be available on the Bitcoin network, under the control of the one who previously owned them in the sidechain.
Sidechains use standard three-step bitcoin transfiguration to freeze bitcoins while they are “in” sidechain.So, let's repeat it again: we use standard Bitcoin transaction functionality to make coins inaccessible. Further, we prove to the second, untied directly to the chain, that it was we who did it. Once this is done, their current owner in sidechain can, by doing the same thing, send them back to the Bitcoin network.
Thus, developers get the opportunity to experiment with different types of cryptocurrency rules without the need to create their own currency.
And now it is possible to do some very interesting things in the field of Bitcoin.Abstracted from the details and think over what we have described. We now have a way to move the bitcoins to another platform (sidechain) and again return them back. This is exactly what we do when we move them to an online wallets provider or exchange. The difference is that the “platform” to which they were moved is also a blockchain ... and thus gets the opportunity to enjoy the security, transparency, characteristic of decentralized systems and the ability to benefit from other innovations in this area.
Imagine, for example, sidechain, which “mining” is only one company. It would be the equivalent of a company's wallet, but with full transaction transparency.
We can go further and imagine sidechain, which is mined by hundreds of different companies that are united in one common organization. Calling it a complete decentralization cannot be, however, it will be more difficult to influence, interfere or harm their activities from the outside.
There are also many other possibilities. The most important thing here is that you can create products and services, experiment without the need to create a new currency or return to the old, centralized nature of the relationship.
Sidechain is an architecture for building semi-centralized products and services for Bitcoin, which were previously impossible to create.
Now there are serious problems with sidechains. Peter Todd
questioned the security of sidechains, and believes that the use of sidechains may require a one-time change to the Bitcoin network.
A number of other comments and critics were sounded, to which the Blockstream founders responded promptly, then translating comments to these comments:
What can (and cannot) be achieved through bilateral tethered sidechains?Sidechain is a generic term and means any chain that “performs data verification from other blockchains”. In this sense, most blockchains with quite expressive scripting systems can be very easily represented as sidechains.
In general, a two-way binding mechanism allows you to: take bitcoins (or other assets), move them to another blockchain and use them in any context that it allows, and, ultimately, return them to the original blockchain.
While using another blockchain, you will be limited only by its rules and limits. At the moment, the main way to use sidechains is to experiment with new scripting systems and transaction formats. Other possible applications are explored in the fifth part of the technical document.
In general, bilateral sided sidechains will allow you to quickly and efficiently make various changes, such as script extensions, asset creation or smart contracts, directly into Bitcoin.
Is there any reason for concern about the safety of parallel mining (merged-mining)?The concept of sidechains does not overlap with the concept of parallel mining, since each sidechain can choose between including support for parallel mining or existence only through their own mining efforts. However, the problem of the popularity of chains, when mining in many of them loses its meaning in comparison with some other more developed chains supporting parallel mining, does exist.
In such an environment, neutralizing hashpower attacks becomes more difficult.
There is no universal way of protection at the moment, however, any sidechain that is decentralized and powerful enough (hashpower) can achieve the same level of stability that Bitcoin now has.
Some ways to protect sidechains from hashpower attacks are described in section 6.1 of the technical document. The main paths here are to provide miners with more diverse incentives and limit the ability of attackers to steal coins.
Can this technology lead to Bitcoin centralization?There is a possibility that commissions and other incentives for mining will be distributed between sidechains, and the profitability of mining will decrease, which in turn will create an incentive for even greater pooling and centralization of efforts.
Section 4.3 describes the miner’s ability to dynamically enable and disable mining in individual sidechains during block confirmation or mine transactions verified by a third party (similar to the way pools work today) and partially confirm the consensus provided by third parties.
Such measures will allow miners to get the maximum profit, with an insignificant increase in the degree of centralization.
What is the difference between sidechains and treechains?These are two different, unrelated ideas. Treechains is a proposal for expanding within one blockchain alone, and double-sided binding is a mechanism for moving assets between blockchains without using a trustee. It allows you to link together a whole system of different blockchains. Moreover, in order for treechain to become available to Bitcoin users, it will most likely have to be implemented on a separate linked sidechain.
Is it true that for the introduction of sidechain you will need to make a small software branch for Bitcoin?We would like to see support from a large part of the community. The first reaction was positive, and sidechain authors took great interest in this change even before the founding of Blockstream. The release of the technical document was just the first step to get feedback, and we will closely monitor the community and work with it in close relationship before proceeding to any specific changes.
Where can I see the source code of the project?The team has been working on the project for several months now and plans to release an early version of the system over the next few months. The unobtrusive binding scheme (federated peg) described in the document does not require changes to Bitcoin. In addition, with its launch, it is also possible to supplement current dynamic multilateral signatures (DMMS) to their full version, which will instantly improve the security of blocks and their transactions.
The source code for the project will be available on Github.
Decentralized smart contracts
The following discussion focuses on smart contracts (or, as they are also called electronic contracts), which can be created and authenticated in digital form. The concept of partially or fully automating the creation of agreements between several parties and the control over their implementation, as well as the conduct on the basis of operations or actions in the real world, exist almost as long as modern digital systems and networks. However, until 1993, it did not receive wide distribution and did not even have its own name.
One of the first attempts to combine ideas from this area into a whole was undertaken by Nick Zabot, a well-known cryptographer, as well as a lawyer by education, who made a considerable contribution to the development of Bitcoin. In 1994, he introduced the term “smart contract”.
Original concept
A smart contract is an electronic algorithm that describes a set of conditions whose fulfillment entails certain events in the real world or digital systems.
The work of smart contracts is based on the development and use of so-called “low trust protocols”. The concept of “low trust” implies the maximum possible exclusion of the human factor from the decision-making chain, shifting this task to an electronic system protected by cryptographic, biometric or other effective methods using authorization or identification. The work of the protocol is provided by electronic algorithms, and the person acts only as one of the parties, who feel the result of the implementation of the contract.
As with any new technology, the concept of smart contracts aims to solve everyday human tasks:
- To make the implementation of contracts and agreements a more objective process, to avoid violations on the part of the participants and manipulations by those responsible for monitoring its implementation.
- Make financial and business processes more transparent, efficient, faster and less costly.
- Minimize unintentional human error.
“
The idea of smart contracts ” 1997 “ ” .
. , . , , , .
, , . — , .
, , , . .
, : , . , , 90 / .
, , , .
“ ”. . . , . , . , , .
- : , , , , “ ”. , , . , , — , .
, c . , . , .
, . . , , , . , , , .
, Bitcoin “ ” . itcoin , , .
, Bitcoin, , , , :
- (Smart property) — , , .
- (Transferable virtual property) . : , ( ) (mp3 , ).
- (Agents) — , Bitcoin . . , , , . , — .
- (Distributed markets) , , . , Bitcoin .
- , .
, Bitcoin, , , . . , , “ ” , , , Bitcoin .
Bitcoin , , , , Bitcoin, . “ ” , Bitcoin 2.0.
Counterparty
Bitcoin
Counterparty . Bitcoin , , Bitcoin- .
Counterparty : , XCP -
Counterwallet , -.
Counterparty , XCP Counterparty Bitcoin. Counterparty Bitcoin-, . Counterparty , “ ”:
- , Bitcoin XCP. Counterparty.
- , XCP.
- — / , , , . , , .
- — Bitcoin, .
2014
Storj ( ,
).
Ethereum
Ethereum , , Bitcoin. Counterparty, Ethereum , , .
, Bitcoin — ether. Ethereum , “ ” , . .. contracts () — , .
Ethereum python C- , . :
proof of concept . 2014/2015 . ,
Ethereum wiki .
Blackhalo
, , Ethereum
Blackhalo — .
, , , Blackcoin, Nightwatch — .
, Blackhalo :
- Blackcoin' , Western Union, Paypal, .
- — , .
- . ,
- . , — . , .
- , , -
- . .
- . 1$ , Blackcoin .
- .
, . Blackhalo, Nightwatch -.
Codius Ripple Lab
Codius , Ripple Labs. Bitcoin 2.0 , , , , Codius “ ”. Ripple Labs , .
Codius “ ” (smart oracle). , , , , . . , .
, , Codius — , .
“” Codius Native client Google, C++ , , . , Codius , .
Codius — , . , , .
GitHub Codius .
Bitcoin 2.0 , “ ” ,
Mastercoin Clearing house , .
Development prospects
, . , . , , , . .
, . , . , , , . , , , , , , , .
— “ ” “
”. . , . “ ” , .
, . , , , , — Codius . , . , , , , , .