ShareLedger Swap/Bridge Overview Part 1

February 3, 2023

There's been a lot of questions around how our bridge works and where the tokens go to when the bridge is used. This blog attempts to provide a detailed overview and answer any of the questions that have been raised.

 

Firstly, a simple overview, followed by a more technical description.

As most of you know, the purpose of the bridge is to allow token holders to move their ShareToken (SHR) from one of our supported chains to another (ie. From Ethereum to ShareLedger, or from Binance Chain to ShareLeger and back again). To do this, we use a 'peg' wallet mechanism that ensures the 'circulating supply' remains constant throughout the supported chains. This, in turn, also makes sure that the circulating tokens never exceeds the Max Supply.

Let's start with the ERC20 (Ethereum) to SLP3 (ShareLedger) bridge:

One of our design principals when creating the bridge was that the non-ShareLedger side needed to consume the smallest amount of gas as possible. To do this, we decided to create a 'hub and spoke' type of PEG wallet. Basically, the first time a user initiates a ERC20 to SLP3 bridge from the app, the app will allocate a unique wallet to that user for them to send the ERC20-SHR to. We then have a contract that will monitor this wallet for a deposit of SHR. When a deposit is made and the transaction is confirmed, the ShareLedger contract will send some SHR from the ShareLedger peg wallet to the users ShareLedger account.

 

The ShareLedger PEG address is:

This is the reason why the main PEG wallet (address: 0xe503f9a8653CDeb807C41aEeaccB9C0dE3C9AAC1 ) often looks like it's running low. When this is running low, we have a process that automatically sweeps SHR up from the individual user PEG wallets to the main PEG wallet. This process costs us GAS, hence the reason we charge a fee (in SHR) for incoming swaps).

The same process is used for BEP20, as it also supports EVM contracts.

 

All incoming (BEP20/ERC20 to ShareLedger) bridge transactions are completely automated and instantaneous. If there are any delays, it's due to the PEG wallet requiring top up.

 

Below is a snapshot of a regular report that we run that shows us the wallets and balances of the individual PEG wallets in Ethereum. We have a similar one for BEP20 (note: The addresses have been partially blanked on purpose):

Currently (as at 18/Dec) there are 1359 individual PEG wallets, with a total of 429,439,281.32 SHR in them.

More to come in part 2. Stay tuned.

From the ShareRing Blog

Keep reading

See all articles
Read this article
Read this article
Read this article
Read this article
Read this article
Read this article
Read this article
Read this article
Get Started with ShareRing

Secure your digital future

Galaxy Store Logo
Download for iOS