The
stream module ships in @peaqos/peaq-os-sdk and peaq-os-sdk 0.3.0+. Its exports are flagged @experimental and may change as the surface settles. This page covers the cryptographic core; selling and shipping the encrypted chunks — purchases, payment rails, and S3 / P2P delivery — is the 0.4.0+ distribution surface.stream module is the cryptographic core of Stream: it signs the data a machine produces, chunks and encrypts it, and re-wraps chunk keys so a buyer can decrypt only what they bought. You hand it a payload and it returns signed, verifiable, encrypted artifacts — topic subscription and transport are handled by the on-machine Edge Agent, which drives this same module from a Data Event Map.
Module location
Functions
Python exposes the same surface in snake_case (
build_signed_data_package, verify_data_package, build_chunk_chain, verify_chunk_chain, create_buyer_access_entry, build_buyer_access_files, decrypt_chunk, compute_chunk_id).
Types
SigningContext ({ privateKey, backend: "tee" | "software", did, keyId } — toJSON redacts the key so it never leaks through serialization) and field-level encryption in an EncryptionContext ({ encryptionKey, algorithm: "AES-256-GCM" }). The field layer uses AES-256-GCM; the per-chunk layer (inside buildChunkChain) uses XChaCha20-Poly1305.
Chunking defaults: chunkSize 262144 bytes (256 KiB), hashAlgorithm "sha-256", via ChunkingConfig. The full envelope shape is documented under Data streams → The chunk envelope.
Example
Sign a reading, verify it, chunk-and-encrypt, then grant a buyer access:buildChunkChain returns the chain plus encryptedData, a map of ciphertext bytes keyed by chunk index. The ciphertext is a pre-upload sidecar — callers store the bytes wherever they distribute from and set each chunk’s storageRef. The buyer decrypts with decryptChunk({ chunk, recipientPrivateKeyHex, recipientEntry, encryptedData }) — in Python, decrypt_chunk(chunk=…, recipient_private_key_hex=…, recipient_entry=…, encrypted_data=…) — passing the chunk’s stored ciphertext bytes plus a KeyRecipient from chunk.encryption.keyRecipients or from a buyer access entry. The data itself is never re-encrypted when access is granted.
From the terminal, the same publish and grant flows are peaqos stream publish and peaqos stream grant.
Errors
Solana signing
OWS mnemonic-derived wallets carry a account (ed25519, derivation pathm/44'/501'/0'/0') for cross-chain payments. This is wallet signing — separate from Stream data signing, which uses EIP-191.
Since SDK 0.4.0, the vault signs Solana transactions natively: PeaqosClient.solanaSignerFromWallet() returns a signer for the active OWS wallet’s Solana account, and transferToken uses it for SPL and native transfers when paying for stream data (peaqos stream pay --chain solana from the terminal). Solana-quoted Machine Market orders are still paid externally — complete the transfer with your Solana wallet and pass --payment-tx-hash to peaqos scale order; there is no peaqos solana command group.

