# Libp2p implementation in C# and Prysm | Devcon SEA

- Channel: [Devcon](https://streameth.org/devcon)
- Date: 2025-10-07
- Duration: 16:56
- Watch: https://streameth.org/watch/yt-zAlxmEONKGE
- YouTube: https://www.youtube.com/watch?v=zAlxmEONKGE

## Description

Joint talk will discuss a project which split to work on the C# implementation of Nethermind's libp2p, where we implemented the TLS protocol, upgraded the Noise protocol, and added the Perf protocol. Although the first version of the C# implementation isn’t released yet, it is integrated with Gnosis Chain’s Shutter node. Second part of the talk focuses on new goland libp2p library for Prysm CL client

Speaker(s): Rose, Richa, kira
Skill level: Intermediate
Track: [CLS] EPF Day
Keywords: Consensus, Network State

Follow us: https://twitter.com/efdevcon, https://twitter.com/ethereum, https://warpcast.com/devcon
Learn more about devcon: https://www.devcon.org/
Learn more about ethereum: https://ethereum.org/ 

Visit the https://archive.devcon.org/ to gain access to the entire library of Devcon talks with the ease of filtering, playlists, personalized suggestions, decentralized access on Swarm, IPFS and more.

Devcon is the Ethereum conference for developers, researchers, thinkers, and makers. 
Devcon SEA was held in Bangkok, Thailand on Nov 12 - Nov 15, 2024.
Devcon is organized and presented by the Ethereum Foundation. To find out more, please visit https://ethereum.foundation/

## Transcript

[Music] [Music] yeah so before diving deep into my contributions I would first not before uh diving deep into my contribution I would first uh uh like to go through the introduction of the lip P2P uh so uh lip p2b is a modular networking framework Library uh used by the peers to communicate in a distributed network uh it comprises of various protocols uh like the transfer protocol stream multiplexers en transer transversal Etc and uh when compared with the dev P2P it's more modular and interoperable defb2 is more concerned to the ethereum's needs specifically uh so it comprises of various components um so the first component is transport so like when a peer is connected to the internet um it basically you know shares and sends the bytes and uh bits to the uh via IP and TCP connection which is like the combination of the Internet Protocol uh which is responsible for the addressing and the sending data packets and for the TCP transport control protocol it's responsible for the sequencing of the data like the the order of the data package that have been moved to the sender it's been the same order as of the uh as of the uh receiver uh moving on to the next the hand sck so basically when we have a TCP or IP connection it's not secure we need to secure the connection to you know transmit the data so um so the handshake is for the secure Communication channel for the message exchanges so it compris of the TLs protocol and the noise protocol um also like the qic is like uh one kind of Transport which has the inbuilt encryption towards it yeah so moving on to the next the protocol negotiation so during the uh selection of the multistream uh there are various multi stream that the client can support right so we need to negotiate over a one particular stream so that's what the protocol negotiation is there like that what the negotiation of the protocol happens between the peers when they are you know trying to have a connection between them uh multiplexing so multiplexing is used for creating uh multiple virtual connections within a stream so it's like a more scalable connection when the peer wants to send the multiple stream of messages over a network so it comprises the implex and the YX it's fast and efficient now uh I would like to move on to my contribution toward it towards it so like I build the full implementation of the TLs protocol uh so I would like to give the introduction of the TLs protocol like uh TLS protocol is is a secure L communication used to encrypt data and authenticate PE um so how it works so basically uh during the handshake peers uh authenticate uh the user by encoding their public hosy into the uh uh into the x.509 certificate and and uh so peers are not compiled to use their original public skill they can use any arbitrary key types and um and so uh like then PE uh then the uh a yeah peers use their host key along with the into the lip to be public key extension so Li lipy Tob publicy extension comprises of two parts that is the signature and the host key so uh for making the signature the end points what they do is they uh add on the string lip tols handshake along with the uh uh along with uh their host key and it's signed by the uh their private key so like the uh when it's been transferred to the other peer this Speers verifies that the signature is currect and H the successful hand set takes place so here's the diagram that's showing that it uh it send the request of the same and the when the certificate verified the successful hand takes place so these are my most PRS that I contributed to the Nethers net liit repo uh now moving on to the perf protocol so uh perf protocol is basically used to measure how fast the lipid B works it's a benchmarking protocol and it depends upon the two uh scenarios like the the throughput per second uh and also the handex per second so yeah so like it comprises of the two tests update update test and the download speed test so what happens with the update speed test is that the client configures the server to uh to uh to respond with the zero bytes that that means the client will send the data and the server don't doesn't need to send back the data so once the predetermined bytes has been sent to the server uh the CL the client closes the connection so it means uh so yeah so it closes the connections and the time is calculated for the same and that's how the upload speed test has been calculated moving on to the download speed test so download speed test uh the client uh configur server to send over the nend bytes which is like the the B total bytes that will be downloaded from the the server so uh so uh then uh like the server sends the data and it and um yeah and that's the time is calculated and that's how the down speed test is conducted so here is the screenshot showing the time seconds for the download speed test it's like uh I haven't fully implemented it it's in progress and like um here's the link for the pr and like uh like the mentor has suggested some changes so like I need to work it's in progress um moving on to the next so the next thing that I implemented was the noise protocol feature Edition so um so as described earlier that um um that during the protocol negotiation we need to select the particular protocol for like the steam multiplexing right so uh so what happens is like um uh we can fast the process during the hand SEC itself like we can combine the uh the hand SEC and the protocol negotiation as well so it can be done with the help of the noise extensions U it's a particular feature of the noise so like what happens is like the the when so like there is the list of the uh prot list of the protocols that the client um that the client supports and there's a list of protocols that the server supports and then when they're doing the hand sick so uh the follow will be conducted through it and like the first Common protocol will be selected and yeah so here's the mer we have for the same thank you thank you so much Rose uh before we continue with the second half of this presentation do we have questions on discard on Rose anyone comments questions okay we can slowly move on then guys come come to please plug in um yeah because the story of this project is that it was started um as as a joint um uh effort but then it split into these parts so we have the CP part uh by Rose and we continue with the prism uh implementation uh with Kira and Richa so yeah I promise you you will see rich on the stage again today and uh here it is so yeah uh yeah we need to switch to HDM there was a question for uh for Rose uh can you estimate the time required to develop in a new language could you more elaborate the question like what's like the uh is it like the compilation time or like to develop a new language world yeah so I've been working for the past two three months for this yes so I been contributing to it from the past three months yeah thank you and uh if we can switch to HDMI we have DS slides ready very well yeah uh is it is it yours just click on the slid share no because it's is it from the computer ah yeah okay I see what's happening it's mirrored yeah yeah please use the the keys to change okay uh you need need to use keyboard okay go ahead guys yeah uh all right uh yeah uh the project was initially started as like as a collaborated effort uh on our on like three fellows Maxim like which did uh who did like most of the implementation part he's not here uh today uh and then Rich and me uh so yeah our part of the project was uh um since like lip is like B uh used uh used by pretty much every consensus clients uh so uh we basically were trying to trying to uh eliminate the uh elim the use of integral Parts uh for prism uh yeah since uh I think they announced uh announced like few months ago that they were going to stop the maintenance of Le TP uh so yeah this project was uh basically uh trying to help RM team to enable this um yeah it also it also enables uh elimination of the Redundant components from the goal P2P which are not really used and like it just uh it just covers a lot of spaghetti code in the prism code base uh and uh still not sacrifice on any kind of performance and of course uh like implementing this project would involve a deep understanding of Li uh Library uh yeah moving forward with the project structure so what we did uh we divided the project into several segments since our main motivation was to uh remove the Redundant parts of the lipit uh to uh have the uh to have the uh components of Li P which were basically used by the prism team so we started with segregating we started with understanding how lip ptop was actually working and how Prisma was LE leveraging the lip P2P protocol so we segregated the components like what all lipit to be had and what all we actually needed for the prism then uh yeah we REM we filtered the elements and there were several Elements which could have been reused as they were were a separate Standalone components and several uh components which were to be implemented or refactored so we filtered out those and then the next step was to implement the components in uh in the package form in the prism code base itself and then testing next we had to uh integrate it with the prism code base to switch from the lip P2P protocol implementation to the in-house implementation and next was to do the performance analysis and optimize the code for better performance or at least the same performance as was with the lipy to protocol so how we uh yeah how we move ahead so first we uh worked on segregating the components so as we can uh we have we found out the main components which were actually used by uh lip P prism in lip P2P so there were some components for for config for basically for basic configuration of the uh prism to be basic configuration of lip P2P for prism including the peer or the address configurations or the key configurations for cryptographic for cryptographic connections then the second one was main which was basically linked with the config for actually U making the connections or the starting configurations then there were TCP transport so there were two transports which were uh there multip transports protocols which were available in Li P2P but the Prisma mainly uses the 3cp and not the quick Proto quick protocol so we didn't so we eliminated the quick transport and use the implemented the tp1 then there were TLS which was used by quick transport again so and the TCP so uh yeah next coming to the multiplexers there were mlex and yamix implemented within lip2p but the already only used the yamuk so we uh eliminated the implex there and then there were noise which which were just to be used as it is from the lip P2P then there were several more components upgrader Pier restore the network and the host apart from this the connection Gator and The Connection Manager they were not to be used or yeah they were small segments which we just included it in the uh main or the config and then talking about the gossip sub they the uh these were the events which these were the things which could be uh reused or eliminated next yeah so how we uh implemented uh so yeah we have the components ready for the config Main and the TCP transport then the yamuk upgrader and uh other peer store Network SW and the host so gossip sub and the remaining components were either they were not to be used or they were to be integrated in the final protocol as it is from the lip B2B so yeah these are the main components that were to be implemented as we uh figured out in our first step next uh we can move on how we are going to move ahead so we have the individual components ready The Next Step would be to integrate it in integrate the individual components make the uh smaller code changes which are needed to actually test and connect the uh different individual components the next would be testing and benchmarking and a complete protocol within the prism and then finally optimizing for better performances yeah thank you thank you very much both of you and we have questions for Kira Richa uh about the prism peer peer-to-peer go Library anyone okay any comments questions last chance oh there is sorry uh yeah it is the same one from before okay yeah anyway anyway please submit online questions if you are on the stream over there um otherwise we will slowly move uh Kira you continue right and we have Caleb as well yeah uh
