Bridge and messaging decoders
Decode 2 Solana bridge and messaging programs in Rust, including Circle CCTP Token Messenger v2, with Carbon decoder crates.
Carbon 2.0.0 has decoder crates for 2 bridge and messaging programs on Solana: 40 instructions, 10 account types and 33 events in all. Use them to index cross-chain burns, mints and messages, including Circle CCTP USDC transfers as typed Rust values instead of parsing raw bytes. Each program's page lists every instruction with its discriminator, data fields and accounts, every account and event, and a complete program that runs against the public RPC.
Programs#
Program IDs are the mainnet addresses compiled into each crate as PROGRAM_ID. Instruction counts exclude the CpiEvent wrapper.
| Program | Crate | Program ID | Instructions | Accounts | Events |
|---|---|---|---|---|---|
| Circle CCTP Message Transmitter v2 | carbon-circle-message-transmitter-v2-decoder | CCTPV2Sm4AdWt5296sk4P66VBZ7bEhcARwFaaS9YPbeC | 15 | 3 | 11 |
| Circle CCTP Token Messenger v2 | carbon-circle-token-messenger-v2-decoder | CCTPV2vPZJS2u2BBsUoscuikbYjnpFmbFsvVuJdgUMQe | 25 | 7 | 22 |
Decode several in one pipeline#
Add carbon-core and the decoder crates you need, all at the same version. For every program in this category:
cargo add carbon-core@2.0.0 carbon-circle-message-transmitter-v2-decoder@2.0.0 carbon-circle-token-messenger-v2-decoder@2.0.0Register each decoder with a processor for its instruction enum. This fragment goes in your pipeline setup; the processors are yours, one per program, each implementing Processor for that program's instruction input (see processors):
use carbon_circle_token_messenger_v2_decoder::CircleTokenMessengerV2Decoder;
use carbon_circle_message_transmitter_v2_decoder::CircleMessageTransmitterV2Decoder;
Pipeline::builder()
.datasource(datasource) // a datasource that emits these programs' transactions
.instruction(CircleTokenMessengerV2Decoder, CircleTokenMessengerV2Processor)
.instruction(CircleMessageTransmitterV2Decoder, CircleMessageTransmitterV2Processor)
.build()?
.run()
.awaitEach decoder only returns instructions whose program ID matches its own PROGRAM_ID, so one pipeline can hold all of them. For datasource filters that follow several programs, and one processor that sees every program's instructions in a transaction, see index multiple programs.
A program that is not listed#
Generate a decoder from the program's Anchor or Codama IDL with the Carbon CLI: see generate a decoder. Every crate above was generated the same way. The full catalog lists decoders in every category.