Skip to content

docs: IBCv2 documentation #271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/pages/_meta.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export default {
core: "CosmWasm Core",
wasmd: "Wasmd",
ibc: "IBC",
ibc2: "IBCv2",
sylvia: "Sylvia",
storey: "Storey",
"cw-storage-plus": "StoragePlus",
Expand Down
6 changes: 6 additions & 0 deletions src/pages/ibc2/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
"getting-started": "Getting started",
"entrypoints": "Entry points",
"message-passing": "Message passing",
"example": "Example contract",
};
66 changes: 66 additions & 0 deletions src/pages/ibc2/entrypoints.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
tags: ["ibc"]
---

# Entry points in IBCv2

There are 4 entry points specified in the IBCv2 protocol.

## Receive entry point
```rust template="core"
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn ibc2_packet_receive(
deps: DepsMut,
env: Env,
msg: Ibc2PacketReceiveMsg,
) -> StdResult<IbcReceiveResponse> {
// [...]
}
```

* TODO tkulik: Describe `Ibc2PacketReceiveMsg`

## Time out entry point

```rust template="core"
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn ibc2_packet_timeout(
deps: DepsMut,
env: Env,
msg: Ibc2PacketTimeoutMsg,
) -> StdResult<IbcBasicResponse> {
// [...]
```

* TODO tkulik: Describe `Ibc2PacketTimeoutMsg`

## Acknowledgement receive entry point

```rust template="core"
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn ibc2_acknowledge_receive(
deps: DepsMut,
env: Env,
msg: Ibc2AcknowledgeMsg,
) -> StdResult<IbcBasicResponse> {
// [...]
}
```

* TODO tkulik: Describe `Ibc2AcknowledgeMsg`


## Sent entry point

```rust template="core"
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn ibc2_packet_sent(
deps: DepsMut,
env: Env,
msg: Ibc2PacketSentMsg,
) -> StdResult<IbcBasicResponse> {
// [...]
}
```

* TODO tkulik: Describe `Ibc2SentMsg`
7 changes: 7 additions & 0 deletions src/pages/ibc2/example.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
tags: ["ibc"]
---

# Example contract

* TODO tkulik: Example implementation of the ibc2 entry points
21 changes: 21 additions & 0 deletions src/pages/ibc2/getting-started.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
tags: ["ibc"]
---

import { Callout } from "nextra/components";

# Getting started

CosmWasm module uses [ibc-go](https://ibc.cosmos.network/main/) implementation to interact with other blockchains via IBC protocol.
Along with ibc-go version 10 a new protocol version was announced - [IBCv2](https://ibcprotocol.dev/blog/ibc-v2-announcement).
The new version allows interaction between Cosmos and non-Cosmos blockchains. To achieve this goal,
the protocol team decided to simplify the flow and reduce number of entry points.
Thanks to this update, now it's feasible to implement appropriate endpoints on chains like for e.g. Ethereum.
Side effect for the contract developers is the fact, that there are only few entry points to implement in smart contracts
in order to take full advantage of the blockchain interconnections.

<Callout>
This section of a documentation provides a basic information on how to set up contracts to use IBCv2 entry points and how
to communicate with services and contracts on different chains. To learn more about the IBC architecture we recommend
to visit the [official ibc-go documentation page](https://ibc.cosmos.network/main/).
</Callout>
18 changes: 18 additions & 0 deletions src/pages/ibc2/message-passing.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
tags: ["ibc"]
---

# Message passing

Smart contract can send IBCv2 messages from entry points we Message

## Send IBCv2 messages



## Entry point usage for sent messages

The special entry point `ibc2_packet_sent` is called

* TODO tkulik: How to send ibcv2 message
* TODO tkulik: How to send acknowledgement asynchronously
Loading