project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4

Libp2peasy, the Libp2p Plugin System

Plug and Play Libp2p Apps to fast track Development. Build a plugin, compile it to wasm, and run it with any libp2p implementation.

Libp2peasy, the Libp2p Plugin System

Created At

HackFS 2023

Winner of

🤝 libp2p — Best Use

Project Description

Right now if you want to build something using libp2p pubsub, you'd need to scaffold an entire new project. Then that project is limited to only the functionality it has at the start, and cannot be extended.

Say you write a chat app using libp2p over pubsub. Then you want to also use pubsub to run some sort of identity protocol. Right now, you'd either have to convince the developer to add your request to their stack, or fork and build your own.

However, with Libp2peasy, you simply write a WebAssembly Plugin for your pubsub codec, and anyone can use it with any language at runtime. You can stack as many plugins as you like to gain more and more functionality with the same networking baseline over libp2p.

Overall this will make Libp2p more extensible and easier to adopt.

How it's Made

A developer who wants to encoded and decode messages on PubSub uses Extism to scaffold the plugin system in Rust to write the WebAssembly code.

The plugin interface is designed to take a JSON object in a "send" function. Depending on what the Frontend UI "sends" to the plugin will determine how the plugin handles the data -- either encodes it for publishing, subscribes to a topic or unsubscribes.

For the demo reference implementation of IPNS, the frontend UI only needs to supply a CID string to be published. The wasm extism plugin written in Rust takes care of all the signing, encoding to binary, prepending /record/base64url-unpadded(/ipns/BINARY_ID).

This framework can be extended to any other protocol! So developers can just start using the protocol instead of having to re-write it in their language of choice. They simple interface to the plugin.

background image mobile

Join the mailing list

Get the latest news and updates