Good morning! I am looking at the PSS API checking the erebos/pss.js example. I am slightly confused with the follow:

const alice = new PssAPI(createRPC('ws://'))
const bob = new PssAPI(createRPC('ws://'))

Do we have to create a new connection/port for each user? Having as reference a simple chat with n users. How would this even work?

Thank you!

1 Answer 1


The default use case of pss is one sender/recipient per node. So in your case Alice would have a running node, Bob would have a different running node, and they each make websocket connections to their respective nodes.

You can create multiple subscriptions* on the same node (with the same topic), but both subscribers will then get the same messages. That means that distiguishing what is for who will have to be controlled in your application logic.

That being said, one running node will only have one single keypair for public key crypto, which is the same key as the swarm node is running on.

*I am unsure exactly how erebos maps to the actual calls in pss rpc calls. Via the RPC subscribe is only one action, but here it seems to be one for registering the topic and one for actually receiving messages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.