CosmWasm / CosmWasm/wasmd

Better Native ICA support

Open
#947 11 comments 2 reactions 0 assignees View on GitHub
blocked discussion epic
Dominant language
Go
Stars
416
Forks
538
PR merge metrics
No merged PRs in 30d

Description

Use case: _I want to write a contract that stakes an asset on a non-CosmWasm chain._

Really love implementing ICA in pure CosmWasm as with Confio's [cw-ibc-demo](https://github.com/confio/cw-ibc-demo). Unfortunately this will not work with non-CosmWasm chains like the Cosmos Hub.

Reading through the latest [ICA documentation](http://tutorials.cosmos.network/academy/4-ibc/ica.html), it seems we may need to call [RegisterInterchainAccount](https://github.com/cosmos/ibc-go/blob/main/modules/apps/27-interchain-accounts/host/keeper/account.go) and then can call `SendTx`? Or perhaps just `SendTx` is enough and it's smart enough to register the account?

Would be nice if we could extend `cosmwasm_std` [IbcMsg](https://docs.rs/cosmwasm-std/1.0.0/cosmwasm_std/enum.IbcMsg.html) to support native ICA messages. I'm hacking a bit today on getting them working using `CosmosMsg::Stargate`, but not sure how successful that will be and that it could be a much better dev experience to just support it outright.

In `cosmwasm_std` it would be ultimately nice to have something like:
```rust
#[non_exhaustive]
pub enum IbcMsg {
// ...
IcaTx {
channel_id: String,
msgs: Vec>,
timeout: IbcTimeout,
},
// Guess we need this to get the channel ID?
RegisterIca {
connnection_id: String,
port_id: String,
address: String,
}
}
```

Realize this issue also touches the `cosmwasm` repo, but figured it would be best to start the conversation here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.