cardano-node icon indicating copy to clipboard operation
cardano-node copied to clipboard

[FR] - Allow the node to expose WebSocket for node-to-node comunications

Open michele-nuzzi opened this issue 2 years ago • 7 comments

Internal/External External

Area Other

Describe the feature you'd like

It would be great if the node could listen to WebSocket connections on top of TCP ones.

The main reason for such a feature is light clients; which would then be able to participate directly in the network from the application using them.

Describe alternatives you've considered

Having a proxy that translates WebSocket requests to TCP socket ones; not the best if we want to keep it trustless.

michele-nuzzi avatar May 27 '23 08:05 michele-nuzzi

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days.

github-actions[bot] avatar Jun 27 '23 02:06 github-actions[bot]

We think the best approach is to build such a proxy as a separate binary as otherwise it would increase security risk and maintenance costs.

It's not something difficult to do, but the design will depend on how one wants to embed the node-to-node protocol into WebSocket frames. One approach would be to simply wrap Handshake messages and mux SDUs in a websocket frames, but maybe that's not the only option.

coot avatar Jun 28 '23 11:06 coot

To be clear, the security risk is the increased footprint of the libraries that would be part of the node. We have an ongoing strategy to remove as many of these as reasonable. In particular we are trying to eliminate the need for HTTP related ones from the package footprint.

njd42 avatar Jun 28 '23 11:06 njd42

That makes sense, thanks a lot for the explanations

michele-nuzzi avatar Jun 28 '23 13:06 michele-nuzzi

To be clear, the security risk is the increased footprint of the libraries that would be part of the node

This could be covered with package compile flag.

Projects who need WS will still have such dependencies and thus "package footprint", just from separate project. Thus Cardano infra would get one more reason for differentiation, and thus more work by downstream projects and more security risks.

uhbif19 avatar Jun 29 '23 10:06 uhbif19

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days.

github-actions[bot] avatar Jul 30 '23 01:07 github-actions[bot]

Related issue IntersectMBO/ouroboros-network#4908.

coot avatar Aug 12 '24 12:08 coot

@michele-nuzzi, I think we resolved this during a Network Working Group call some time ago.

coot avatar Nov 01 '24 08:11 coot