Skip to main content
For every route below, two equivalent descriptions are given:
  • Rust client: code snippet assuming you depend on sui-types (and consensus-core for /v1/accepted).
  • Raw BCS schema: structural description for clients that cannot import Sui crates.
The raw schemas reference sui-types primitives (SenderSignedData, TransactionEffects, TransactionEvents, etc.) which are themselves complex nested BCS types. The canonical authoritative definitions live in the Sui source tree under crates/sui-types/src/; many language ecosystems also ship Sui-SDK packages with type-equivalent decoders.

BCS encoding conventions

  • Fields are emitted in struct-declaration order with no field names.
  • Fixed-size [u8; N] arrays serialize as N length-prefixed bytes β€” the length prefix is a ULEB128 byte (0x20 for 32-byte digests).
  • u8/u16/u32/u64 are little-endian.
  • Vec<T> = ULEB128 length, then length consecutive T values.
  • Option<T> = 0x00 (None) or 0x01 <T> (Some).
  • Enums = ULEB128 variant index, then variant payload.
  • String = Vec<u8> (UTF-8 bytes with a length prefix).

/v1/incoming β€” BCS Transaction

Each WS frame is one BCS-encoded sui_types::transaction::Transaction, byte-identical to the bytes the submitting client sent to the validator’s gRPC endpoint. Transaction is Envelope<SenderSignedData, EmptySignInfo>. EmptySignInfo is a zero-sized unit struct, so the on-wire bytes equal a bare SenderSignedData. Rust client:
Raw BCS schema:
TransactionData, GenericSignature, etc. are defined in sui-types/src/transaction.rs and sui-types/src/crypto.rs. Most Sui SDKs already include decoders.

/v1/accepted β€” BCS SignedBlock

Each WS frame is one BCS-encoded consensus_core::block::SignedBlock β€” exactly the bytes the validator received on the wire from a peer. One block contains many transactions; each transaction inside is itself a BCS-encoded ConsensusTransaction. Rust client (using consensus-core’s helper):
Raw BCS schema:
The variant indices for ConsensusTransactionKind are stable; the exact index of UserTransaction and UserTransactionV2 is defined in sui-types/src/messages_consensus.rs. Non-user variants can be skipped. For each UserTransaction* you encounter, the inner SenderSignedData is identical in shape to the /v1/incoming payload. CommitVote, BlockTransactionVotes, MisbehaviorReport, TransactionClaim are defined in consensus-core/src/{block,commit}.rs and sui-types/src/messages_consensus.rs.

/v1/pending β€” BCS PendingTxStreamMessage

Rust client:
Raw BCS schema:
System transactions are filtered server-side and never appear on this stream.

/v1/executed β€” BCS TxStreamMessage

Rust client:
Raw BCS schema:
TransactionEffects is a versioned enum (V1 / V2); BCS encodes the variant index as a ULEB128 byte followed by the variant payload. TransactionEvents is Vec<Event>. Both are defined in sui-types/src/effects.rs. System transactions are filtered server-side and never appear on this stream.