Atomic Swaps with Hive Core Integration

in Hive Improvement4 years ago

Atomic Swaps with Hive Core Integration

stylized atom render


The other day I made a post trying to gauge interest in having an atomic swap mechanism built into the Hive source code for support with on-chain, trustless token swaps across blockchains.

Due to the response of everyone that replied, I am going to be spending the next few weeks creating a proof of concept implementation that can be deployed on a testnet eventually to demonstrate atomic token swaps between Testnet Hive and Testnet Ethereum (Medalla/Ropsten) and Testnet EOS (Kylin/Jungle).

Enabling atomic token swaps (or cross-chain token transfers) will allow Hive to benefit from the functionality of various smart contract enabled blockchains. For instance, a user could swap their Hive for wHIVE on the Ethereum blockchain and then interact with Ethereum smart contracts. This would essentially give developers the ability to build applications on whatever supported blockchain they wish and have the functionality translate to the Hive blockchain.


Comments and Suggestions

If you have any comments or suggestions that you think would be helpful and/or informative, definitely drop them below and lets keep this discussion going on-chain. Don't be shy!


To fund this work, please review and vote for my Hive development proposal at https://peakd.com/hive/@netuoso/proposal-on-going-hive-chain-development-new-features-testing-and-developer-support. I don't think there is a need to create a new proposal for this work because it directly relates to the Hive core development proposal that I have already running. However, I want it to be clear that I think atomic swaps should be built into Hive as a plugin so witness users can decide if they want to support it or not. Having the token swap code contained within plugins will also make development support much easier when it comes to making changes or modifications that should only affect a single blockchain bridge as opposed to all of them.

Support This Proposal

Don't forget to Comment/Like/Share this post for more visibility

Sort:  

You should talk to @bobinson, he worked on Sidechain Operator Node ( SONs ) for PeerPlays so maybe some code could be used for Hive too.

https://peerplays.gitbook.io/community-project-docs/son/son-requirements-specification

Definitely will be reviewing the code they added to peerplays. He mentioned it on my post from the other day. It is awesome if we can reuse any work out there even if its just reusing the theory.

There are a few things in there I don't fully agree with though so maybe they still need to be open ended discussions within the Hive network. For instance, I don't think witnesses (or whatever name we give those running the Atomic Plugins) should get a fee based on number of transfer transactions they sign. This could easily be manipulated with a flood of low value transfers executed when a particular witness is scheduled to sign.

Other than that, the specification you linked pretty much seems to cover a lot of what I envision for swaps on Hive. Mainly thru the use of optional plugins ran by witness users that do not maintain state, but only facilitate transfers.

Thanks @fbslo

For instance, I don't think witnesses (or whatever name we give those running the Atomic Plugins) should get a fee based on number of transfer transactions they sign. This could easily be manipulated with a flood of low value transfers executed when a particular witness is scheduled to sign.

This is a very good point.

We are not only considering the number of transactions. We are looking into other parameters like uptime via a "statistics object". The idea is to observe the behavior and extend the parameters - we are running an extended public TESTNET to iron out this.

Further we are limiting/capping the daily rewards so even if someone decides to attack, the transaction fee on Etherium or Bitcoin networks will prevent such an attack. The daily reward limits are changeable and the committee members can do so.

Suggestions welcome. If there are new ideas we can adapt them.

hey , if @someguy123 would get swap.hive on eos liek he had eos steemp, we can have https://alcor.exchange and telos.alcor.exchange list HIVE EOS and HIVE TLOS and we can also use https://transledger.io for ETH STEEM AND HIVE COME talk to Didier PH martin

we have LIQUIDITY POOLS ON ALCOR :)

This is huge. You #HiveDevs are really crushing it with the projects that are being worked on - I'm so happy to be a part of a blockchain where there's so much individual talent willing to come together for the greater good.

I finally have a decent stakeholding size, so I will definitely support this proposal right now. Thank you for your contributions!

Awesome. I just want to say when this is done I will be paying a bounty ontop of the DAO prop just because I believe this is so important to Hive. Cheers Netuoso. Anyone not voting for his proposal go vote!

Thanks Dan!

Awesome news :) @tipu curate 3

Initially I wanted to ask about BTC support but we need smart contracts platform to mint new tokens. May the force be with you!

Well, you could swap Hive to wHIVE and then wHIVE to BTC when they are all eventually supported. But with every supported chain, we will need a liquidity pool available to facilitate the transfers.

I think at first, starting with ETH or EOS will be the easiest but any chain of value could be added once the base logic is working.

  1. Agree on the liquidity part.

  2. EOS will be easier IMHO

Right, you are working on swaps, not wrapping hive on eth/eos networks. Recently we had few of those new ideas on hive and I start to get confused :)

This would essentially give developers the ability to build applications on whatever supported blockchain they wish and have the functionality translate to the Hive blockchain.

This is a really interesting aspect and has a lot of potential - such as having the ability to use cross-chain smart-contracts.

One of the much talked about obstacles for ETH going forward are rising Gas fees.
That's just the current reality until ETH 2.0 reaches its final upgrades, there's not much anyone can do to avoid it. How do you see Gas fees playing a factor here?
Just as an example, using UniSwap atm users are sometimes paying $10 usd transaction fees (idk who much Gwei that comes to) is pretty steep for average users.

One thing that comes to mind is some wallets cover (expensive) transaction fees [ETH] or CPU [EOS] for their users - Anchor Wallet by @greymass does this or Bloks.io in the EOS ecosystem.

Is this something that you envision could be added to Vessel down the line so average users don't get priced out by exorbitant fees?

Cheers, thanks in advance and I'll be voting for this proposal as I think it's an important step in the right direction.

Cool idea. Will suggest to look at SimpleSwap and build something that others can insert on their website. https://simpleswap.io/

Just thought is good to share it

My tweet link

Not sure. They could target different markets but Hive engine is definitely it's own stand alone product.

I think they will complement, as dswap will be engaged in wrapping other coins on hive blockchain and taking advantage of no fees, but has to get user base, atomic swaps gives the ability to wrap hive and use them on ethereum blockchain, that has fees, but can be then used in any app that supports ERC20 coins, like uniswap with big user base

Great one!
Glad that you are doing this.

This is a good idea. Interoperability is key to massively increasing value of the entire space through a more powerful network effect.

Metcalfe's law says that the value of a network is proportional to the square of the number of its nodes. With each blockchain project being an island, the value of the entire space could roughly be said to be proportional to b12 + b22 + b32 + ... + bn2 where bn is the size of a project in terms of network participants. Obviously, (b1+b2+b3+...+bn)2 is a MUCH bigger number.

Building bridges between projects and more multi-chain apps is an obvious way to boost the value of the entire space. Multi-chain apps that can seamlessly and automatically plug in chains that have free capacity and fit the purpose is one way to do that.

Would there be oracles involved watching activity on the other chains? Do you have a design in mind for how that would work?

The sound of plugins gives me the impression that this feature might not be admissible for smartphone users. Is there a way to simply this so also have mobile usage too?

Well, if you can show me a Hive node, even a witness node, running and working on a smartphone I will give you a bounty!

Hah just messing with you. This is related to the blockchain code specifically. The blockchain can be accessed from any device, smartphone/laptop/television, basically anything with internet and a browser really.

So if this feature were added, you could theoretically send a transfer via your smartphone from Hive to Ethereum and back.

You have been helpful...

Thanks for taking the time to do it!

What a great job this is, I hope everything goes as you wish, always successful @neutuso! You are so cool and great ....:-)

Yeah man!! You rules!! Voted!!

Super happy to be reading this.

Exciting times are ahead

This is a very good idea. Otherwise I have no idea what this programming looks like in practice but it is definitely a step forward.
There is probably some difference between these plugins and the so-called “second layer” for hive-engine tokens, but I think this step/plugin/whatever will help to extend dapps and games to other chains.

This looks like a great proposal, i joined your cause. Good Luck!

Voted.

Due to the response of everyone that replied, I am going to be spending the next few weeks creating a proof of concept implementation that can be deployed on a testnet eventually

It clearly says testnet but I have understood from comments that it will be possible to swap it with ETH through wHIVE. So I guess, it won't just be on testnets?

First implementation will be released supporting testnets so the feature can be reviewed before it goes live. Beyond that I will try to have it ready for the next Hive hard fork

I'd love to have atomic swaps for HIVE so we could leverage all the DE-FI apps on ETH, if we could lock HIVE into smart contracts for things like liquidity pools we could have more demand for the tokens, pull some out of circulation and also the gas fees may also lock up HIVE forever, like we see with tokens as its not worth the transfer and then well HIVE dust I guess, I hate dust but hey it does drive token value somewhat.

Congratulations @netuoso! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s) :

Your post got the highest payout of the day

You can view your badges on your board And compare to others on the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Do not miss the last post from @hivebuzz:

Project Activity Update
The Customization Guide for the HiveBuzz store

上午好,上午好(^o^)/

For instance, a user could swap their Hive for wHIVE on the Ethereum blockchain and then interact with Ethereum smart contracts.

Does this mean "wHive" will be token on Ethereum that will be backed by Hive?
How secure will "wHive" will be?

I think @fbslo is going to be handling most of that. He has some work done already. I will be focusing on the Hive integration part

Yes, wHIVE ERC20 tokens will be backed by HIVE. Alpha version (probably coming on Monday) will be centralized, so it will not as secure as coins like WETH that are fully managed by a smart contract, but more like SWAP.HIVE.

I have written a post about options to decentralize WHIVE (https://hive.blog/hive/@fbslo/decentralization-of-wrapped-hive-discussion).

I cannot deprecate this proposition, which is of inestimable value potential to Hive.

However, I will encourage you to examine dependencies. Hive currently depends, as do all cryptos, on access to an uncensored internet. ISPs are a crucial bottleneck that could disrupt all crypto, even were atomic swaps enabled.

I hope competent devs like you undertake to mitigate this threat before the trap is triggered.

Thanks!

Very good idea 💡 ! Thanks for researching and BUIDLing this !

This sounds purrtty cool!