Content of an Icon Bridge Message #847
Replies: 4 comments 9 replies
-
@pedro-lino Receipts are block header item. BMC emits BTP Message as Events which are part of Receipts. Initially while developing decentralized version, it was required to maintain this structure, while migrating to centralized version we decided to maintain this structure. |
Beta Was this translation helpful? Give feedback.
-
Thank you very much @manishbista28 that was really insightful. |
Beta Was this translation helpful? Give feedback.
-
@manishbista28 got one follow up question here, that is currently blocking me. When receiving a new message from icon, we are going to get it here , in the format of a My question here is, how can I decode this I see that on the BSC's BMC , it gets decoded into this BMCMessage using this decoding function. For our case, we need to do the entire decoding inside the relayer and only pass the key elements to the smart contracts, as these are heavily restricted. So please help me understand how to properly decode the messages received from Icon. |
Beta Was this translation helpful? Give feedback.
-
This serializedMsg is saved as rlp encoded byte array by ICON To show that this rlp encoded value can be decoded, a simple way to check would be with this online decoder (Screenshot attached) This rlp decoding can also be done using go-ethereum library's rlp function. I had once needed to do something very similar while working on e2e tests. This is how I did it then if it can be helpful. |
Beta Was this translation helpful? Give feedback.
-
Hey guys, I'd like some help trying to better understand the structure of an Icon bridge Message.
According to the file types.go, the
Message
struct that the relayer sends to the BMC, contains an array ofReceipt
and in each one there is an array ofEvent
, being that each contains an individual byte array representing the Event's field namedMessage
.I would like to ask for clarification on what does represent a
Receipt
, anEvent
and what could be the content of the Event'sMessage
. It would be very helpful if you could provide a practical example as well.From my understanding, in each
Message
sent across the bridge, we would make a request for a particular service (like token transfer from chain A to B).So I don't understand why would a message need multiple receipts each containing multiple events. What's the need of having all these arrays?
Wouldn't it be enough to have the contents of a message being, a struct with the type of service to perform and the required parameters to perform it?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions