hs-libp2p: A Haskell Implementation of the libp2p Stack
Devcon·Fri, Nov 6, 2026, 12:00 AM
Speaker
Transcript
[music] [music]
Hey guys. Hi everyone. Uh here is Shoki from Mix Foundation. So, today I'm talking about uh my current work, Haskell libp2p. So, does anyone know about Haskell?
No? Nice, nice, nice. And uh libp2p? Uh okay. Let's move on to my topic.
So, in terms of the Ethereum, we use in the libp2p on the consensus client. And the libp2p is a protocol stack for p2p's and a bunch of network protocol supports. And uh in the consensus client, each client implement different languages. Like a Prism using the Go and the Lighthouse and Lodestar implemented in Rust. Also, they choose the libp2p in Go or Rust.
Uh once, for example, uh Prism has a bug in Go libp2p, it corrupts Prism networks. But uh if you uh if the any other language is also implemented in each client, the bug will be not effect for entire the network. This is a client diversity. However, as you can see, there is no functional programming. So, I introduce Haskell and uh introduce a new paradigm for uh with the program uh functional programming.
So, Haskell is a good fit for robust uh system like a blockchain or uh uh financial system. Uh for example, you can find the Cardano blockchain, uh which main uh client is implemented in Haskell. So, I think it's good work for blockchain as well and Ethereum. Uh they have a big property like a pure functions and strong static types. And may may important, so usually it's uh output uh same output.
Also, they have a strong attack types. So, uh the compiler rejects the do not uh undefined behavior. Like uh For example, lastly using the undefined, but uh Haskell do not have such kind of things. So, it's more uh robust for the uh by default. And uh each data is immutable.
So, once you buy uh your value is uh implemented in the Haskell, each data is uh easy to swap, and uh there were mistakes. But, uh it easy to understand for AI because uh compiler rejects uh such kind of undefined behavior, and uh compiler uh protects that kind of swap. So, here's our example of the uh stream state, which is defined in Yamux, which is uh Max Bricks Tours. And uh you can see kind of stream or kind of the thing and uh local cross la la la la la, which is the life cycle of a stream state, and each state is defined by a static status. And uh you can see the transaction value, which is uh uh bottom of the top uh bottom side.
And uh which is a shared variable that the only state STM transaction can change. What is uh STM is a software transaction memory. So, if you protect uh self concurrency, uh STM is useful in Haskell. That is uh that protect the threads update shared state all or nothing. So, we do not need a locks uh more locks or something like that to make a concurrency.
So, currently our implementations support the common area distributed hash table implementation, and uh which is passed the all tests with uh Python repeat the B or name or something like that. So, uh Also, we support the quick protocol, which is a main use case main option on consensus client. However, it's partially pass the functions. So, we need to implement the back transfer, and it's just only interact with Go P2P. So, yeah.
Our Our libp2p is not in production. So, we need to make more implementations and involve in other P2P guys. Also, we try to migrate the post-quantum signature or key exchanges. This part is not uh not specified at now. Oh, yeah.
Oh. And uh we have a workshop tomorrow, and uh you uh sorry, on Friday. So, if you want to understand what happened in post-quantum signature or post-quantum key exchange in P2P layer, please feel free to join us. Uh yep. That's it for me.
Thank you so much.
Beautiful. Thank you very much, Yuki. Now, we're going to have time for about one question here. If anyone wants me to throw the box.
[laughter]
Nice catch.
Uh do you have or plan to have uh interop testing with uh other implementations of libp2p?
Uh you mean the I have uh interact with any other clients
Yeah, yeah, yeah. Yeah, exactly.
Uh yeah, for now, we don't have any specific plan, but uh we try to unify test with the Go P2P or just don't only for Go P2P, but also last or something like that. Uh in client things, we do not integrate with any other clients for now.
Mhm.
Just only for P2P network nodes.
Yeah. All right. Okay. Yeah. Uh we'll try I'll try to catch you to chat later.
Thanks so much.
Beautiful. Thanks, Yiannis. Uh time for one last question. It looks like you're free, you.
Thank you.
Thank you very much for the talk, Sookie, and you're welcome to
[music]
Automatic transcript — names and jargon may be misspelled.