Cross Chain Messaging Protocol consists of 3 steps:
- Emit event on the SRC chain
- Verify the event and get proof from the Signer
- Receive the event on the DEST chain
Signer Service is responsible for producing proofs, whereas Signers Registry smart contract is responsible for validation if proof was made by the correct Signer.
Signer Service
Signer service is used to verify specific events. By request the service produces the proof for events. Proof of the event is a signature created by the signer's address.
Under the hood, Signer could implement any protocol to sign messages.
After the signature was generated, it could be used on your smart contract to verify the event. After successful verification, you could trust this event and do your dApp logic.
Event Hash
eventHash
is calculated from the eventId
and eventArgs
: eventId
is the event params combined together to create a unique id.where:
EventName
- the name of the event
EventChainId
- chainId of the transaction with invoked event
EventContract
- a contract that invoked the event
EventTransactionHash
- hash of the transaction with invoked event
EventArgs
is the event's arguments. All event arguments will be combined in the same order as they were in the event.Signer interface
Each Signer implements an interface.
Metadata
GET /metadata
the endpoint returns an object with the following type:Where:
-
name
is the human-recognizable name of the signer
-
availableChains
is the list of supported chains
-
signer
is the address which is used to sign messages
Sign event
POST /sign-event
the endpoint which is used to get proof of the event.This endpoint requires a request body with the following type:
Where:
-
chainId
andtxHash
are from the transaction that has theevent
-
eventLogIndex
(optional) - parameter that specifies the log index for the event. By default, the first event-matched ABI will be selected.
The response body will have the following type:
Where:
-
signature
- is signed eventHash by thesigner
-
params
- list of the params,eventId
andeventArgs
Signers Registry Contract
Signers Registry contract is used by other smart contracts to verify if the signature was created by the whitelisted signer. This smart contract has to be deployed on each supported chain.
Signers Registry implements this interface:
The signer could be
public
or private
. -
Anyone can use the
public
signer for supported chains.
-
The
Private
signer could be used for specific dApps, chains, etc. Such signers are restricted and closed for the community. Contact us if you want to implement a private signer.