Expand description
Typed byte newtypes for the Swarm protocol.
Mirrors bee-go’s pkg/swarm/typed_bytes.go (which itself mirrors
bee-js’s src/utils/typed-bytes.ts). Each type is a length-validated
wrapper over a fixed-size byte array; on the wire each is encoded as
lowercase hex without 0x prefix.
Structs§
- BatchId
- Postage batch identifier (32 bytes).
- EthAddress
- Ethereum address (20 bytes).
EthAddress::to_checksumreturns the EIP-55 mixed-case representation with0xprefix. - Feed
Index - Feed index: 8 bytes, big-endian
u64. The all-0xffvalue is a “before first” sentinel matching bee-jsFeedIndex.MINUS_ONE. - Identifier
- Arbitrary 32-byte identifier (SOC / GSOC). Use
Identifier::from_stringfor the keccak256-of-utf8 variant. - Peer
Address - Peer overlay address (32 bytes).
- Signature
- Ethereum signed-message signature:
R || S || Vwith V normalized to{27, 28}on the wire, matching bee-js. - Span
- Chunk span: 8 bytes, little-endian
u64. - Topic
- Feed / PSS topic (32 bytes). Use
Topic::from_stringfor the keccak256-of-utf8 variant. - Transaction
Id - Ethereum transaction hash (32 bytes).
Enums§
- Reference
- Swarm content reference. 32 bytes for a plain CAC reference, 64 bytes for an encrypted reference (CAC address || encryption key).
Constants§
- BATCH_
ID_ LENGTH - Length of a postage batch identifier.
- ENCRYPTED_
REFERENCE_ LENGTH - Length of an encrypted content reference (key suffix appended).
- ETH_
ADDRESS_ LENGTH - Length of an Ethereum address.
- FEED_
INDEX_ LENGTH - Length of a feed index (big-endian
u64). - IDENTIFIER_
LENGTH - Length of an arbitrary identifier (SOC / GSOC).
- PEER_
ADDRESS_ LENGTH - Length of a peer overlay address.
- PRIVATE_
KEY_ LENGTH - Length of a secp256k1 private key.
- PUBLIC_
KEY_ LENGTH - Length of a secp256k1 public key (uncompressed
X || Y). - REFERENCE_
LENGTH - Length of a plain content reference.
- SIGNATURE_
LENGTH - Length of an Ethereum signed-message signature (
R || S || V). - SPAN_
LENGTH - Length of a chunk span (little-endian
u64). - TOPIC_
LENGTH - Length of a feed / PSS topic.
- TRANSACTION_
ID_ LENGTH - Length of a transaction hash.