2024-05-29 16:31:10 +00:00
---
2024-06-21 13:49:42 +00:00
title: WAKU-LIGHTPUSH
2024-06-19 13:56:43 +00:00
name: Waku Light Push
2024-05-29 16:31:10 +00:00
editor: Zoltan Nagy < zoltan @ status . im >
contributors:
- Hanno Cornelius < hanno @ status . im >
- Daniel Kaiser < danielkaiser @ status . im >
- Oskar Thorén < oskarth @ titanproxy . com >
---
previous version: `/vac/waku/lightpush/2.0.0-beta1` [19/WAKU2-LIGHTPUSH ](https://rfc.vac.dev/waku/standards/core/19/lightpush )
---
2024-06-09 17:36:56 +00:00
**Protocol identifier**: `/vac/waku/lightpush/3.0.0`
2024-05-29 16:31:10 +00:00
## Motivation and Goals
2024-06-09 17:36:56 +00:00
Light nodes with short connection windows and limited bandwidth wish to push messages to other nodes in the Waku network to request message services.
A common use case is to request that service node to publish the message to a `11/WAKU2-RELAY` pubsub topic.
2024-05-29 16:31:10 +00:00
Additionally, there is sometimes a need for confirmation that a message has been received "by the network"
(here, at least one node).
2024-06-19 13:56:43 +00:00
`WAKU-LIGHTPUSH` is a request/response protocol for this.
2024-05-29 16:31:10 +00:00
## Payloads
```protobuf
syntax = "proto3";
message LightPushRequest {
2024-06-19 13:56:43 +00:00
string request_id = 1;
uin32 request_type = 10; // 10 Reserved for future `request_type` . Currently RELAY is only available service.
optional string pubsub_topic = 20;
2024-05-29 16:31:10 +00:00
WakuMessage message = 21;
}
message LightPushResponse {
string request_id = 1;
2024-06-09 17:36:56 +00:00
uint32 status_code = 10; // non zero in case of failure, see appendix
2024-05-29 16:31:10 +00:00
optional string status_desc = 11;
uint32 relay_peer_count = 12;
}
```
### Message Relaying
2024-06-19 13:56:43 +00:00
Nodes that respond to `LightPushRequest` MUST either relay the encapsulated message via [11/WAKU2-RELAY ](https://rfc.vac.dev/waku/standards/core/11/relay ) protocol on the specified `pubsub_topic` . Depending on the network configuration, user may not need to provide `pubsub_topic` ([WAKU2-RELAY-SHARDING](https://github.com/waku-org/specs/blob/master/standards/core/relay-sharding.md)).
2024-05-29 16:31:10 +00:00
If they are unable to do so for some reason, they SHOULD return an error code in `LightPushResponse` .
2024-06-09 17:36:56 +00:00
### Examples of possible error codes
| Result | Code | Note |
|--------|------|------|
2024-06-19 13:56:43 +00:00
| SUCCESS | 200 | Successfull push, response's relay_peer_count holds the number of peers the message is pushed. |
| BAD_REQUEST | 400 | Wrong request payload. |
2024-06-09 17:36:56 +00:00
| PAYLOAD_TOO_LARGE | 413 | Message exceeds certain size limit, it can depend on network configuration, see status_desc for details. |
2024-06-19 13:56:43 +00:00
| UNSUPPORTED_TOPIC | 421 | Requested push on pubsub_topic is not possible as the service node does not support it. |
2024-06-09 17:36:56 +00:00
| TOO_MANY_REQUESTS | 429 | DOS protection prevented this request as the current request exceeds the configured request rate. |
| INTERNAL_SERVER_ERROR | 500 | status_desc holds explanation of the error. |
2024-06-20 12:34:39 +00:00
| NO_PEERS_TO_RELAY | 503 | Lightpush service not available as node has no relay peers. |
2024-06-09 17:36:56 +00:00
> The list of error codes are not complete and can be extended in the future.
2024-05-29 16:31:10 +00:00
## Security Considerations
Since this can introduce an amplification factor, it is RECOMMENDED for the node relaying to the rest of the network to take extra precautions.
2024-06-19 13:56:43 +00:00
Therefore Waku applies or will apply:
2024-06-09 17:36:56 +00:00
- DOS protection through request rate limitation on the service itself.
- message rate limiting via [17/WAKU2-RLN-RELAY ](https://rfc.vac.dev/waku/standards/core/17/rln-relay ), applied via network membership subscription.
2024-05-29 16:31:10 +00:00
2024-06-09 17:36:56 +00:00
> These features are under development.
2024-05-29 16:31:10 +00:00
## Future work
- Add support attaching RLN proof for the message requested to be relayed.
- Add support for other request types.
2024-06-09 17:36:56 +00:00
- Incentivization of the service
2024-05-29 16:31:10 +00:00
## Copyright
Copyright and related rights waived via [CC0 ](https://creativecommons.org/publicdomain/zero/1.0/ ).
## References
* [11/WAKU2-RELAY ](https://rfc.vac.dev/waku/standards/core/11/relay )
* [17/WAKU2-RLN-RELAY ](https://rfc.vac.dev/waku/standards/core/17/rln-relay )