“Beam”, Grin’s good brother, has opened a DEX use case based on the MW protocol. Currently, the pledge on the chain has exceeded 3 million. Is it possible that Grin will also have practical functions in the future?
I was wondering if our community can contact the Beam official to build a GRIN/BEAM pool.
I am in active contact with the BEAM community, and I am discussing whether it is possible to create a BEAM/GRIN liquidity pool on DEX. If it can be realized, it will be great.
If there is important information, I will update it in real time. I hope that everyone will actively participate and realize this great wish together.
I don’t really understand what it’s about but thanks for your time and efforts.
In time it would be nice to have atomic swap between Grin BTC as wel as between Grin Beam and other Mimblewimble (light) implementations.
There was some work on atomic swap but its stale and requires more work:
Recently @theGrinReaper discussed taking it on. The OC created the bounty, I think they are the best people to discuss whether it should be V1 or V2, I think they specifically wanted V2.
I would donate to fund some atomic swap development
I am also willing to donate if needed.
I suggest changing the name of this thread to the above.
You can search this forum for “smart contracts” to see if others discussed if it’s possible with Grin or not.
Example: WIll grin allow scripting / smart contracts in the future? - #3 by Kurt
Yes still very interested in this, with Grin it is just a matter of studying the codebase to see where I can utilize functions for making the specific commitments needed and testing them out a bunch. Otherwise I have a good grasp of how it can be implemented from some other chains already.
In terms of a making an atomic cross chain DEX / LPs, this is something I have been thinking about myself since I heard about atomic swaps. There is a ton to consider but I will lay out some possibilities as well as some hurdles that need to be gotten over. I will also briefly touch on the basic vulnerabilities of modern versions of cross chain LPs.
Vulnerabilities of modern implementations:
Generally if we want a “cross chain” LP right now we are likely going to get one of the following:
- wrapped IOU of another chain coin token liquidity paired with native token on chain
- 100% IOU LP managed by CEX
- cross chain / offchain LP with native coins but funding and redeeming mechanics locked to federation or multi-sig
This leads to clear centralization vulnerabilities, all of these models can only work when people are being good actors for the sake of being good actors. We are always introducing trust based assumptions when using these implementations.
Atomic stuff is supposed to make trust obsolete in my opinion, so we want to be completely rid of any extra assumptions, only relying on assumptions already present in the transactions we really feel are secure such as discrete log.
A basic atomic swap does this but it is not actually enough to “wrap” a coin.
The reason is because our commitments are extremely specific to our outputs in an atomic swap. If I sell you a commitment to an output and it is not locked to your public key, how do you know I did not also sell this commitment to 5 other people? 6 people would be fighting to RBF a spend of that commitment and I would be able to spend all their commitments by scanning the mempool and submitting the transaction before the timelock runs out.
Anyways… this leads into the next chapter.
Hurdles:
As I specified above, a basic atomic swap does not introduce any extra unstudied cryptographic or trust based assumptions but it also does not provide a complete format for “wrapping” coins.
I will define an atomically wrapped coin as:
- Represents native coin of another chain
- Has a provable spending path on its native chain
- Can be represented normally (like a token) on the cross chain
One of the hurdles is if someone wants to use a cross-chain atomic LP they NEED to either run or trust full nodes on both chains.
Another hurdle is that for Grin specifically there is not really a concept of a token as far as I can tell. It could just be a wrapped commitment (a script-less script) and the wallet software can make sense of it I suppose.
Another hurdle is what an LP is, an LP tends to balance itself based on price oracles.
Thus I do not think a cross chain LP should be built to do that automatically, should be up to the implementation to do such things. They should just hold two different coins regardless of how much on either side.
Possibilities:
I think the basic problem of having the coins actually wrapped instead of blindly committed to involves extendable time-locks, replaceable public key commitment locks, and a way for the commitment itself to specify the metadata for the intended transaction.
Atomic Wrapping Idea:
So the idea would be I want to wrap some coins so that I could sell it on other chains.
First I submit a tx locking coins to a large scalar commitment with a huge (modifiable) time-lock. I can then put this scalars public values into a contract on the cross chain I want to put my tokens on.
If someone wants to transact, they can check the commitment on the native chain and see how much is locked to it. Then they can submit an offer in response.
The offer will commit to a tweaked version of the original public commitment that introduces metadata specifying exactly how many coins they want from the swap. If you take their offer, you compute the secret to the commitment that they specified and give it to them. When they submit that to the native contract they claim the coins and reveal their commitment to locked coins on the cross chain.
If NO ONE wants to transact and I have an output on chain locked for a long time I should be able to submit a transaction that registers in the contract “I am shortening the time-lock and cannot be used for swaps anymore”. That way you could unstuck yourself from this situation without being able to hide the fact you are doing so from a counter party to cheat them.
Also this paragraph above is just a hypothetical for atomic wrapping, the LP part of it will require even more research and work.
I hope that makes some sort of sense, I think that most of this is impossible at the moment but maybe with a lot of research it could be done. Sorry for the wall of text, I swear it’s just because I care about this a lot.