Hive Bridge - Atomic Token Swaps
[IMAGE: https://files.peakd.com/file/peakd-hive/netuoso/yWpZIQL8-image.png]
In a recent video by @theycallmedan, he brings up the idea of wrapping the HIVE token in an ETH contract to facilitate Hive -> Ethereum token transfers and getting HIVE listed on the Uniswap DEX.
This is a topic that has come up many times before in the past and I have put a little bit of thought into how it could be implemented on Hive. In my opinion, atomic token swaps should be integrated into the core blockchain code and processed by witnesses like normal transactions.
HF24 is feature locked right now and a code release candidate should be coming out shortly (definitely within this month). With that said, now is the time to start looking to what modifications should be included in HF25. If we can get atomic token swaps enabled in the following hardfork, Hive will be in a position to integrate directly with countless other blockchains (Ethereum, Bitcoin, EOS, Tezos, etc etc).
Of course, cross-chain token swaps can already be enabled today through the added use of Oracles. The caveat with this implementation is that it adds a layer of trust that is necessary; which some may say is the antithesis to the idea of blockchain in the first place.
If the atomic token swaps were built into the Hive source code, I envision that the code would be delivered as an optional plugin that a witness user can choose to run. If the witness has enabled the "bridge" plugin, when processing blocks they will also process the pending atomic token swaps by first verifying balances on the Ethereum based smart contract that holds the wrapped Hive tokens.
If for some reason the witness server cannot make a proper verification of funds, the transaction will not be processed and will instead enter into a pending queue until the balances can be properly verified.
Building the atomic token swap code into the blockchain can further enable new features in the internal market. However, supporting additional tokens on the internal market would probably be a change to make a bit more down the road after the base atomic swap framework can be fully tested and verified.
Some other developers have started some work related to wrapping Hive on Ethereum. I think @fbslo and @lightproject have some experience here also.
So what do you think? Would you support the inclusion of atomic token swaps (cross-chain token swaps) in Hive for HF25? Do you have any suggestions or input on things that I have not mentioned here or that I didn't cover thoroughly enough?
If so, leave your questions/comments below and let's get a discussion started about the future of the Hive blockchain.
Nah the only Uniswap experience I have so far is thru research and reading their website and docs. But essentially it requires an ETH token contract that represents "wrapped HIVE".
Of course the balances cannot just be created out of thin air. So the ETH token contract would have to mint new tokens as they are burned or transferred from a Hive user account to the built in contract on chain.
After a burning transfer can be verified, the ETH contract should mint those same amount of wHIVE tokens and allow a user to claim them with the private key that relates to the one they specified in their original transfer.
@theycallmedan has said once the necessary infrastructure is in place he wouldn't mind providing liquidity in the form of ETH or HIVE to make everything work. There will need to be enough ETH available to process Hive transfers, and enough Hive available to process ETH transfers.
@lightproject might have more info on specifically what is required for Uniswap.
I would 1000% support something like this in a future HF. It was briefly discussed in a comment thread on @blocktrades post about second layer applications on Hive (https://peakd.com/hive/@blocktrades/hive-s-future-as-a-2nd-layer-blockchain-network#@blocktrades/qd642s) as being a "holy grail" for blockchains, which I agree with.
The key is how it can be implemented though. I'm not entirely sure how you see this working:
> they will also process the pending atomic token swaps by first verifying balances on the Ethereum based smart contract that holds the wrapped Hive tokens
I think it would have to be done by submitting a proof that the transaction took place on Ethereum which the Hive node can validate, or potentially having some time-lock mechanism like what is used for BTC atomic swaps. I don't know the details about how these work, but they have been done for other chains so hopefully we can borrow what they have done.
Either way I would definitely support putting funds towards researching and implementing a solution for this. I would think that if it's implemented for HIVE it should be able to be used for SMTs too which would be a big added benefit for projects to create their own tokens here one day.
I am leery of anything that creates any kind of dependence on centralized institutions, which I consider CEXes to be, and blockchains' dependence on them to be able to present their tokens as money unacceptable.
However, atomic swaps (as I understand them) make CEXes unnecessary. Blockchain tokens will be exchangable natively on blockchains, although not for FIAT currencies. Given that I now believe FIAT to be a trap creating dependence on oppressive institutions, I do not find that 'drawback' to be a negative at all.
The concern I have is that our access to communications with each other, the internet itself, and blockchains, remains dependent on centralized ISPs and the backbone that is owned by legacy institutions.
Absent some form of mesh network that enables individuals to bypass censorship, blockchains are potentially the same trap as FIAT, that create dependence on centralized institutions.
So, it's a great move, but presupposes free access to communications. I am unable to fully invest my productive work in anything which remains liable to the kind of fraud that enabled CITI to steal $100s of thousands of my wealth. I will not use banks today, and until we have a mechanism that enables wealth to be transferred outside the control of such institutions, I will not use tokens as money either.
I just gave my life's work to banksters because the corrupt legal system was designed to prevent me from holding them accountable and return my money to me. I will not be susceptible to such mechanisms going forward, and I hope devs consider this principle in time to prevent many more people who do consider tokens as money and depend on extant mechanisms to spend them being subjected to the kind of theft by fraud I have suffered.
> the added use of Oracles. The caveat with this implementation is that it adds a layer of trust that is necessary
Have you looked at Equilibria (XEQ)? Their project died when their core guy split, but from my understanding it was the first really trustless oracle. I could be wrong, but it might be worth a look anyway:
https://github.com/orgs/EquilibriaCC/repositories
For Bitshares, I remember we put quite a bit of time into ILP and HTLC ACCS..
https://www.jmjatlanta.com/index.php/2018/09/27/bitshares-and-hashed-time-lock-contracts-htlc/
https://whaleshares.io/@christopher/bitshares-and-interledger-ilp-summit-summary-for-the-bitshares-community
I realize Bitshares is not Hive, but Graphene is where all this spawned from iirc.
Anyhooz, I love seeing posts like this because it brings us one step closer to dumping all reliance on CEX's! :)