Decentralized Gateways to make nodes profitable

There’s an obvious risk to having trusted centralized Gateways. How can anyone trust that they will be there to swap your wBTC back to BTC years from now?

The following is a suggestion as to how to decentralize the Gateways and simultaneously increase the collective value of the Waves Network.

This will be using BTC/wBTC as an example but it applies equally to all coins needing a Gateway…

A preparation step is to introduce a new ‘type’ of Waves token called (for example) a ProxyToken.
ProxyTokens will act and behave like all other tokens, but they will have one difference:
ANYONE can issue ANY AMOUNT of them at any time, but the fee would not be 1 Waves - it would be equal to (or as close as possible to) the purchase price of the related asset - and this fee would be distributed evenly to all forging nodes.

For example, to create 0.1 pBTC, I could pay a fee of (approx) 330 Waves - which will be distributed to all forging nodes.

Unlike the current wBTC-type tokens, issuing ProxyTokens on the network will ADD VALUE to the Waves network through the payment and distribution of fees equivalent to the value of the asset issued. Collectively, everyone will benefit as external coins are introduced into the Network - like pumping up an infinitely expandable balloon.

Then…

Gateway functionality should be added to ALL nodes (that wish to enable and support it.)

Moving BTC -> pBTC and pBTC -> BTC should be done by Atomic Swap functionality built into each node.

But…To perform a swap, the participating node will have to have reserves in the token/coin that is the other ‘side’ of the swap.

For example:
I send 0.1 BTC from an external address to a Waves address.
A ‘gateway active’ Node that owns 0.1 pBTC gets to forge the transaction and the do the swap.
This node sends their 0.1 pBTC to my Waves address and it keeps the 0.1 BTC I sent + a special swap fee.
The same on the way out: The forging node must own the amount of BTC to send out before they can accept the pBTC.

Participating nodes will therefore have to build a reserve of both real assets and ProxyTokens (by buying and/or issuing them) to participate in the swaps, but they could also choose only to support one way or the other.

Node participation in gateway functions will be optional, but the extra fees should be a strong incentive.

The special fees for these gateway ‘swaps’ (for participating nodes) + the fees for ProxyToken issuance will make Waves nodes very profitable.

2 Likes

ANYONE can issue ANY AMOUNT of them at any time, but the fee would not be 1 Waves - it would be equal to (or as close as possible to) the purchase price of the related asset - and this fee would be distributed evenly to all forging nodes.
For example, to create 0.1 pBTC, I could pay a fee of (approx) 330 Waves - which will be distributed to all forging nodes.

In that case you’re building “fake” BTC, which is not pegged to BTC, but to Waves. This would be worse than Bitshares.

Moving BTC -> pBTC and pBTC -> BTC should be done by Atomic Swap functionality built into each node.
How exactly? I haven’t seen any sensible proposal that uses AS to make gateways.

There is a much simpler way to make a pretty secure, decentralized Gateway on Waves: Multisig the shit out of them. :slight_smile:
For example, you take 10 most trusted members of the community, they make a 8/10 addreses for BTC deposits and gBTC asset. They are running a node with special software that handles deposits and withdrawals.
If one or two of them disappears, you hire a new co-signer and you remake the keys. No problem.
If more than two disappear at the same time, I propose a scheme to make funds recoverable:
Every co-signer makes a set of time-locked-puzzle, that will be opened after they disappear. Time-locked-puzzle is designed as follows:

  1. The co-signer generates his own hierarchical-deterministic private key, which can be used to generate infinite number of addresses. [PRIVATE KEY]
  2. PRIVATE KEY is encrypted with a random, symmetrical PASSWORD. [ENCRYPTED PRIVATE KEY]
  3. The co-signer sends the ENCRYPTED PRIVATE KEY to all other 9 co-signers.
  4. The co-signer creates a [time-lock puzzle + 7/9 secret sharing combination] that will be opened in 1 year if 7 co-signers combine their secret sharing. That ensures, that if 3 co-signers die at the same time, funds will be recoverable after 1 year.
  5. The co-signer creates a [time-lock puzzle + 6/9 secret sharing combination] that will be opened in 1 year 3 months if 6 co-signers combine their secret. That ensures, that if 4 co-signers die at the same time, funds will be recoverable after 1 year 3 months.

  1. The co-signer creates a [time-lock puzzle + 2/9 secret sharing combination] that will be opened in 4 years 9 months if 2 co-signers combine their secret. That ensures, that if 8 co-signers die at the same time, funds will be recoverable after 4 years 9 months.
  2. The co-signer creates a [time-lock puzzle] that will be opened in 6 years. That ensures, that if 9 co-signers die at the same time, funds will be recoverable after 6 years.

And the keys to the Gateway [and thus subsequent deposit/withdrawal addresses] are rotated every 6 months to ensure that 7 co-signers can’t run with the money.

If someone wants to steal this idea, I’d be really happy. :slight_smile: Unfortunately I don’t have time to implement this.

“In that case you’re building “fake” BTC, which is not pegged to BTC, but to Waves. This would be worse than Bitshares.”

I don’t understand how it would be pegged to Waves. Maybe I didn’t explain properly. The price to issue one pBTC would be whatever the lowest offer is on the DEX. Like wBTC, pBTC would be traded and arbitraged to always be generally close to the actual BTC price. It wouldn’t be pegged to anything as far as I can see. But maybe you can explain what you mean better.

Also, for it to function on the DEX with reasonable speed, it has to be a ‘fake’ BTC like wBTC and gBTC that you suggest. Even centralised exchanges have their own internal database of info - essentially fake BTC - in order to trade quickly and settle in real BTC later.

The main concern is: can I get my BTC out one day? What is the least risky way? One group holding all the BTC and 20+ million wBTC that they can gift themselves whenever, a group of 10 ‘trusted’ people who could be tempted by the 100s of million of dollars that they could run away with one day, or any number of nodes who wish to offer a swap service for a fee?

Like wBTC, pBTC would be traded and arbitraged to always be generally close to the actual BTC price.

You need to elaborate this part. This is the key. How 1pBTC is gonna keep the price of 1BTC is the main issue.

Please, describe it step by step, just like you’d be writing an algorithm. Describe how the system will work in corner cases - what will happen when the price rises by 50% in one day, what will happen when the price falls by 50% - how it’s gonna keep the peg.
Describe exactly who and how it’s gonna be issued. Describe precisely what do you mean by “Atomic Swap” and how’d you implement it. What are the economic incentives.

Basically, describe your idea like BitShares folks did their: https://bitshares.org/technology/price-stable-cryptocurrencies/
You need to be precise since gateway is a very difficult topic.

The best way to do it would be with smart contracts, and all full nodes as signers on the smart contracts, see my full scenario and description here, https://forum.wavesplatform.com/t/how-are-crypto-gateways-secured-and-what-would-happen-if-they-are-hacked/1860/6

What I’m suggesting is reducing the single point of failure at a gateways by introducing an ecosystem that allows multiple gateways to deposit and withdrawal the same proxy token. Or better the witnessing and transacting of proxy tokens could become a function of full nodes. This could be done using smart contracts. If user A sends Eth to a public address controlled by a multiparty (all full nodes) smart contract, once witnessed by X (2/3) nodes the proxy token is issued by the smart contract. Vise versa for withdrawals. Slashing conditions could apply for bad actors.