Introducing Spacewalk: The trust-minimized bridge between Stellar and Polkadot
Spacewalk will enable Pendulum chain to utilize the multitude of fiat stable tokens on the Stellar blockchain and help build the fiat DeFi future. Spacewalk is the first bridge between the Stellar network and the Polkadot/Kusama ecosystems, which opens up a flow of stable tokens from the Stellar network. Based on XCLAIM and interBTC, it is implemented as a Substrate pallet and allows any Substrate-based blockchain to implement a direct Stellar bridge.
Spacewalk will be a trustless and decentralized bridge built to connect Pendulum and Stellar, but it can also be plugged into any Substrate-based blockchain on Polkadot. This article takes you on a walking tour of everything Spacewalk.
How the Spacewalk bridge works
In this article we consider how to bridge Stellar to any Substrate-based blockchain (like Pendulum) that uses the Spacewalk Substrate pallet. Let’s refer to the latter chain as the “Spacewalk chain” for simplicity. Tokens will be temporarily locked inside Stellar and respective “wrapped tokens” minted 1:1 in the Spacewalk chain. We say that this kind of wrapped asset is cryptocurrency-backed. Here’s how issuing and redeeming tokens will work.
- Step 1: User sends tokens from their Stellar account to a dedicated locking account which makes them temporarily unusable in the Stellar network
- Step 2: Immediately after step 1 the Spacewalk pallet will mint wrapped tokens and send them to the user’s account inside the Spacewalk chain
- Step 1: The user burns wrapped tokens in the Spacewalk chain via the Spacewalk pallet
- Step 2: Shortly after tokens will be unlocked inside Stellar and sent back to the user’s account
The Stellar locking account has one or multiple shared owners that control it and need to be trusted to not attempt a Sybil attack. A Sybil attack, just like the recent Axie Infinity Ronin attack, is where an attacker controls the majority of account owners and tries to use tokens for their own purposes. Security can be maximized by using a large number of independent account owners. Spacewalk enhances the security of Stellar locking accounts through adopting a similar approach to InterBTC.
Another challenge that exists is the “oracle problem” whereby the Spacewalk pallet needs to have correct information about transactions on Stellar so it can reliably mint wrapped tokens after the user locks tokens. We’ll dive into the Stellar Oracle solution later too.
Spacewalk Adopts InterBTC’s Vaults Solution
Spacewalk originates from InterBTC by replacing Bitcoin components with Stellar-based components. In a nutshell, InterBTC is a Polkadot parachain Bitcoin bridge that uses over-collateralized vaults to achieve decentralization not by decentralizing the owners of the locking account, but by decentralizing the locking account itself. Here’s how it works.
- everyone is free to create their own vault (and become an owner of that vault) in a permissionless manner
- this way the set of vaults can dynamically change and grow
- any user who wants to issue wrapped tokens can freely pick any vault to lock their Bitcoin
- any vault owner needs to lock collateral on the Interlay blockchain via the InterBTC pallet with the asset usually being DOT
- this collateral needs to be locked as long as the vault exists
- the value of the collateral should be 150% of the value of the Bitcoins locked in the vault (overcollateralized) — InterBTC uses a price oracle to compare Bitcoin and DOT prices
- if a vault owner misbehaves, then (parts of) their collateral will be slashed and any user who was affected negatively will be refunded through the collateral (collateral value being higher than the locked Bitcoin value ensures full refunds for users even if the vault owner spends all locked tokens)
There are some crucial differences between Bitcoin and Stellar including:
- Stellar supports a wide variety of assets and every Stellar user can freely create their own custom assets.
- Stellar does not employ Nakamoto consensus but a custom consensus algorithm called Stellar Consensus Protocol. For that reason it is not possible to infer merely from sequences of block headers which sequence is valid — for Nakamoto consensus this is simply the sequence with the highest amount of work. On Stellar, block headers must be signed by a quorum of trusted validators to be considered valid.
The Spacewalk Vaults Solution with Multiple Assets
Every vault on Spacewalk will be able to support multiple assets. For that purpose it uses a Stellar feature called trustlines. By setting up trustlines for specific assets on the vault account in Stellar, it can control what asset it supports for bridging. When bridging, the user additionally specifies what asset they intend to issue or redeem. With multiple assets, calculating the collateral value of each vault becomes more complex so the protocol needs to use a price feed oracle. Additionally it requires another oracle in order to solve the aforementioned oracle problem. Enter Stellar Oracle.
The Stellar oracle is decentralized and by design at least as secure as the Stellar network itself. It uses special properties of the Stellar Consensus Protocol, a special purpose consensus algorithm used in Stellar. Stellar is a decentralized system of nodes that is organized in tiers with the most significant tier being Tier 1. Every 5 seconds the nodes in a Stellar network vote on finalizing a new block. The Tier 1 nodes predefine a fixed set of quorums, where a quorum is a subset of Tier 1 nodes. The quorums are defined in such a way that between two different quorums there is always at least one Tier 1 node that is in both quorums. Learn more about this process here: https://www.stellar.org/papers/stellar-consensus-protocol.
The Spacewalk pallet stores information about the set of Tier 1 Stellar nodes, their public keys (used to validate signed externalized messages sent by them) and all Tier 1 quorums. The Stellar oracle will forward signed externalized messages from all Tier 1 nodes to the Spacewalk pallet. The Spacewalk pallet will validate the signatures and can conclude that a specific block is final whenever it identifies that any Tier 1 quorum voted on that block. The set of Tier 1 nodes, their quorums and their signing keypairs are dynamic and can change over time (rarely about one change per year) and Spacewalk uses a governance mechanism to keep in sync with these changes.
Three Milestones for Developing Spacewalk
Milestone 1 (we are here): Define the fundamental structure of the project
- The Spacewalk code repository will consist of the Spacewalk pallet, some offchain clients to operate vaults and oracles, and a Substrate standalone chain that implements the Spacewalk pallet that is used for testing purposes.
- Integrate multi-asset support: vaults will support multiple assets and a user can issue and redeem different kinds of Stellar assets
Milestone 2: Implement how to manage collateral for multiple Stellar assets
- Use a price feed oracle for all assets supported by the vault
- Determine the total combined value of all tokens locked in the vault account and compare the value of the collateral
Milestone 3: Implement the Stellar oracle and all its components
- Add a mechanism to store and maintain the current configuration of the Tier 1 network, including its public signing keys and the set of Tier 1 quorums
Spacewalking into the Fiat DeFi Future
The Spacewalk bridge will combine both Stellar and InterBTC innovations to begin a new era of trust-minimized bridges in blockchain. This high level of decentralization, security and trustlessness can help Pendulum become the missing link between fintech fiat services and DeFi.
Want to learn more about Spacewalk?
Our CTO Torsten Stüber will present Spacewalk at the Polkadot Decoded event if the topic gets enough votes from the community. We’re giving away 1000 $ASTR tokens for casting your vote in support of Pendulum here!