2025-06-17 19:47:29 +10:00
---
2026-03-18 22:31:13 +01:00
title: MESSAGING-API
name: Messaging API definition
2025-06-17 19:47:29 +10:00
category: Standards Track
2025-09-26 15:56:10 +10:00
status: raw
2025-06-17 19:47:29 +10:00
tags: [reliability, application, api, protocol composition]
editor: Oleksandr Kozlov < oleksandr @status .im >
contributors:
- Oleksandr Kozlov < oleksandr @status .im >
- Prem Chaitanya Prathi < prem @status .im >
- Franck Royer < franck @status .im >
---
## Table of contents
2025-09-25 14:03:10 +10:00
<!-- TOC -->
* [Table of contents ](#table-of-contents )
* [Abstract ](#abstract )
* [Motivation ](#motivation )
* [Syntax ](#syntax )
* [API design ](#api-design )
* [IDL ](#idl )
* [Primitive types and general guidelines ](#primitive-types-and-general-guidelines )
* [Language mappings ](#language-mappings )
* [Application ](#application )
2026-03-18 22:31:13 +01:00
* [The Messaging API ](#the-messaging-api )
2026-02-03 12:20:37 -03:00
* [Common ](#common )
* [Common type definitions ](#common-type-definitions )
* [Init node ](#init-node )
* [Init node type definitions ](#init-node-type-definitions )
* [Init node function definitions ](#init-node-function-definitions )
* [Init node predefined values ](#init-node-predefined-values )
* [Init node extended definitions ](#init-node-extended-definitions )
* [Messaging ](#messaging )
* [Messaging type definitions ](#messaging-type-definitions )
* [Messaging function definitions ](#messaging-function-definitions )
* [Messaging extended definitions ](#messaging-extended-definitions )
* [Subscriptions ](#subscriptions )
* [Subscriptions type definitions ](#subscriptions-type-definitions )
* [Subscriptions function definitions ](#subscriptions-function-definitions )
* [Subscriptions extended definitions ](#subscriptions-extended-definitions )
* [Health ](#health )
* [Health type definitions ](#health-type-definitions )
* [Health function definitions ](#health-function-definitions )
* [Health extended definitions ](#health-extended-definitions )
2025-09-25 14:03:10 +10:00
* [The Validation API ](#the-validation-api )
* [Security/Privacy Considerations ](#securityprivacy-considerations )
* [Copyright ](#copyright )
<!-- TOC -->
2025-06-17 19:47:29 +10:00
## Abstract
This document specifies an Application Programming Interface (API) that is RECOMMENDED for developers of the [WAKU2 ](https://github.com/vacp2p/rfc-index/blob/7b443c1aab627894e3f22f5adfbb93f4c4eac4f6/waku/standards/core/10/waku2.md ) clients to implement,
and for consumers to use as a single entry point to its functionalities.
2026-03-18 22:31:13 +01:00
This API defines the RECOMMENDED interface for leveraging Logos Messaging protocols to send and receive messages.
2025-06-17 19:47:29 +10:00
Application developers SHOULD use it to access capabilities for peer discovery, message routing, and peer-to-peer reliability.
## Motivation
2026-03-18 22:31:13 +01:00
The accessibility of Logos Messaging protocols is capped by the accessibility of their implementations, and hence API.
2025-06-24 12:23:12 +10:00
This RFC enables a concerted effort to draft an API that is simple and accessible, and provides an opinion on sane defaults.
2025-06-17 19:47:29 +10:00
2026-03-18 22:31:13 +01:00
The API defined in this document is an opinionated-by-purpose method to use the more agnostic [WAKU2 ](https://lip.logos.co/messaging/standards/core/10/waku2.html ) protocols.
2025-06-17 19:47:29 +10:00
## Syntax
The keywords “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
“RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in [RFC2119 ](https://www.ietf.org/rfc/rfc2119.txt ).
## API design
### IDL
2026-03-18 22:31:13 +01:00
A custom Interface Definition Language (IDL) in YAML is used to define the Messaging API.
2025-06-17 19:47:29 +10:00
Existing IDL Such as OpenAPI, AsyncAPI or WIT do not exactly fit the requirements for this API.
Hence, instead of having the reader learn a new IDL, we propose to use a simple IDL with self-describing syntax.
An alternative would be to choose a programming language. However, such choice may express unintended opinions on the API.
2025-06-30 15:25:12 +10:00
### Primitive types and general guidelines
2025-06-17 19:47:29 +10:00
2025-09-11 15:51:13 +10:00
- No `default` means that the value is mandatory, meaning a `default` value implies an optional parameter.
2025-10-08 23:49:54 +02:00
- Primitive types are `string` , `int` , `bool` , `byte` , `enum` and `uint`
2025-06-24 12:23:12 +10:00
- Complex pre-defined types are:
2025-09-26 11:39:49 +10:00
- `object` : object and other nested types.
2025-11-13 16:20:02 +11:00
- `array` : iterable object containing values of all the same type. Syntax: `array<T>` where `T` is the element type (e.g., `array<string>` , `array<byte>` ).
2025-09-25 13:35:05 +10:00
- `result` : an enum type that either contains a value or void (success), or an error (failure); The error is left to the implementor.
2025-06-24 13:03:22 +10:00
- `error` : Left to the implementor on whether `error` types are `string` or `object` in the given language.
2025-11-13 16:20:02 +11:00
- `event_emitter` : an object that emits events with specific event names and associated event data types.
2025-06-30 15:25:12 +10:00
- Usage of `result` is RECOMMENDED, usage of exceptions is NOT RECOMMENDED, no matter the language.
2025-06-17 19:47:29 +10:00
2025-09-26 16:00:59 +10:00
TODO: Review whether to specify categories of errors.
2025-06-30 15:25:12 +10:00
### Language mappings
2025-06-18 16:34:21 +10:00
How the API definition should be translated to specific languages.
```yaml
language_mappings:
2025-06-30 14:26:25 +10:00
typescript:
2025-06-18 16:34:21 +10:00
naming_convention:
2025-06-30 14:26:25 +10:00
- functions: "camelCase"
- variables: "camelCase"
2025-06-18 16:34:21 +10:00
- types: "PascalCase"
2025-11-13 16:20:02 +11:00
event_emitter: "Use EventEmitter object with `emit` , `addListener` , etc; with event name the string specified in IDL. For example. eventEmitter.emit('message:sent',...)"
2025-06-30 14:26:25 +10:00
nim:
2025-06-18 16:34:21 +10:00
naming_convention:
- functions: "camelCase"
- variables: "camelCase"
- types: "PascalCase"
2025-11-13 16:20:02 +11:00
event_emitter: TBD
2025-06-18 16:34:21 +10:00
```
2025-06-30 15:25:12 +10:00
### Application
2025-09-26 23:05:58 +10:00
This API is designed for generic use and ease across all programming languages, for `edge` and `core` type nodes.
2025-06-30 15:25:12 +10:00
2026-03-18 22:31:13 +01:00
## The Messaging API
2025-06-30 15:25:12 +10:00
```yaml
api_version: "0.0.1"
2026-03-18 22:31:13 +01:00
library_name: "liblogosdelivery"
description: "Logos Messaging: a private and censorship-resistant message routing library."
2025-06-30 15:25:12 +10:00
```
2026-02-03 12:20:37 -03:00
### Common
2025-06-17 19:47:29 +10:00
2026-02-03 12:20:37 -03:00
This section describes common types used throughout the API.
Note that all types in the API are described once in this document, in a single section. Types should just forward-reference other types when needed.
#### Common type definitions
2025-06-17 19:47:29 +10:00
```yaml
types:
2026-02-03 12:20:37 -03:00
2025-06-24 13:03:22 +10:00
WakuNode:
2025-09-26 11:39:49 +10:00
type: object
2026-03-18 22:31:13 +01:00
description: "A node instance."
2025-11-13 16:20:02 +11:00
fields:
2026-02-03 12:20:37 -03:00
messageEvents:
2025-11-13 16:20:02 +11:00
type: MessageEvents
2026-02-03 12:20:37 -03:00
description: "The node's messaging event emitter"
healthEvents:
type: HealthEvents
description: "The node's health monitoring event emitter"
RequestId:
type: string
description: "A unique identifier for a request"
```
### Init node
#### Init node type definitions
```yaml
types:
2025-08-05 15:28:46 +10:00
2025-09-12 13:40:54 +10:00
NodeConfig:
2025-09-26 11:39:49 +10:00
type: object
2025-06-17 19:47:29 +10:00
fields:
2025-08-05 15:28:46 +10:00
mode:
2025-06-17 19:47:29 +10:00
type: string
2025-09-26 23:05:58 +10:00
constraints: [ "edge", "core" ]
default: "core" # "edge" for mobile and browser devices.
2026-03-18 22:31:13 +01:00
description: "The mode of operation of the node; 'edge' of the network: relies on other nodes for message routing; 'core' of the network: fully participate to message routing."
2025-10-01 22:20:24 +10:00
protocols_config:
type: ProtocolsConfig
2025-06-17 19:47:29 +10:00
default: TheWakuNetworkPreset
2025-09-15 15:31:50 +10:00
networking_config:
type: NetworkConfig
2025-09-26 15:47:47 +10:00
default: DefaultNetworkingConfig
2025-09-10 14:19:52 +10:00
eth_rpc_endpoints:
type: array< string >
2025-09-26 16:00:59 +10:00
description: "Eth/Web3 RPC endpoint URLs, only required when RLN is used for message validation; fail-over available by passing multiple URLs. Accepting an object for ETH RPC will be added at a later stage."
2025-06-24 12:43:11 +10:00
2025-10-01 22:20:24 +10:00
ProtocolsConfig:
2025-09-26 11:39:49 +10:00
type: object
2025-06-24 12:43:11 +10:00
fields:
2025-09-26 11:32:23 +10:00
entry_nodes:
2025-06-24 12:43:11 +10:00
type: array< string >
2025-09-15 15:31:50 +10:00
default: []
2025-09-26 15:47:47 +10:00
description: "Nodes to connect to; used for discovery bootstrapping and quick connectivity. enrtree and multiaddr formats are accepted. If not provided, node does not bootstrap to the network (local dev)."
2025-06-24 12:43:11 +10:00
static_store_nodes:
type: array< string >
2025-09-12 17:40:23 +10:00
default: []
2025-09-26 11:39:49 +10:00
# TODO: confirm behaviour at implementation time.
description: "The passed nodes are prioritised for store queries."
2025-06-24 12:43:11 +10:00
cluster_id:
type: uint
2026-03-18 22:31:13 +01:00
description: "The cluster ID for the network. Cluster IDs are defined in [RELAY-SHARDING ](https://github.com/logos-messaging/specs/blob/master/standards/core/relay-sharding.md ) and allocated in [RELAY-STATIC-SHARD-ALLOC ](https://github.com/waku-org/specs/blob/master/informational/relay-static-shard-alloc.md )."
2025-06-24 12:43:11 +10:00
auto_sharding_config:
2025-09-11 15:51:13 +10:00
type: AutoShardingConfig
2025-08-05 15:27:48 +10:00
default: DefaultAutoShardingConfig
2025-08-05 15:28:46 +10:00
description: "The auto-sharding config, if sharding mode is `auto` "
2025-08-06 16:15:40 +10:00
message_validation:
type: MessageValidation
2025-09-26 11:39:49 +10:00
description: "If the default config for TWN is not used, then we still provide default configuration for message validation."
2025-08-06 16:15:40 +10:00
default: DefaultMessageValidation
2025-06-24 12:43:11 +10:00
2025-09-15 15:31:50 +10:00
NetworkingConfig:
2025-09-26 15:47:47 +10:00
type: object
2025-09-15 15:31:50 +10:00
fields:
2025-09-25 13:46:35 +10:00
listen_ipv4:
2025-09-15 15:31:50 +10:00
type: string
default: "0.0.0.0"
2025-09-26 11:39:49 +10:00
description: "The network IP address on which libp2p and discv5 listen for inbound connections. Not applicable for some environments such as the browser."
2025-09-15 15:31:50 +10:00
p2p_tcp_port:
type: uint
default: 60000
2025-09-26 16:08:15 +10:00
description: "The TCP port used for libp2p, relay, etc aka, general p2p message routing. Not applicable for some environments such as the browser."
2025-09-15 15:31:50 +10:00
discv5_udp_port:
type: uint
default: 9000
2025-09-26 11:39:49 +10:00
description: "The UDP port used for discv5. Not applicable for some environments such as the browser."
2025-09-15 15:31:50 +10:00
2025-06-17 19:47:29 +10:00
AutoShardingConfig:
2025-09-26 11:39:49 +10:00
type: object
2025-06-17 19:47:29 +10:00
fields:
2025-08-05 15:28:46 +10:00
num_shards_in_cluster:
2025-06-17 19:47:29 +10:00
type: uint
description: "The number of shards in the configured cluster; this is a globally agreed value for each cluster."
2025-08-06 16:15:40 +10:00
MessageValidation:
2025-09-26 11:39:49 +10:00
type: object
2025-08-06 16:15:40 +10:00
fields:
2025-09-25 13:48:40 +10:00
max_message_size:
type: string
default: "150 KiB"
description: "Maximum message size. Accepted units: KiB, KB, and B. e.g. 1024KiB; 1500 B; etc."
2025-08-06 16:15:40 +10:00
# For now, RLN is the only message validation available
rln_config:
2025-09-11 15:51:13 +10:00
type: RlnConfig
2025-08-06 16:15:40 +10:00
# If the default config for TWN is not used, then we do not apply RLN
default: none
RlnConfig:
2025-09-26 11:39:49 +10:00
type: object
2025-08-06 16:15:40 +10:00
fields:
contract_address:
type: string
2025-11-13 16:20:02 +11:00
description: "The address of the RLN contract that exposes `root` and `getMerkleRoot` ABIs"
2025-08-06 16:15:40 +10:00
chain_id:
type: uint
2025-11-13 16:20:02 +11:00
description: "The chain ID on which the RLN contract is deployed"
2025-08-06 16:15:40 +10:00
epoch_size_sec:
type: uint
description: "The epoch size to use for RLN, in seconds"
2025-06-17 19:47:29 +10:00
```
2026-02-03 12:20:37 -03:00
#### Init node function definitions
2025-06-17 19:47:29 +10:00
```yaml
functions:
2026-02-03 12:20:37 -03:00
2025-09-09 14:49:12 +10:00
createNode:
2026-03-18 22:31:13 +01:00
description: "Initialises a node instance"
2025-06-17 19:47:29 +10:00
parameters:
2025-09-26 15:47:47 +10:00
- name: nodeConfig
type: NodeConfig
2026-03-18 22:31:13 +01:00
description: "The node configuration."
2025-06-17 19:47:29 +10:00
returns:
2025-06-24 13:03:22 +10:00
type: result< WakuNode , error >
2025-06-17 19:47:29 +10:00
```
2026-02-03 12:20:37 -03:00
#### Init node predefined values
2025-06-24 12:43:11 +10:00
```yaml
values:
2025-06-30 15:25:12 +10:00
2025-09-15 15:31:50 +10:00
DefaultNetworkingConfig:
type: NetworkConfig
fields:
2025-09-26 15:47:47 +10:00
listen_ipv4: "0.0.0.0"
2025-09-15 15:31:50 +10:00
p2p_tcp_port: 60000
discv5_udp_port: 9000
2025-06-24 12:43:11 +10:00
TheWakuNetworkPreset:
2025-10-01 22:20:24 +10:00
type: ProtocolsConfig
2025-06-24 12:43:11 +10:00
fields:
2025-09-26 11:32:23 +10:00
entry_nodes: [ "enrtree://AIRVQ5DDA4FFWLRBCHJWUWOO6X6S4ZTZ5B667LQ6AJU6PEYDLRD5O@sandbox .waku.nodes.status.im" ]
2025-09-25 13:50:15 +10:00
# On TWN, we encourage the usage of discovered store nodes
static_store_nodes: []
2025-06-24 12:43:11 +10:00
cluster_id: 1
2025-08-06 16:15:40 +10:00
auto_sharding_config:
2025-11-13 16:20:02 +11:00
type: AutoShardingConfig
2025-08-06 16:15:40 +10:00
fields:
2025-09-26 15:47:47 +10:00
num_shards_in_cluster: 8
2025-09-10 14:15:23 +10:00
message_validation: TheWakuNetworkMessageValidation
2025-06-30 15:25:12 +10:00
2025-08-06 16:15:40 +10:00
TheWakuNetworkMessageValidation:
type: MessageValidation
2025-06-24 12:43:11 +10:00
fields:
2025-09-26 15:47:47 +10:00
max_message_size: "150 KiB"
2025-08-06 16:15:40 +10:00
rln_config:
2025-11-13 16:20:02 +11:00
type: RlnConfig
2025-08-06 16:15:40 +10:00
fields:
contract_address: "0xB9cd878C90E49F797B4431fBF4fb333108CB90e6"
chain_id: 59141
epoch_size_sec: 600 # 10 minutes
# If not preset is used, autosharding on one cluster is applied by default
# This is a safe default that abstract shards (content topic shard derivation), and it enables scaling at a later stage
2025-08-05 15:27:48 +10:00
DefaultAutoShardingConfig:
type: AutoShardingConfig
fields:
2025-08-05 15:28:46 +10:00
num_shards_in_cluster: 1
2025-08-06 16:15:40 +10:00
# If no preset is used, we only apply a max size limit to messages
DefaultMessageValidation:
type: MessageValidation
fields:
2025-09-26 15:47:47 +10:00
max_message_size: "150 KiB"
2025-08-06 16:15:40 +10:00
rln_config: none
2025-06-24 12:43:11 +10:00
```
2026-02-03 12:20:37 -03:00
#### Init node extended definitions
2025-06-30 15:25:12 +10:00
2025-09-26 15:47:47 +10:00
**`mode` **:
2025-09-29 21:15:32 +10:00
If the `mode` set is `edge` , the initialised `WakuNode` SHOULD use:
2025-06-30 15:25:12 +10:00
2026-03-18 22:31:13 +01:00
- [LIGHTPUSH ](https://lip.logos.co/messaging/standards/core/19/lightpush.html ) as client
- [FILTER ](https://lip.logos.co/messaging/standards/core/12/filter.html ) as client
- [STORE ](https://lip.logos.co/messaging/standards/core/13/store.html ) as client
- [METADATA ](https://lip.logos.co/messaging/standards/core/66/metadata.html ) as client
- [PEER-EXCHANGE ](https://lip.logos.co/messaging/standards/core/34/peer-exchange.html ) as client
2025-09-29 21:15:32 +10:00
- [P2P-RELIABILITY ](/standards/application/p2p-reliability.md )
2025-06-30 15:25:12 +10:00
2025-09-29 21:15:32 +10:00
If the `mode` set is `core` , the initialised `WakuNode` SHOULD use:
2025-06-30 15:25:12 +10:00
2026-03-18 22:31:13 +01:00
- [RELAY ](https://lip.logos.co/messaging/standards/core/11/relay.html )
- [LIGHTPUSH ](https://lip.logos.co/messaging/standards/core/19/lightpush.html ) as service node
- [FILTER ](https://lip.logos.co/messaging/standards/core/12/filter.html ) as service node
- [STORE ](https://lip.logos.co/messaging/standards/core/13/store.html ) as client
- [METADATA ](https://lip.logos.co/messaging/standards/core/66/metadata.html ) as client and service node
2025-09-29 21:15:32 +10:00
- [P2P-RELIABILITY ](/standards/application/p2p-reliability.md )
2026-03-18 22:31:13 +01:00
- [DISCV5 ](https://lip.logos.co/messaging/standards/core/33/discv5.html )
- [PEER-EXCHANGE ](https://lip.logos.co/messaging/standards/core/34/peer-exchange.html ) as client and service node
2025-09-29 21:15:32 +10:00
- [RENDEZVOUS ](https://github.com/waku-org/specs/blob/master/standards/core/rendezvous.md ) as client and service node
2025-06-30 15:25:12 +10:00
`edge` mode SHOULD be used if node functions in resource restricted environment,
2025-09-26 23:05:58 +10:00
whereas `core` SHOULD be used if node has no strong hardware or bandwidth restrictions.
2025-06-30 15:25:12 +10:00
2026-02-03 12:20:37 -03:00
### Messaging
2025-10-13 16:33:08 +11:00
2026-02-03 12:20:37 -03:00
#### Messaging type definitions
2025-10-13 16:33:08 +11:00
```yaml
types:
2026-02-03 12:20:37 -03:00
2025-10-28 01:27:38 +01:00
MessageEnvelope:
2025-10-07 00:42:32 +02:00
type: object
fields:
2025-10-29 22:22:45 +01:00
content_topic:
2025-10-13 16:33:08 +11:00
type: string
2026-03-18 22:31:13 +01:00
description: "Content-based filtering field as defined in [TOPICS ](https://lip.logos.co/messaging/informational/23/topics.html#content-topics )"
2025-10-07 00:42:32 +02:00
payload:
2025-10-08 23:49:54 +02:00
type: array< byte >
2026-02-03 12:20:37 -03:00
description: "The message data."
2025-10-07 00:42:32 +02:00
ephemeral:
type: bool
default: false
2026-03-18 22:31:13 +01:00
description: "Whether the message is ephemeral. Read at [ATTRIBUTES ](https://lip.logos.co/messaging/standards/core/14/message.html#message-attributes )"
2025-10-07 00:42:32 +02:00
2026-02-03 12:20:37 -03:00
MessageReceivedEvent:
type: object
description: "Event emitted when a message is received from the network"
fields:
message:
2025-10-28 01:27:38 +01:00
type: MessageEnvelope
2026-02-03 12:20:37 -03:00
description: "The received message's payload and metadata"
2025-10-07 00:42:32 +02:00
2025-10-21 01:19:16 +02:00
MessageSentEvent:
type: object
2025-11-13 00:43:11 +01:00
description: "Event emitted when a message is sent to the network"
2025-10-21 01:19:16 +02:00
fields:
2025-10-29 22:22:45 +01:00
request_id:
2025-10-21 01:19:16 +02:00
type: RequestId
description: "The request ID associated with the sent message"
2025-10-29 22:22:45 +01:00
message_hash:
2026-02-03 09:14:29 -03:00
type: string
2025-10-28 01:27:38 +01:00
description: "Hash of the message that got sent to the network"
2025-10-21 01:19:16 +02:00
2026-02-03 12:20:37 -03:00
MessageSendErrorEvent:
2025-10-21 01:19:16 +02:00
type: object
2025-11-13 00:43:11 +01:00
description: "Event emitted when a message send operation fails"
2025-10-21 01:19:16 +02:00
fields:
2025-10-29 22:22:45 +01:00
request_id:
2025-10-21 01:19:16 +02:00
type: RequestId
description: "The request ID associated with the failed message"
2025-10-29 22:22:45 +01:00
message_hash:
2025-10-28 01:27:38 +01:00
type: string
description: "Optional property. Hash of the message that got error"
2025-10-21 01:19:16 +02:00
error:
type: string
description: "Error message describing what went wrong"
2026-02-03 12:20:37 -03:00
MessageSendPropagatedEvent:
2025-10-21 01:19:16 +02:00
type: object
2025-11-13 16:20:02 +11:00
description: "Confirmation that a message has been correctly delivered to some neighbouring nodes."
2025-10-13 16:33:08 +11:00
fields:
2025-10-29 22:22:45 +01:00
request_id:
2025-10-21 01:19:16 +02:00
type: RequestId
2025-10-23 00:17:09 +02:00
description: "The request ID associated with the propagated message in the network"
2025-10-29 22:22:45 +01:00
message_hash:
2025-10-21 01:19:16 +02:00
type: string
2025-10-23 00:17:09 +02:00
description: "Hash of the message that got propagated within the network"
2025-10-21 01:19:16 +02:00
2025-11-13 16:20:02 +11:00
MessageEvents:
2025-10-28 01:27:38 +01:00
type: event_emitter
2025-10-21 01:19:16 +02:00
description: "Event source for message-related events"
2025-11-13 00:47:54 +01:00
events:
2026-02-03 12:20:37 -03:00
"message:received":
type: MessageReceivedEvent
2025-11-13 00:47:54 +01:00
"message:sent":
type: MessageSentEvent
2026-02-03 12:20:37 -03:00
"message:send-error":
type: MessageSendErrorEvent
"message:send-propagated":
type: MessageSendPropagatedEvent
2025-10-21 01:19:16 +02:00
```
2025-10-07 00:42:32 +02:00
2026-02-03 12:20:37 -03:00
#### Messaging function definitions
2025-06-30 15:25:12 +10:00
2026-02-03 12:20:37 -03:00
```yaml
functions:
2025-07-21 22:07:14 +10:00
2026-02-03 12:20:37 -03:00
send:
description: "Send a message through the network."
parameters:
- name: message
type: MessageEnvelope
description: "Parameters for sending the message."
returns:
type: result< RequestId , error >
2025-10-13 16:33:08 +11:00
```
2026-02-03 12:20:37 -03:00
#### Messaging extended definitions
A first `message` sent with a certain `contentTopic` SHOULD trigger a subscription for such `contentTopic` as described in the `Subscriptions` section.
2025-10-03 16:30:09 +10:00
2026-02-03 12:20:37 -03:00
The node uses [P2P-RELIABILITY ](/standards/application/p2p-reliability.md ) strategies to ensure message delivery.
### Subscriptions
#### Subscriptions type definitions
2025-10-03 16:30:09 +10:00
```yaml
types:
2026-02-03 12:20:37 -03:00
2026-02-04 08:14:16 -03:00
SubscriptionError:
2026-02-03 12:20:37 -03:00
type: object
2026-02-04 08:14:16 -03:00
description: "A content topic subscription-related operation failed synchronously and irremediably"
2026-02-03 12:20:37 -03:00
fields:
content-topic:
type: string
description: "Content topic that the node failed to subscribe to or unsubscribe from"
error:
type: string
description: "Error message describing what went wrong"
2025-10-03 16:30:09 +10:00
```
2026-02-03 12:20:37 -03:00
#### Subscriptions function definitions
2025-10-03 16:30:09 +10:00
```yaml
functions:
2026-02-03 12:20:37 -03:00
2025-10-03 16:30:09 +10:00
subscribe:
description: "Subscribe to specific content topics"
parameters:
- name: contentTopics
type: Array< string >
description: "The content topics for the node to subscribe to."
returns:
2026-02-04 08:14:16 -03:00
type: result< void , array < SubscriptionError > >
2026-02-03 12:20:37 -03:00
2026-02-03 09:14:29 -03:00
unsubscribe:
description: "Unsubscribe from specific content topics"
parameters:
- name: contentTopics
2026-02-03 16:12:49 -03:00
type: Array< ContentTopic >
2026-02-03 09:14:29 -03:00
description: "The content topics for the node to unsubscribe from."
returns:
2026-02-04 08:14:16 -03:00
type: result< void , array < SubscriptionError > >
2025-10-03 16:30:09 +10:00
```
2026-02-03 12:20:37 -03:00
#### Subscriptions extended definitions
2025-10-03 16:30:09 +10:00
**`mode` **:
2026-03-18 22:31:13 +01:00
If the `mode` set is `edge` , `subscribe` SHOULD trigger set up a subscription using [FILTER ](https://lip.logos.co/messaging/standards/core/12/filter.html ) as client and [P2P-RELIABILITY ](/standards/application/p2p-reliability.md ).
2025-10-03 16:30:09 +10:00
2026-03-18 22:31:13 +01:00
If the `mode` set is `core` , `subscribe` SHOULD trigger set up a subscription using [RELAY ](https://lip.logos.co/messaging/standards/core/11/relay.html ) and [P2P-RELIABILITY ](/standards/application/p2p-reliability.md ).
2025-10-03 16:30:09 +10:00
This MAY trigger joining a new shard if not already set.
2026-02-03 12:20:37 -03:00
Only messages on subscribed content topics SHOULD be emitted by a `MessageEvents` event source, meaning messages received via `RELAY` SHOULD be filtered by content topics before emission.
2025-10-03 16:30:09 +10:00
2025-10-13 15:47:12 +11:00
**`error` **:
2026-02-04 08:28:57 -03:00
Only irremediable failures should lead to synchronously returning a subscription error for failed subscribe or unsubscribe operations.
2026-02-03 12:20:37 -03:00
2026-02-03 09:14:29 -03:00
Failure to reach nodes can be omitted, and should be handled via the health events;
2025-10-13 15:47:12 +11:00
[P2P-RELIABILITY ](/standards/application/p2p-reliability.md ) SHOULD handle automated re-subscriptions and redundancy.
2025-10-13 16:33:08 +11:00
Examples of irremediable failures are:
2025-10-13 15:47:12 +11:00
- Invalid content topic format
- Exceeding number of content topics
- Node not started
2026-02-03 12:20:37 -03:00
- Already unsubscribed
2025-10-13 15:47:12 +11:00
- Other node-level configuration issue
2026-02-03 12:20:37 -03:00
### Health
#### Health type definitions
2025-10-23 00:41:31 +02:00
```yml
types:
2026-02-03 12:20:37 -03:00
2026-01-26 15:27:14 -03:00
ConnectionStatus:
2025-10-23 00:41:31 +02:00
type: enum
2026-01-26 15:27:14 -03:00
values: [Disconnected, PartiallyConnected, Connected]
2025-10-23 00:41:31 +02:00
description: "Used to identify health of the operating node"
2026-02-03 12:20:37 -03:00
HealthConnectionStatusEvent:
type: object
description: "Event emitted when the overall node health status changes"
fields:
connection-status:
type: ConnectionStatus
description: "The node's new connection status"
HealthEvents:
type: event_emitter
description: "Event source for health-related events."
events:
"health:connection-status":
type: HealthConnectionStatusEvent
2025-10-23 00:41:31 +02:00
```
2026-02-03 12:20:37 -03:00
#### Health function definitions
2026-02-04 08:14:16 -03:00
TODO
2026-02-03 12:20:37 -03:00
#### Health extended definitions
2025-10-23 00:41:31 +02:00
2026-01-26 15:27:14 -03:00
`Disconnected` indicates that the node has lost connectivity for message reception,
2025-10-28 01:41:59 +01:00
sending, or both, and as a result, it cannot reliably receive or transmit messages.
2025-10-23 00:41:31 +02:00
2026-01-26 15:27:14 -03:00
`PartiallyConnected` indicates that the node meets the minimum operational requirements:
2026-03-18 22:31:13 +01:00
it is connected to at least one peer with a protocol to send messages ([LIGHTPUSH ](https://lip.logos.co/messaging/standards/core/19/lightpush.html ) or [RELAY ](https://lip.logos.co/messaging/standards/core/11/relay.html )),
one peer with a protocol to receive messages ([FILTER ](https://lip.logos.co/messaging/standards/core/12/filter.html ) or [RELAY ](https://lip.logos.co/messaging/standards/core/11/relay.html )),
and one peer with [STORE ](https://lip.logos.co/messaging/standards/core/13/store.html ) service capabilities,
2025-10-28 01:41:59 +01:00
although performance or reliability may still be impacted.
2025-10-23 00:41:31 +02:00
2026-01-26 15:27:14 -03:00
`Connected` indicates that the node is operating optimally,
2025-10-28 01:41:59 +01:00
with full support for message reception and transmission.
2025-10-23 00:41:31 +02:00
2026-02-25 14:31:07 +01:00
### Debug
#### Debug function definitions
```yaml
functions:
getAvailableNodeInfoIds:
description: "Returns a list of available node information identifiers. e.g., [ version, my_peer_id, metrics ]."
returns:
type: result< array < string > , error>
getNodeInfo:
2026-02-27 14:59:58 +01:00
description: "Returns the JSON formatted node's information that is requested. Expect single value or list results depending on requested information."
2026-02-25 14:31:07 +01:00
parameters:
- name: nodeInfoId
type: string
2026-02-27 14:49:47 +01:00
description: "Information identifier. The only supported values are the ones returned by getAvailableNodeInfoItems function."
2026-02-25 14:31:07 +01:00
returns:
type: result< string , error >
2026-02-27 14:49:47 +01:00
getAvailableConfigs:
description: "Returns a list of all available options, their description and default values."
returns:
type: string
2026-02-25 14:31:07 +01:00
```
2025-07-21 22:07:14 +10:00
## The Validation API
2025-06-30 15:25:12 +10:00
2026-03-18 22:31:13 +01:00
[WAKU2-RLN-RELAY ](https://lip.logos.co/messaging/standards/core/17/rln-relay.html ) is currently the primary message validation mechanism in place.
2025-07-21 22:07:14 +10:00
Work is scheduled to specify a validate API to enable plug-in validation.
2025-09-25 13:48:40 +10:00
As part of this API, it will be expected that a validation object can be passed,
2025-07-21 22:07:14 +10:00
that would contain all validation parameters including RLN.
2025-09-25 13:48:40 +10:00
In the time being, parameters specific to RLN are accepted for the message validation.
RLN can also be disabled.
2025-06-30 15:25:12 +10:00
2025-06-17 19:47:29 +10:00
## Security/Privacy Considerations
See [WAKU2-ADVERSARIAL-MODELS ](https://github.com/waku-org/specs/blob/master/informational/adversarial-models.md ).
## Copyright
Copyright and related rights waived via [CC0 ](https://creativecommons.org/publicdomain/zero/1.0/ ).