rchain-community / rstake

toward community operated RChain staking pool
Apache License 2.0
6 stars 1 forks source link

HTLC based atomic swaps: "wrapped REV" ERC20 token? #13

Open dckc opened 3 years ago

dckc commented 3 years ago

connecting REV to Uniswap seems like a good way to get some things moving

while looking for code to do HTLC / atomic swaps, I ran into another blockchain project using scala: https://github.com/ACINQ/eclair bitcoin lightning thing "largest lightning node on mainnet" https://github.com/ACINQ/eclair/tree/master/eclair-core/src/main/scala/fr/acinq/eclair/channel seems to be the relevant code, though that looks like a lot compared to...

https://github.com/chatch/hashed-timelock-contract-ethereum/blob/master/contracts/HashedTimelockERC20.sol

also ran into something way too interesting: proceedings of formal methods on blockchains https://fmbc.gitlab.io/2020/files/FMBC2020.pdf

rust https://crates.io/crates/blockchain_contracts

https://github.com/comit-network/RFCs/blob/master/RFC-009-SWAP-Basic-ERC20.adoc

https://tlu.tarilabs.com/protocols/atomic-swaps/AtomicSwaps.html

https://en.bitcoin.it/wiki/Hash_Time_Locked_Contracts

dckc commented 3 years ago

ooh... https://github.com/Agoric/agoric-sdk/blob/master/packages/zoe/src/contracts/atomicSwap.js

dckc commented 3 years ago

oh. that Agoric atomicSwap isn't cross-chain. it's within Agoric's ocap world.

dimworm commented 3 years ago

How about this way? https://tbtc.network/developers/tbtc-security-model/

dckc commented 3 years ago

Yes, pegging is an alternative to HTLC and tBTC does look like an interesting point in the pegging design space.

Compared to HTLC, it still seems to require a fairly large number of parties to play the signer role:

Shortly after launch, there should be a group of roughly 80 private sale KEEP purchasers and a few other trusted parties signing for tBTC. Very soon an opportunity will be announced for more individuals to participate by staking ETH to become a signer. -- https://tbtc.network/faq

dimworm commented 3 years ago

I know how HTLC works for swap. Alice pay Bob 10 REV on RChain, exchanging Bob's 10 WREV on Ethereum. But how it works for Alice without Bob? if Alice wants to finish swap only with Rholang and Solidity smart contracts?

dckc commented 3 years ago

I am not aware of any technique for cross-chain swaps that doesn't involve parties on both sides that keep off-chain secrets.

dckc commented 3 years ago

https://gitcoin.co/grants/1454/wrapped-filecoin-wfil is an approach using a smart-contract on the ETH side and a DAO to approve the trusted parties on the filecoin side.

dckc commented 3 years ago

https://bridge.scrt.network/faq discusses an ETH<->SCRT bridge that's mostly a multi-sig contract on each side. "The bridge operators are very reputable staking operators: Figment, Staked, B-Harvest, Citadel.one and Enigma."

dckc commented 3 years ago

another bridge: https://forum.nkn.org/t/guide-nkn-s-official-mainnet-token-swap-tool/1727