[NEW] Grin peg chain for Cosmos Hub need : [OLD] Can I do atomic swaps between Cosmos (ATOM) and Grin?

I saw the article on the ethereum / grin atomic swap. I think it should be easy to do an atomic on an interoperability oriented blockchain like Cosmos. How would I go about getting to this? Any direction/pointers? Is this kind of feasible? What is the status of atomic swaps with Grin?

As far as I know Cosmos hub right now has 2 out of 3 requirements to do an atomic swap with Grin. They have multisignature and use secp256k1, but don’t have timelocks (yet).

1 Like

You would actually want to do a peg Grin chain. An atomic swap doesn’t really ‘cross’ chains, Cosmos is meant to ‘cross’ chains. Sunny Aggarwal, Cosmos dev, discusses it all here in this podcast https://podcasts.apple.com/us/podcast/what-cosmos-launch-means-for-crypto-sunny-aggarwal/id1350649166?i=1000433518205&mt=2

At 18:36 he discuss how Cosmos is different than atomic swaps. The whole thing is good though. He is apparently quite a Grin fan, and goes on and on about Grin near the end.

This means that if there were a Grin peg chain, then Grin and Binance Chain could communicate through Cosmos Hub, since Binance chain is build on Cosmos Hub apparently. This means the barriers to Grin being on Binance should be small. Also, a Grin peg chain would mean Grin could interact with ethereum DEXs through the Cosmos hub too.

My question actually made no sense really. I will change it to how would I make a Grin peg chain?

2 Likes

Hey - I just noticed from my ‘Grin Digest’ email this morning that you, @jaspervdm, are a major grin dev. I really want to do the project I just said - I want to start a github on this. Is that ok? i.e. to be clear, I want to make Grinmint where Grin communicates state to tendermint, like ethermint for ether. I just feel like it. Should I put this where? And no one would have a problem with this, right?

See there is a rust implementation of the tendermint abci … promising start…

1 Like

what’s the difference between tendermint and cosmos?

From their description

COSMOS SDK is a framework for building blockchains. Modular, secure, and fully customizable.

TENDERMINT BFT is a state-of-the-art byzantine fault tolerant consensus engine. It powers most blockchains in the Cosmos ecosystem.

Ethermint: The Ethereum Virtual Machine implemented as a Cosmos-SDK module.

Lotion: A JavaScript SDK for Tendermint applications.

ABCI The Application BlockChain Interface lets you build Tendermint-based apps in any programming language.

Basically, I want to see if Grin can plug into other blockchains interoperatively through the Cosmos Network/Tendermint. I’m just curious how this would work.

From the forum @prawda:

"Cosmos or Tendermint introduces something like MongoDB, where different applications can talk to each other, even if they do not share the same data structures. All they need to do is having the same interface. For web development this is called REST API (among others), for Cosmos/Tendermint this is called ABCI.

Cosmos can host its own smart contracts independently, and it can also replicate the state of other blockchains, but it does not need to. This allows to have many blockchains connected and still do independent things. This also outlines how Cosmos is able to scale horizontally, because you can create subchains, like Lightning in the world of bitcoin, without any protocol changes or whatever. Spawning subchains is intrinsically built in."

You can (in theory) do atomic swaps between Grin and Cosmos, but to be truly interoperable with Cosmos, you’d want to be able to lock Grins on the Grin chain, for wrapped use on the Cosmos chain, which is an interesting challenge. You’d have to write a contract on Cosmos that can somehow act as a Grin wallet, so you could lock up your Grin in there by interacting with the contract. The wrapped Grin can then be used on the Cosmos chain. When eventually Cosmos is done with it and you want to redeem the wrapped Grin, the Cosmos contract would interact as a Grin wallet to transfer the Grin back. The tough part is that the Cosmos contract would have to validate the Grin chain, but validation of other chains is supposed to be Cosmos’ strength…

1 Like

There is no central authority in Grin that can tell you what you can and cannot do, so feel free :slight_smile: That said I wouldn’t recommend using the name Grinmint though, it is already in use by a different project

1 Like

You correctly stated everything as I see it - namely, a challenge, yes, and proof of concept.

I’m an old seventies’ era programmer. I program because all the computers before the vic20 had no apps, and you often had to program in assembly even if you wanted a basic calculator. I went through Fortran, pascal, lisp, C, C++, python, java, go, rust, node/js yada as they came out in time. I am a hobby programmer, and programming is not my job and I have no formal education. I know enough software engineers to know I am not one. I could never design a piece of code that could ever be used safely for any operational purpose. I’m just an enthusiast, and this project is just to see if it can be done, and it probably won’t leave my github page unviewed. I just wanted to make sure it was ok if I played a little, and was hopinig those with knowledge would give some tips/resources for my ‘fun’ project. Your comments already have been invaluable. Any direction/thoughts about how you might approach this if you were going to do it would be very helpful to me! I don’t think it matters what I call it, since it’s never really going to see the light of day. This has been very helpful so far - thanks.

Here are the specs on the peg zones needed

This is the full summary of how it works: https://cosmos.network/intro

Oh btw I’ll go with Tendergrin then :smile:

Did anyone finish the golang version of the grin node? I really need that. I would be done mostly if I had that. The project is abandoned - did this ever happen, did someone ever finish? If I had a golang Grin, I can import into the cosmos sdk and I’m gtg. Btw hope everyone bought in on cosmos before last night. There’s still time to get in before the big announcements on plasma. Grin needs to be part of this! If the Grin team misses the golden ring, it’ll be the sorriest tale of a missed opportunity in crypto.

Sorry for dumb question, I also research about Cosmos ATOM but can’t find it useful for which cases? It looks like a ‘bridge’ between multiple blockchains I don’t know what is it used for. Any simple explanation is appreciate.

Cosmos is like a wheel hub, an axel. You plug different coins into the hub, and they can all communicate with each other. But Grin requires a Peg - a piece so it can connect to the hub. Bitcoin and Ethereum need Pegs as well. I was/am slowly making a peg for grin. It would mean dapps and smart contracts with Grin.

There are other ways to solve this problem of smart contracts and dapps in Grin, but this is easy for me as I’m already familiar with the Cosmos SDK. Also, if one has a node running in Go, the problem’s already solved, and Blockcypher has a project that’s well on the way to this goal. Also, Microsoft just joined Hyperledger, a Cosmos project. The Cosmos ecosystem has a great deal of developer and industry support too in addition to this. Proof of the previous two statements: https://forum.cosmos.network/t/list-of-projects-in-cosmos-tendermint-ecosystem/243 These are the reasons I selected Cosmos for this solution. I’m looking forward to my first Grin blockchain game!

I happen to be obsessed with the mathematician John Nash and the game Hex, so my first app is where you can play other users at 11 x 11 Hex and bet Grin.

2 Likes