Skip to content

Commit

Permalink
Add details about Stellar Oracle
Browse files Browse the repository at this point in the history
  • Loading branch information
TorstenStueber committed Feb 10, 2022
1 parent 5b7e614 commit ed55962
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions applications/spacewalk-bridge.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ The architecture of the bridge consists of the following components:

- **Vaults**: this is a set of escrow accounts used to lock assets in Stellar. Their behavior is defined in XCLAIM and interBTC. In Spacewalk they have an additional property: each vault has an allow list of assets that it can lock and support for bridging operations between Stellar and the Substrate chain. This allow list is implemented through [trustlines](https://developers.stellar.org/docs/issuing-assets/anatomy-of-an-asset/#trustlines) of the Stellar account. There can be at most 1000 supported assets per vault due to limitations in Stellar. Stellar users initiate a deposit by sending tokens to an appropriate vault, which they request from the bridge pallet prior to the deposit. Likewise vaults will unlock and send tokens back to Stellar accounts during a withdrawal. Every vault needs to lock a certain amount of DOT or KSM (or related) tokens as collateral with the bridge pallet. These tokens are slashed in case the vault misbehaves.
- **Bridge Pallet**: this is the main component of the Spacewalk bridge that implements all logic on the side of the Substrate-based chain. Its behavior is based on interBTC. It is particularly responsible for minting tokens during deposits and burning tokens during withdrawals. It is able to support any Stellar asset by employing the [Tokens](https://github.com/open-web3-stack/open-runtime-module-library/tree/master/tokens) and [Currrencies](https://github.com/open-web3-stack/open-runtime-module-library/tree/master/currencies) pallets of the Substrate Open Runtime Module Library. The storage of the bridge pallet maintains the complete state that is required for the bridge to work correctly. This state contains (among others): the account ids of the vaults, the asset allow lists of each vault and book keeping information about the state of the Stellar network.
- **Stellar Oracle**: is a system that provides information about the state of the Stellar network to the bridge pallet. In interBTC this is implemented through a chain relay in the bridge pallet. However, we will aim for a solution where every node of the Substrate-based chain is co-located with a Stellar validator node, which it uses as an oracle.
- **Stellar Oracle**: is a decentralized system that provides information about the state of the Stellar network to the bridge pallet. In interBTC this is implemented through a Bitcoin chain relay. However, for reasons explaned above we cannot implement a chain relay for Stellar in the same way. The Stellar oracle is trustless and reliable and its functionality is based on specific unique aspects of Stellar:
- The Stellar network has multiple levels of tiers, where the nodes in _Tier 1_ enjoy the highest level of trust of its peers. There are currently 23 Tier 1 nodes; this set and its structure is rather static and only changes rarely. It only ever changes through a voting process. We will incorporate complete information about the Tier 1 network in the bridge pallet.
- Every Stellar node has a static signing key pair and signs messages that it gossips to the network. Particularly, every node announces through a signed message that a block has been finalized. The decentralized oracle will forward these signed messages from Tier 1 nodes to the bridge pallet. This way the bridge pallet can reliably infer what Stellar blocks are finalized.

**Out of scope**

Expand Down Expand Up @@ -168,14 +170,14 @@ A detailed bridge concept is currently being researched (described in this grant
- **FTE:** 0.5
- **Costs:** 3,000 USD

| Number | Deliverable | Specification |
| -----: | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 0a. | License | Apache 2.0 / GPLv3 / MIT / Unlicense |
| 0b. | Documentation | We will provide both inline documentation of the code and a basic tutorial that explains how a user can employ the bridge pallet and the Spacewalk protocol to build a working bridge. |
| 0c. | Testing Guide | Core functions will be fully covered by unit tests to ensure functionality and robustness. In the guide, we will describe how to run these tests. |
| 0d. | Article | We will publish an article that explains the completed Spacewalk protocol and pallet that we built as part of the grant. |
| 1. | Protocol specification | The protocol will describe how the bridge pallet interacts with the oracle. |
| 2. | Stellar oracle with consensus | The bridge pallet queries a trusted Stellar node to inquire about incoming deposits. The bridge nodes will find consensus about the state of Stellar through voting. |
| Number | Deliverable | Specification |
| -----: | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 0a. | License | Apache 2.0 / GPLv3 / MIT / Unlicense |
| 0b. | Documentation | We will provide both inline documentation of the code and a basic tutorial that explains how a user can employ the bridge pallet and the Spacewalk protocol to build a working bridge. |
| 0c. | Testing Guide | Core functions will be fully covered by unit tests to ensure functionality and robustness. In the guide, we will describe how to run these tests. |
| 0d. | Article | We will publish an article that explains the completed Spacewalk protocol and pallet that we built as part of the grant. |
| 1. | Protocol specification | The protocol will specify how the Stellar oracle behaves and what messages it forwards to the bridge pallet. |
| 2. | Stellar oracle consensus | The bridge pallet processes information received from the oracle, which comprises signed messages from Tier 1 Stellar nodes. This is used to reliably find consensus about finalized Stellar blocks and incoming deposits. |

## Future Plans

Expand Down

0 comments on commit ed55962

Please sign in to comment.