|
| 1 | +# Transceiver |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +The Transceiver is intended to offer a protocol-agnostic interface for sending and receiving cross-chain messages. For Native Token Transfers, this entails initiating attestation generation on the source chain, verifying the resulting attestation on the destination chain, and delivering the message to the associated `NttManager`. |
| 6 | + |
| 7 | +In the provided implementations ([EVM](/evm/src/Transceiver/Transceiver.sol)/[SVM](/solana/programs/example-native-token-transfers/src/transceivers/wormhole/)), Transceiver are intended to have a many-to-one or one-to-one relationship with Managers. |
| 8 | + |
| 9 | +## Message Specification |
| 10 | + |
| 11 | +### TransceiverMessage |
| 12 | + |
| 13 | +NttManager message emitted by a Transceiver implementation. Each message includes a Transceiver-specified 4-byte prefix. This should be a constant value, set by a protocol-specific Transceiver implementation, that identifies the payload as an NTT Transceiver emitted payload. |
| 14 | + |
| 15 | +```go |
| 16 | +[4]byte prefix |
| 17 | +[32]byte source_ntt_manager_address |
| 18 | +[32]byte recipient_ntt_manager_address |
| 19 | +uint16 ntt_manager_payload_length |
| 20 | +[]byte ntt_manager_payload |
| 21 | +uint16 transceiver_payload_length |
| 22 | +[]byte transceiver_payload |
| 23 | +``` |
| 24 | + |
| 25 | +### Wormhole Transceiver |
| 26 | + |
| 27 | +#### TransceiverMessage |
| 28 | + |
| 29 | +```go |
| 30 | +prefix = 0x9945FF10 // 0x99'E''W''H' |
| 31 | +``` |
| 32 | + |
| 33 | +#### Initialize Transceiver |
| 34 | + |
| 35 | +```go |
| 36 | +[4]byte prefix = 0x9c23bd3b // bytes4(keccak256("WormholeTransceiverInit")) |
| 37 | +[32]byte ntt_manager_address // address of the associated manager |
| 38 | +uint8 ntt_manager_mode // the locking/burning mode of the associated manager |
| 39 | +[32]byte token_address // address of the associated manager's token |
| 40 | +uint8 token_decimals // the number of decimals for that token |
| 41 | +``` |
| 42 | + |
| 43 | +Mode is an enum. |
| 44 | + |
| 45 | +``` |
| 46 | +Locking = 0 |
| 47 | +Burning = 1 |
| 48 | +``` |
| 49 | + |
| 50 | +#### Transceiver (Peer) Registration |
| 51 | + |
| 52 | +```go |
| 53 | +[4]byte prefix = 0x18fc67c2 // bytes4(keccak256("WormholePeerRegistration")) |
| 54 | +uint16 peer_chain_id // Wormhole Chain ID of the foreign peer transceiver |
| 55 | +[32]byte peer_address // the address of the foreign peer transceiver |
| 56 | +``` |
0 commit comments