Beginner's Walkthrough: Making Sense of the Lens Protocol

Beginner's Walkthrough: Making Sense of the Lens Protocol

A Step-by-Step Guide to Navigating the Lens Protocol for Web3 Newcomers

Β·

10 min read

In today's digital age, having a strong social media presence is a must for anyone looking to build their personal brand or grow their professional network. But the downside of relying on centralized social media platforms is that you have little control over your followers and content monetization. That's where the Lens Protocol comes in 🀩. Built on the Polygon blockchain, it offers a decentralized solution that allows you to take ownership of your social graph and community. Exciting, right? πŸ€” In this blog post, I will give you a closer look at the Lens Protocol, how it works, and it's core concepts. So if you're curious about this innovative decentralized social media platform, keep reading! πŸš€

Introduction: The importance of social media in today's world, and the drawbacks of centralized social media platforms.

πŸ“£ Social media has become an indispensable tool for individuals and businesses alike in today's world. It provides a platform for people to connect, share ideas, and showcase their talents and products. However, the centralized nature of social media platforms has created some drawbacks that can hinder the growth and success of content creators. One major issue is the problem of content being locked in one place. When content is published on a social media platform, it often stays there, making it difficult for creators to reach a wider audience on other platforms. πŸ˜”

πŸ€” Another challenge with traditional social media platforms is the lack of interoperability. Each platform operates as a silo, which means that creators have to rebuild their audience from scratch on every new platform. This also leads to a fragmented experience for the audience, who have to follow their favorite creators on multiple platforms to stay updated on their content. This not only creates additional work for content creators but also makes it harder for them to grow.

Current State of Traditional Social Media Platforms.

This is where The Lens Protocol comes in, it offers a groundbreaking solution to the issue of content and audience lock-in on traditional social media networks by providing a more decentralized and transparent system.

What is Lens Protocol?

It is a Web3 social graph on the Polygon Proof-of-Stake blockchain.

But what exactly is Web3 social graph, you askπŸ€”?

Think of it like this: every time you use a lens-enabled app, make social interactions, and generate content there, The way of representing the relationships between your social profiles and the content generated by you is referred to as a social graph, Web3 because this social graph is stored on the blockchain in a decentralized manner.

Unlike Web2 social media that rely on centralized databases, the Lens Protocol is a user-owned, open social graph that can be accessed by any application. This means that creators have full control over their data and can easily bring it to any new application built on top of the Lens Protocol. 🀩

πŸ‘₯ By putting users in charge of their data, the Lens Protocol creates a collaborative ecosystem where each application benefits the entire community. Creators no longer have to worry about losing their audience and livelihood based on the arbitrary policies and algorithms of a single platform. Additionally, developers can create meaningful social experiences without resorting to tactics that lock in a user's attention. The Lens Protocol empowers creators and users alike, enabling them to take full ownership of their content and community. πŸ”‘

Core concepts of the Lens Protocol: Exploring the key ideas behind the Lens Protocol

At its core, the Lens Protocol is a series of smart contracts deployed onto the blockchain.

Again, what is a smart contract? In the most basic way, it can be defined as lines of code that are specifically designed to execute logic and interact with data on the blockchain.

If you're feeling super tech-savvy, you can even check out the source code for the Lens Protocol smart contracts here.

In this section, I am going to explain some of the core concepts of the lens ecosystem and basically how these smart contracts work together.

1. Profiles

Profiles are a key component of the Lens Protocol, providing users with a unique digital identity in the decentralized world. The profiles here are not just a simple list of personal information, but NFTs that contains the history of all your posts, mirror, comments, and any other content you generate.

Ownership of these NFTs gives the owner complete control over the content associated with it, allowing them to determine how it is used and distributed.

And that's not all! The Lens Protocol's profiles also offer an optional follow module, allowing users to configure the business logic of how other users can follow them. Creators can even limit follow permissions to specific NFT holders, giving them even more control over their audience 🎭.

2. Publications

Publications are at the heart of the Lens Protocol, representing all of the original content, comments, and mirrors produced by creators, curators, and users alike.

There are three primary types of publications: posts, comments, and mirrors, each providing its own functionality.

Posts are the base object, containing the primary content created by the user. Mirrors and comments build on this functionality, providing additional ways for users to interact with and respond to the original post.

One of the key features of the Lens Protocol is that publications are posted directly to a user's ProfileNFTs. This ensures that all content created by a user remains user-owned and in their wallet, giving them complete control over how it is used and distributed.

However, it's important to note that the blockchain itself does not store the content. Instead, the blockchain contains a contentURI that points towards the actual content the publication contains. This can be text, images, videos, or any other type of content that is stored on a decentralized storage protocol such as IPFS, Arweave, or other web2 storage infrastructures.

But that's not all! Publications in the Lens Protocol have even more functionality to explore πŸ”. Each publication has two attached modules, a Collect Module, and a Reference Module, providing users with even more control and flexibility over their content.

The Collect Module contains the logic that determines how or whether other users can mint your publication into an NFT. This NFT will reference the original publication's URI, giving users a new way to own and trade their favorite content. With this powerful tool, creators can explore new monetization modelsπŸ€‘ and engage with their audiences in new and exciting ways.

Meanwhile, the Reference Module controls references to the publication itself. It contains the logic that determines who can comment and mirror the publication, for example giving users the flexibility to set it so only users who follow them can comment and mirror their publications. This not only helps creators manage their online presence more effectively, but it also helps to foster a more engaged and interactive community around their content.

2.1 Comments

Comments are a crucial part of the Lens Protocol's interactive and engaging community. They allow users to provide additional commentary on other publications, sparking conversations and debates that can help to bring the community together.

Comments here can be treated the same as the base publications, but with extra checks and features. Just like regular publications, comments live in the user's Profile NFT and are therefore wholly owned by the user.

However, since comments reference other publications, they are subject to the original publication's Reference Module conditions 🧐. For example, if a publication has a Reference Module that limits the comments only to their limited special edition NFT holders, then others won't be able to comment on their posts.

And just like regular publications, comments too have Collect and Reference Modules about which I discussed earlier.

2.2 Mirrors

Mirrors in the Lens Protocol are like re-tweets on Twitter πŸ”„. They enable users to repost existing content and share it with their own followers. Mirrors are treated the same as regular publications, but with a few minor changes.

Since mirrors only repost existing content, they do not have a ContentURI field and therefore cannot be collected, nor do they have a Collect Module of their own. However, mirrors can have their own Reference Module, which can define what accounts will be able to mirror or comment on the mirror.

It's important to note that since mirrors reference other publications, they too are subject to the conditions of the original publication's Reference Module similar to comments.

3. Follow

"Following" on the Lens Protocol is not your typical social media follow. It comes with it's unique features that set it apart from traditional social media. When you follow a profile on the Lens Protocol, you are given a Follow NFT, which can have additional value encoded by creators and communities.

The Follow Module attached to each Profile NFT is what determines whether a user attempting to follow the profile should receive a Follow NFT or not. This means that profiles can have specific follow logic, such as requiring users to pay a certain amount to receive a Follow NFT.

These NFTs are mapped by unique IDs, which increment by 1 for each new Follow NFT issued for a given profile. This means that the first follower's NFT has an ID of 1, the tenth has an ID of 10, and so on. Creators can leverage this to release exclusive content to their first 10,000 followers, for instance.

This innovative feature adds another layer of value to "following" on the Lens Protocol, making it more than just a simple follow.

How does Lens Protocol works under the hood?

Under the hood, the Lens Protocol is a collection of smart contracts deployed on the Polygon blockchain. While it's possible to interact directly with the smart contracts to read and write data, doing so can be complicated when dealing with relational data, such as fetching all the addresses that follow a particular profile. To make querying this data easier, the Lens team maintains its own database off-chain alongside these smart contracts that are present on the blockchain. This off-chain stack indexes all the events related to smart contract activities, making it possible to perform queries that would otherwise be difficult or impossible on the blockchain alone.

To read data from the Lens Protocol, developers can use a GraphQL API to query the Lens database directly, enabling them to retrieve the information they need in a more streamlined way. When writing data to the protocol, however, applications must interact directly with the smart contracts on the blockchain. This approach allows for more efficient querying and indexing of the relational data while still maintaining the security and transparency of a decentralized blockchain platform.

For developers who want to learn more about the technical details of the Lens Protocol, the official documentation provides a wealth of information on the inner workings of the system.

Conclusion

In conclusion, the Lens Protocol is a blockchain-based social media platform that offers a decentralized and user-owned alternative to traditional Web2 social applications. It offers unique features such as Collect and Reference Modules for publications, comments, and mirrors, as well as a Follow Module for profiles. These modules allow for greater control over who can access and interact with a user's content, making it an ideal platform for creators and communities looking to monetize their content and build engaged communities.

Moreover, Lens Protocol's architecture, which combines smart contracts on the Polygon blockchain and their own internal indexer, offers a scalable and efficient solution for handling relational data in a decentralized social media setting. While the Lens Protocol is still in its early stage, it has the potential to become a significant player in the growing blockchain-based social media landscape and is definitely worth looking out for.

Want to explore more?

  1. Apps build on top of Lens Protocol: Lens Protocol

  2. Get started building with Lens Protocol: Lens Protocol

  3. Guild to build a full stack application with Lens Protocol: Developer Quickstart (lens.xyz)

  4. Nader Dabit 's video on introduction to Lens Protocol: https://youtu.be/M_CeggIzrzw

  5. Jarrod Watts 's video to build a Web3 social media app using Lens Protocol: https://youtu.be/e1mPmDRUUBc

  6. Follow me😎 if you ever mint your own profile on lens protocol.

And, Thanks for Reading!πŸ˜„

Thank you for reading till the end! I hope that this blog has provided you with a better understanding of how this decentralized social media platform works and its potential for revolutionizing the way we interact with social media. If you have any questions or comments, please feel free to reach out to me.

Β