January 17, 2021
Top

Advanced sidechain technology: Liquid and RSK

In this post, Sergio Lerner, Senior Research Fellow at RSK Labs, will analyze advanced technologies, which use the Liquid and RSK sidechains. In 2016, Blockstream proposed the “Pegged Sidechain” technology as a possible way to scale the Bitcoin blockchain. The first original sidechain concept was a combination of atomic cross-chain swaps using simplified payment verification - SPV (as in p2p trading), and so on "Altchains."

</p>

From the translator:

Sidechain (English Sidechain - side chain) - a method of dividing the blockchain into the main and additional. The user sends digital assets to an additional one, which is later confirmed on the main.

Atomic swap (Atomic Swap) - an automatic exchange of one cryptocurrency for another without the need for mutual trust and the participation of third parties.

SPV (Simplified Payment Verification or Simplified Payment Verification) Is a feature of the Bitcoin protocol, whichAllows nodes to certify a transaction without loading a complete chain of blocks. Instead, to verify the transaction, loading the Heads of the blocks containing the hashes is sufficient.

Cross chain - A technology that allows you to exchange one cryptocurrency for another without the use of centralized intermediaries, such as cryptocurrency exchanges.

LEARN MORE

***

Sidechain is not an approved term, but,so often blockchains are indicated with a minimum need for trust, allowing international payments in cryptocurrencies that are “native” to other blockchains. In particular, sidechains allow you to improve Bitcoin with minimal interference in the system itself.

The most interesting benefits thatthe sidechains that are provided are issuing own assets, tracking smart contracts that are used in DeFi solutions, scaling commit chains, faster calculations and improved privacy.

Of all the projects, two are worth highlighting: Liquid and RSK. They are bitcoin sidechains and have been very active since launch.

From the translator:

Commit-chain - another second level protocol, along withpayment channels (as in the Lightning Network). But, unlike channels, “commit chains” are supported by a single party that acts as an intermediary for transactions.

DeFi (Decentralized Finance) belong to the ecosystem of financial applications,which are built on the basis of blockchain networks. The term “decentralized finance” can refer to an open, free and transparent ecosystem of financial services that is accessible to everyone and works without interference from any government authority. In this case, users retain full control over their assets and interact with this ecosystem through peer-to-peer (P2P) decentralized applications (dapps).

DeFi Fast Growth

Federated Linked Sidechains

Federated linked sidechain allowsissue their own tokens, provided with tokens of the main blockchain, blocked in a multi-subscription address. The private keys of this multicast are created and managed by a group of functionaries. The mechanism that is used to lock and unlock tokens in the main and side chains is usually called two-way binding.

There are many types of federated sidechains, and it’s important to see subtle differences between them.

Firstly, it’s worthwhile to briefly describe such sidechains as Liquid and RSK, respectively, presented by Blockstream and RSK Labs.

Liquid

Liquid is an exchange network between cryptocurrencyexchanges and institutions around the world, which allows you to make bitcoin transactions faster, as well as issue your own digital assets. In other words, it is a blockchain for exchanges, brokers and market makers, which allows for fast and private transactions between all network participants. Thanks to Issued Assets [asset issue] - participants can use various tokens, securities and even other cryptocurrencies. In Liquid, the Federation of Functioners controls the binding and consensus, and the native token is LBTC.

***

Explorer: https://blockstream.info/liquid/

Network Statistics: https://liquid.horse/

Documentation: https://blockstream.com/whitepapers/

RSK

RSK is a platform forsmart contracts, which is tied to the Bitcoin blockchain and the Proof-of-Work algorithm, and, at present, is the most secure network for smart contracts. This allows you to create various decentralized applications that can empower people, as well as improve their quality of life and add freedom. As a side chain, it makes the Bitcoin ecosystem more valuable, expanding the possibilities for using this currency.

Decentralized applications can be writtenusing the Solidity compiler and the standard Web3 library, which ensures compatibility with Ethereum. In addition, RSK helps scale Bitcoin by expanding its intranet space and off-chain transactions, which is provided by the RIF Lumino network of payment channels. Bilateral RSK binding is protected by the RSK Federation, and consensus is achieved through combined mining [merge-mining]. The native token in RSK is RBTC.

***

Explorer: https://explorer.rsk.co/

Network Statistics: https://stats.rsk.co/

Testnet: https://faucet.testnet.rsk.co/

Documentation: https://github.com/rsksmart/rskj/wiki

comparison table

Both projects are leaders among other sidechains. However, there are key differences. The following table compares RSK and Liquid.

RSK [Rootstock] Is a sidechain launched in January 2018, and with which Sergio Lerner has been collaborating since 2015.

Liquid is a sidechain created by Blockstream and has been active since September 2018.

Why is Blockstream so important?

Since many details about the internal workLiquid has not yet been published - the table will present the most accurate comparison, which is possible based on what is currently known.

Parameters Liquid RSK
Creator Blockstream RSK Labs
Open source license MIT, Defensive Patent License LGPL
Blockchain
Consensus protocol Bft Bitcoin mining combined
Confirmation time 2 blocks, irreversible changes Confirmed Confirmation
Consensus group type Closed Open
Block producers Circular multi-signature 15 core members + 14 additional producers Combined Bitcoin mining (current figure is 41.3%)
Federated two-way binding
A type 11 out of 15 federated multi-signatures, time-locked (multi-signature 2 of 3) to start the disaster recovery process 8 out of 15 federated multi-signatures
Hardware security Own HSM (software and devices) Custom firmware for ready-made HSMs
Federation Election It is decided within the Federation Adding and removing members during the online voting process on the blockchain
Publicity of Federation Members Unsolved Published on the sidechain
Binding Transparency / Privacy Opaque (between the exchange and the user) Completely transparent
Resistance to censorship on the principle of "all or nothing" No, but, in the future, a system with atomic swaps is planned Yes
Cold storage Yes, but, periodically updating coins is required No, but planned in the future
Communication between functionaries Via tor No. Communication between smart contracts and functionaries is open on the sidechain
Features of the main platform
Own assets Own standard User Contracts with the ERC-20 Standard
Friendliness of own assets for light customers Yes, but special nodes are required Yes
Confidentiality Proprietary Confidential Transactions User contracts using Zether, Mobius and AZTEC.</p>

The RSK Roadmap describes account enhancement for greater privacy

Smart contracts Without fixing the current state With fixing the current state
Commission amount 10 cents 0.66 cents
Block Publishing Frequency 1 minute 30 seconds
Transaction per second based on block limits 40 10

But, it is worthwhile to describe in more detail the main differences.

Federated binding

Both Liquid and RSK use federatedmulti-signature for blocking bitcoins that are issued on the sidechain in the form of their own cryptocurrency, however, their binding design is significantly different. There are trade-offs in each of these sidechains.

Both sidechains currently have 15active functionaries. At the same time, Liquid requires 11 signatures for the release of BTC, while RSK requires 8 signatures. It seems like Liquid gives priority to security and RSK gives convenience.

However, Liquid implements the procedureemergency unlocking using multi-signature “2 of 3”, which increases convenience at the expense of security, which is already the opposite compromise. Also, a similar alarm system in Liquid opens up the possibility for a new attack vector, when miners can block the final transaction in order to force activation of the emergency multi-signature.

In general, each option has pros and cons, so you can implement such an alarm system in RSK or, conversely, remove it from Liquid.

It is possible that, given the critical need for system security, simplicity is preferable.

Both sidechains use hardware modulesSecurity (HSM) for storing private keys. Neither Blockstream nor RSK Labs disclosed enough information about how these modules are made or what code they use. At the same time, the audit of both firmware and HSM hardware is allowed only to RSK Federation functionaries, which also applies to Liquid.

Liquid created its own hardware platformand firmware, which is an advantage for their security. However, it is not known whether the devices from Blockstream rely on a special Secure Element to protect private keys or not. Security Elements are specifically designed to protect secrets from side-channel attacks and failure, while standard microcontrollers usually fail.

In turn, RSK Labs used off-the-shelf devices with Protective Elements and their own custom firmware.

Snap

The Liquid and RSK protocol for blocking BTC andUnlocking native tokens is different. In Liquid, the user first creates a new temporary federated address, extracting it from the already known federal address using a random code - then the bitcoins are sent to this new temporary address. After a fairly significant number of confirmations, the user or federation functionary sends the transaction to Liquid and sends the other random code received to the rest of the federation members. After that, the system issues LBTC tokens in the number of bitcoins blocked at the temporary address.

Convert BTC to LBTC (Liquid)

The process of converting bitcoins to RSK looks likeas follows: first, the sender must make sure that the bitcoins are stored on a P2PKH format address. If this is not the case, then he must make the necessary transaction [Tx1]. The coins are then transferred from the P2PKH address to the multi-signature federated address through the following transaction [Tx2]. After a significant number of confirmations, the federation issues a notification transaction to RSK containing the SPV proof for the transaction [Tx2]. Further, the blockchain immediately unlocks the equivalent number of RBTC tokens at an address that is controlled by the same secret key as the first transaction input [Tx2]. This is done by converting the bitcoin key to the RSK address.

In the event that for any reason the Federation does notgives confirmation - any user can do it himself, by including evidence in the SPV transaction: the process will be similar, therefore it also does not require any trust.

BTC to RBTC (RSK) conversion

Users can convert bitcoins toRBTC tokens without registering on the exchange. Anyone can also connect to Liquid, but, nevertheless, it is recommended there to register on one of the exchanges that is a member of the Federation and go through the KYC procedure. In theory, the Liquid Federation has the right to ignore an incoming transaction (peg-in) from an unregistered user.

The Darknet sells KYC data from users of Bittrex, Poloniex, Bitfinex and Binance

At the time of writing, RSK Labs is stilluse a private key, which allows you to use this to limit the number of bitcoins blocked in the binding. RSK Labs stated that this is a temporary security measure, and that, in the future, they will refuse it when the percentage of combined mining exceeds the permissible 51% of the total hashrate power in Bitcoin. Although the source code shows that RSK Labs can remove this restriction by sending a special message to the smart contract that controls the binding.

From input binding to output binding

Two-way snapping is transparent, so anythe user can detect and verify input and output transactions (peg-in / peg-out), and, therefore, check federated assets at multi-subscription addresses. If the binding system is transparent, any user can check that the circulating stock of the side chain corresponds to the funds blocked in multi-subscription addresses. In addition, users can check whether the Federation is behaving improperly and whether transfers are blocked inside or outside the binding system.

RSK has a transparent binding system - allinput and output transactions (peg-in / peg-out) can be identified and verified by users. A full list of UTXO transactions belonging to the binding can be read from the smart contract launched on the platform. Additionally, current and past federated addresses are available in the smart contract. Peg-out transactions are easily identified because they are tied to UTXO.

[Note translator. UTXO (Unspent Transaction Output) - return of unspent coins that are returned to the sending address after each transaction].

Sidechain input and output transactions are fully verifiable

Liquid uses a combination of hot andcold wallets, which increases security and allows you to slightly reduce the waiting time for the output transaction (peg-out). True, such an advantage is quite expensive.

On the Bitcoin side, input transactionspaid with a multi-signature hot wallet, which is controlled by a hardware security module (HSM). The resulting UTXO output is periodically reprocessed to prevent the disaster recovery script from starting.

Liquid developers realized that the greatestthe risk for the security of the system is the output binding process, and it was decided that the bitcoins that are issued as a result of this should be sent to the cold wallet of the exchanger, and not directly to the users ’wallets.

And since in Liquid some of the functionariesare cryptocurrency exchanges - bitcoins are transferred to one of the exchange’s cold wallets, i.e. to the one on which the user is registered. And this gives the exchange the last chance to censor the transaction.

The exchange transfers funds to the user from itshot wallet, after receiving a transfer to a cold wallet. And since these two transfers are not atomic, there is always a risk that either the exchange will not transfer funds to the user after the hardware module transfers it, or if the exchange makes the transfer first, the system will crash and it will not receive the user's funds.

In any case, the requirement to use the exchange inas an intermediary, makes the KYC procedure a key and integral part of the system, and this means that the functionary is the temporary custodian of the user's funds or their sender, or both.

Yes, it improves user privacy,somewhat "obscuring" the transaction he received, but this is to the detriment of the transparency of the binding procedure and the possibility of community censorship detection - the output transaction (peg-out) is displayed on liquid.horse.

Additionally, use in Liquid scripttime-based disaster recovery means that the facilities in the cold store must be updated periodically to postpone the time-out lock, which reduces the effectiveness of cold storage in general.

But, even if transparent cold wallets andcan be easily added to RSK - it is necessary to minimize the role of functionaries. Any human action performed by the functionary as part of the standard procedure opens up additional opportunities for governments and corporations to exert pressure and censorship.

Higher security can be achieved by adding more functionaries with a more diverse set of hardware and software components.

</p>

Liquid gets bitcoins in multi-subscriptionhot wallet (peg-in), but, pays out of the hot wallet of one of the functionaries (peg-out), while receiving a refund from the multi-subscription to the cold wallet

Side Chain Censorship

Bilateral binding provides resistancecensorship on the principle of "all or nothing," because federation members cannot selectively block any input or output binding transactions without significant side effects, such as blocking a significant subset of subsequent transactions.

This property is vital, i.e.j. authoritarian governments may secretly use censorship to restrict user rights. If censorship can be applied without public disclosure, regulators and governments can exert pressure and, at their own discretion and discretion, force participating companies to block transfers.

In almost all blockchains, including Liquid, censorshipcan be overcome by introducing atomic swaps. However, this will require an active and decentralized distribution network, i.e. developed market with sufficient liquidity.

But, the creation of such a system includes the solution of all those problems that, when creating a standard blockchain + additional complexity to prevent Sivvila's attacks without using Proof-of-Work.

[Note translator. Sybil attack - a type of attack in a peer-to-peer network, as a result of which the victim only connects to the sites controlled by the attacker].

Therefore, it emphasizes the importance of resistance to censorship on the principle of "all or nothing", which is associated with the consensus of the whole sidechain.

***

The RSK sidechain provides censorship resistance through the Bitcoin network for input transactions (peg-in) and censorship resistance on an all-or-nothing basis for output transactions (peg-out).

Input transactions (peg-in) cannot be exposedcensorship, because users can submit proofs proving the inclusion of a bitcoin transaction in the sidechain, and that he received a command to issue RBTC tokens.

RSK supports every tenth miner

In turn, output transactions (peg-out)Use UTXO transactions, which are selected by the smart contract. Thus, some of the bitcoins are paid to the user, and the rest is returned to the same multi-signature federated address.

These returned bitcoins are reused insubsequent output transactions, thus creating an inextricable chain. This means that to block the first graduation transaction, functionaries must block all subsequent transactions, which depend on the output created in the first transaction.

But, there is still possible collusion 51% amongfunctionaries regarding the waste of any UTXO. However, this can be immediately detected by users. Perhaps in a future upgrade of the RSK network, a full peg-out will be introduced to maximize censorship resistance. In addition, you may need to confirm the inclusion of output transactions (peg-out) in the Bitcoin blockchain so that 51% of functionaries do not try to ignore the smart contract, which will still try to execute the order for the release of tokens.

In RSK, in the event of an attempt to censor an output transaction (peg-out), all subsequent transactions are blocked automatically due to a combination of input and output

***

But, in Liquid, functionaries may conspirefor censorship of a specific output transaction (peg-out), and individual users will not notice this, since the input UTXO for the output transaction is selected by the functionary, who goes through the KYC procedure to become one. However, since Liquid has very strict confidentiality - it is difficult for exchanges to verify each other, since each exchange can hide its LBTC addresses and use new bitcoin addresses for the binding procedure. And since Liquid is primarily intended for exchanges, and not for individual users, it does not realize additional resistance to censorship. Although, neither ordinary users nor standard exchange accounts are safe from censorship here.

In Liquid, a peg-out transaction may be censored and the system will continue to operate normally.

Federation Membership Management

Approach to managing the membership of the Federation -The fundamental difference between RSK and Liquid. Presumably, in Liquid, adding or removing members requires stopping the network and manually configuring specific nodes that are controlled by functionaries - this is necessary to check onion addresses and / or public keys of the remaining nodes. True, this is only an assumption, because the procedure was not published.

In turn, in RSK, you can organize an open protocol for adding or removing participants under common control, while the message will occur through transactions in the sidechain.

Protocol implemented with delay function bytime for the possibility of an external audit, and implies replacing the previous federation with a new one, after which the funds are automatically transferred from the previous UTXO to the new UTXO.

In RSK, funds transfer from a multi-subscription addressthe old Federation to the multi-signature address of the new Federation is an interesting multi-step process. When creating a new Federation, a request is made to the full node through the JSON-RPC endpoint.

However, the previous multi-subscription address is stillremains active for some time so that unconfirmed transactions are included in the block. After that, the smart contract sends the remaining funds to the new multi-signature address, and the previous address expires.

Audit Procedure and Management of Federation Membership in RSK

Confidentiality

One of the strongest properties of Liquid isBuilt-in support for confidential transactions - both for LBTC tokens and for issued assets. True, Liquid can hide the amount of the transaction, but not the address of the sender and receiver. Therefore, you need to work with caution to prevent address binding, as in Bitcoin.

Client wallets must be protectedappropriately to avoid leakage of private information through side channels such as traffic analysis. But, there are more confidential transactions than ordinary ones, so it is expected that the fee for a confidential transaction in Liquid will be higher when the blocks overflow.

RSK can provide almost any circuitfor private transactions in the form of user contracts developed by a third party. There are examples like Zether, Mobius and AZTEC. Also, you can ensure the greatest possible anonymity using z-Cash-like protocols on top of RSK.

These custom solutions are currentlyhide transaction amounts and destination addresses, but the sender address can still be known. Protection of source addresses requires either a market for meta-transactions (payment to a third party for the translation of a transaction) or changes in the consensus of RSK. Therefore, in RSK it is planned to improve the account so that any contract can receive messages directly from an external transaction without a source address, which will ensure complete sender anonymity if it uses Tor.

Today, the field of cryptography is developing at an unprecedented pace that previously was not, with a particular interest in the “non-interactive arguments of knowledge without knowledge”.

[Note translator - also known as zk-SNARK, a special method of creating evidence with zero disclosure].

Every year new, faster and moreThe best schemes, such as Bulletproofs, Sonic and Lelantus. In addition, there are new developments that combine privacy with smart contracts, such as Zexe and ZkVM. Therefore, it is worth considering that the presence of many options for improvements in privacy schemes is a good reason for the platform not to depend on a particular cryptographic system.

Consensus protocol

In Liquid, consensus is based on the PBFT option andsupported by a group of selected functionaries. Functionaries sequentially monitor the cyclical process of creating new blocks - the transaction is considered completed after it is confirmed in two blocks. The functionaries themselves are connected through the Tor overlay network, hiding their real geographic location and IP addresses. This is a really interesting feature that is required in Liquid, but optional in RSK.

RSK uses a combined mining model withSHA-256 algorithm, which provides the same principle of operation as in Bitcoin. Currently, from 30% to 50% of miners participate in RSK combined mining.

"Chained by one chain"

In both Liquid and RSK, miners receive commissionsfrom transactions included in blocks. True, in Liquid miners can conspire to ignore blocks of other miners and become producers of blocks more often than they should, receiving a higher share of transaction fees. This aspect is a side effect of the cyclic planning model.

But, this can be detected by functionaries who are not involved in conspiracy, and therefore it will be difficult to carry out this attack secretly several times.

RSK uses one common thing for minersan account with an average commission and a protocol for the distribution of rewards DECOR + in order to stimulate not competition, but cooperation between miners.

Sidechains with combined mining, whichare a way to increase the value and functionality of Bitcoin should be opposed to other [dubious] alternatives, such as increasing the block and hard forks, which is a very controversial option, although many miners have had such a temptation in the past.

According to Paul Sztorc, the opportunities created (in the form of a drive chain) eliminate the need for outdated and more dangerous options.

[Note translator. Drivechain is an alternative to the sidechain concept, where miners report on the current state of the sidechain. In other words, they are custodians of funds and can unfreeze them for users who want to move their coins back to the main blockchain. This concept was developed by the creator of Bitcoin Hivemind - Paul Storz].

Driving chains: how two new offers can change Bitcoin DNA

The same rule applies to sidechains. In addition, combined mining allows you to become miners, receiving commissions for transactions, not only to members of the Federation, but also to other new users.

Asset issue

In both Liquid and RSK, you can createuser assets. At RSK, assets can be issued using the ERC-20 standard, which is commonly used in Ethereum. Liquid also offers its own embedded implementation of asset release.

And on that, and on another platform released assetscan be freely transferred between users. However, the liquid assets issued are not compatible with light clients, as the platform does not include a commitment in each block header regarding the current UTXO set or asset issue.

At the same time, RSK provides much moresignificant control over operations with assets, since a high-level programming language is used to create them. Using high-level programs - RSK can support the payment of dividends and interest on tokens, demurrage, as well as various ideas from the field of DeFi.

Both sidechains are capable of supporting paymentLayer 2 networks such as RIF Lumino Payments (in the case of RSK) and the Lightning Network ported to Liquid. And although Lumino initially implies the use of various assets - it is worth believing that the Lightning Network, at the moment, does not support working with several assets where nodes, communications and routing are involved.

Transaction cost

Currently, the transaction fee in RSK is 10times cheaper than in Liquid (0.0066 USD versus 0.10 USD for a simple payment). This is partly due to the fact that in RSK simple transactions take up 5 times less space than in Liquid. However, cheap transactions are a double-edged sword, as it can increase the size of the blockchain beyond acceptable limits and centralize a peer-to-peer network.

Additionally, in Liquid, to become partFederation - you must pay a monthly fee in favor of Blockstream. At RSK, members of the Federation do not pay fees, but it is required to comply with safety standards and ensure a predetermined time for continuous operation.

Future

Whitepaper RSK has a development plan andsocial agreement regarding immutability and resistance to censorship. Suggestions for improvement are publicly discussed and included in the implementation by major developers. Some of the planned features include switching to Unitrie storage model and adoption of rental storage system. The RSK repository has been showing continuous improvements since 2016 and several network updates that have required hard forks.

But Blockstream does not publish its roada map. However, the Liquid repository on GitHub, which apparently represents the Elements Project, has also shown continuous improvement since 2016, but has not undergone major changes.

One of the key features of the whitewater RSKit is the stated intention to switch to a more decentralized system of bilateral binding according to the type of driver chain, by the time Bitcoin is ready to accept soft fork with the support of the community. RSK Labs has already created Drivechain BIP and a reference implementation that Bitcoin core developers can use in the future.

Conclusion

RSK is a sidechain that aims to become the cornerstone of financial inclusion, focusing on decentralized finance (DeFi).

Liquid is a sidechain designed forproviding general liquidity for exchanges. The focus is on protocol simplicity, security and privacy. Therefore, RSK intends to solve a much wider range of tasks, while Liquid seeks to be extremely effective in one.

Using a stateful virtual machine - RSK provides greater openness and flexibility, while Liquid has a simplified priority check over code capabilities.

RSK compatibility with Ethereum makes it easyport Ethereum dApps and other tools to RSK, which gives you access to a large pool of open source resources. Liquid, however, requires developers to use their own Blockstream libraries for security reasons, and currently the community has no alternative.

Both sidechains are supported by experienced development teams. Liquid is supported by Blockstream, while RSK is supported by IOV Labs.

Both sidechains have well-known exchanges among Federation members, where their internal tokens, RBTC and LBTC, are also traded.

We are witnessing the creation of a future for Bitcoin, which will not be limited by the bandwidth of its blockchain, but will expand due to the Lightning Network, Liquid and RSK.

Sidechains and Lightning

The authors of this article thank Adam Beck for reviewing the material and providing useful information.

</p>