Migrating the Lens Ecosystem to Lens Chain
Learn about the migration process.


In May, we announced that we were building a new high performance network. And in November, we revealed the big upgrade from Lens V2 to V3: modular, flexible and customizable social legos that allow for endless possibilities, allowing developers and users to connect, distribute, and discover.
Currently, there are 647,000 Profiles and 640,000 Handles on Lens v2. 45,000 users interact weekly with the protocol, and have created 31 million publications. For the transition from Lens V2 on Polygon to Lens V3 on Lens Chain, built on ZKSync stack and Avail, it was decided to migrate Profiles, Handles and Content, seamlessly and without user intervention.
The Lens team has developed a solution for migrating profiles, managers, connections, and content from Lens V2 on Polygon to Lens V3 and Lens Chain. This extensive migration presented unique challenges, as Lens Protocol's fundamental principle is that users maintain ownership of their digital identity, content, and social graph. Preserving this core value while executing such a comprehensive transition required innovative technical solutions.
The Technical Journey of Migrating Lens Protocol

The migration of Lens Protocol presented a significant technical challenge. Over the past years, our community of users and applications has created a rich ecosystem of identities, connections, and content. Preserving this digital heritage while transitioning to Lens Chain was paramount.
The challenge was unprecedented - existing tools were inadequate for migrating data between blockchains at this scale. While other teams had attempted similar migrations, none had successfully executed a project of this magnitude.
To address this, we developed a migration solution in Rust. This robust tool successfully transferred all existing data from Polygon to Lens Chain, maintaining the integrity of user identities, social connections, and content history. Looking ahead, we've designed this migration framework to be adaptable, potentially serving other projects seeking to transition to Lens Chain.
Building on this success, we plan to refine our migration tool further, creating a standardized solution to support future projects from any EVM network joining the Lens Chain ecosystem.
The migration of Lens Protocol to Lens Chain required technical coordination, particularly with Matter Labs (the team behind ZKsync and the Elastic Network), to handle the massive scale of data transfer. The primary challenge was managing 125GB of storage logs during chain genesis, which required Matter Labs to enhance their node capabilities.
Infrastructure Development
We established a local Matter Labs node on high-capacity infrastructure to process storage logs through verified contract calls. Rather than directly inserting data into the database, we prioritized security by ensuring all transactions passed through audited contract code and node infrastructure.
Strategic Implementation
Our approach began with making the contracts upgradeable and creating dedicated migration contracts for each component. This lightweight method focused on core storage, incorporating verification checks to prevent duplicate migrations. To address the challenge of event emitting missing at genesis, we collaborated with Matter Labs to develop an assembly contract that could recreate historical events once the mainnet chain is created. We enhanced protocol flexibility by implementing "extraData" key values, enabling efficient legacy ID lookups during indexing.
Optimization for Scale
The initial migration attempt using a single private key would have required 100 days to complete. To optimize this process, we:
- Distributed processing across multiple private keys (one per 10,000 accounts)
- Implemented multi-threading for concurrent processing
- Utilized local nonce computation for efficient transaction queuing
- Employed multicall functionality to batch actions
- Managed calldata size to prevent bootloader issues
- Controlled concurrency management through semaphore implementation
Data Synchronization
Our existing Polygon indexers provided a robust foundation for data extraction. The migration system connected to these databases, synchronizing data to the Lens local node while maintaining precise block number snapshots to prevent duplications.
Verification and Security
The migration process included comprehensive verification steps:
- Concurrent storage log verification using the multicall functionality
- Checking of getter methods against migration targets
- Controlled node concurrency management through semaphore implementation
Timeline and Completion
The complete migration process took five days, culminating in a database snapshot at block 67,391,819. Matter Labs conducted a week-long security review of the storage logs.
Once the mainnet chain is created the system will continue to synchronize data daily between Polygon and the new chain during the two-week governance vote period, ensuring data consistency until the official launch of Lens V3 and Lens Chain.
This migration framework demonstrates the importance of parallel processing for non-dependent data and establishes a foundation for future blockchain migration projects.
Lens Protocol V3 Migration: Data Transfer Overview
The transition from Lens V2 to V3 involved a comprehensive data migration across multiple protocol components. Here's a detailed breakdown of the migration scope and process:
Account System Migration
The transformation of Profiles to Accounts marked a fundamental shift from NFT-based profiles to smart wallet architecture. We successfully migrated 650,000 profiles, ownership transfer process based will occur on go live for the original owner type:
- EOA owners received direct ownership transfer
- Safe-owned profiles received new Safe deployments with identical signer configurations as long as all signers are EOAs
- Contract-owned profiles remained under temporary protocol custody, with a claim mechanism through the Lens API
Manager and Metadata Transfer
We transferred 590,000 profile managers to the new account manager system, if the account manager was an EOA it would be migrated and if signless was enabled a new 1 for 1 dispatcher was assigned to the account. The migration also included 400,000 profile metadata entries, preserving user identities and profile information.
Usernames
The migration of 650,000 handles to the new username system maintained user identities while implementing improved namespace management. All previously linked handles were automatically associated with their respective accounts.
Apps
The transition marked a significant architectural shift for applications, moving from off-chain metadata to on-chain primitives. We successfully migrated 360 applications to this new framework, enhancing their autonomy and functionality.
Social Graph Migration
We preserved the social graph of the platform by migrating 28,000,000 follow connections to the new global graph system, maintaining user relationships and network effects.
Content Migration
The content migration followed a structured approach:
- Primary Posts: 12,000,000 root posts migrated
- Nested Comments: Implemented a four-tier depth migration
- First level: 4,000,000 comments
- Second level: 600,000 comments
- Third level: 100,000 comments
- Fourth level: 40,000 comments
- Quote Posts: 310,000 root quotes with 155,000 first-level comments
- Mirrors were excluded due to relevance and volume consideration
Collects / Actions
We decided not to migrate collects and actions, preserving their value proposition on the Polygon network. The new system allows users to re-enable these features as needed.
Engagement Data
Additional engagement data, including reactions and reporting information, will be migrated and made available through public BigQuery access.
Elastic Network Governance Process
The deployment of Lens Chain, with its significant state changes at genesis, requires approval through ZKsync's governance framework. This critical step ensures transparency and community validation of the migration process.
The governance vote will span a two-week period, during which our migration infrastructure will remain active. This ongoing synchronization ensures that all user data—including profiles, connections, and content—stays current with the existing protocol until the official launch of Lens V3.
This approach demonstrates our commitment to maintaining data integrity throughout the transition while adhering to proper governance procedures. By continuously updating state during the voting period, we ensure that the eventual launch will reflect the most current user activity, minimizing any disruption to the Lens ecosystem.
The implementation of this governance process, combined with our active data synchronization, represents a methodical approach to launching Lens Chain while maintaining the trust and engagement of our user community.
Transition to Lens V3: A Seamless Migration Process
During the transition period, users will maintain full access to their Lens accounts on Polygon until the official mainnet launch date. To ensure a smooth migration, we have designed a maintenance window during which we will implement the final transition steps.
Maintenance Period Protocol
During this scheduled maintenance, we will temporarily pause API access and write actions to prevent any potential data loss. This precautionary measure ensures that all user activity is properly captured and transferred. We are coordinating with application developers to implement appropriate maintenance notifications across the ecosystem.
Final Migration Steps
The maintenance period will facilitate two critical processes:
- The execution of final data synchronization
- The transfer of accounts to their rightful owners
Post-Migration Access
Upon completion of the maintenance period, users will gain immediate access to their accounts on Lens Chain. All major applications in the ecosystem—including Orb, Hey, Tape, and Soclly—will be ready to support the enhanced functionality of Lens V3, alongside some new apps.
User Experience
We have prioritized user convenience throughout this transition. The migration requires no action or financial investment from users. The process has been designed to be entirely seamless—users will simply experience an upgraded, more efficient Lens Protocol, offering improved speed and enhanced usability.
Application Migration: a Coordinated Transition
The Lens team has established a migration framework in collaboration with established applications such as Hey, Orb, Tape, and Soclly. This coordinated effort ensures that these platforms will be fully operational on Lens Chain from launch day, providing users with immediate access to the enhanced capabilities of V3.
Sunsetting Lens V2: Transition to Lens Chain
As we approach the launch of Lens Chain and Lens V3, we are implementing a structured transition plan to ensure clarity and continuity for our community.
Transition Timeline
Effective from the mainnet launch date, we will initiate the sunset phase for Lens V2 on both Polygon and Momoka. This strategic decision includes the immediate cessation of post sponsorship programs and the reduction of Momoka rate limits to zero.
Rationale for Immediate Transition
The immediate transition is essential to maintain data consistency and user experience. As Lens V3 represents a distinct fork of the protocol, allowing continued activity on V2 could lead to data fragmentation and user confusion. Our priority is to ensure users engage with the actively maintained protocol version that offers enhanced functionality and support.
Developer Support
We recognize this transition requires coordination with our development community. Application developers who have not yet initiated their migration process are encouraged to contact our technical team through our dedicated Telegram channel for comprehensive migration support and guidance.
Technical Best Practices for Large-Scale Blockchain Migration
The successful Lens V2 on Polygon to Lens V3 on Lens Chain migration process represents a milestone for the blockchain industry. Below you will find several best practices that were learned and implemented along the process.
Transaction Management
For optimal performance in blockchain migrations, implement batch transactions through multicall functionality. This approach not only streamlines transaction processing but also enhances data retrieval efficiency. Rust's type safety features and concurrent processing capabilities make it an ideal language choice for such migrations, significantly reducing execution time and potential errors.
Infrastructure Optimization
Transaction throughput can be maximized by implementing sharded key management and local nonce tracking. This eliminates bottlenecks caused by node response delays. However, it's crucial to implement rate limiting through mechanisms like semaphores to prevent node overload and ensure system stability.
Operational Reliability
Successful migration requires robust infrastructure and careful progress tracking. Deploy the migration system on dedicated, high-capacity servers with continuous uptime and adequate storage. Implement regular database status updates to maintain checkpoints, enabling seamless recovery in case of interruptions.
Data Management Strategy
Having well-indexed source data in an organized structure significantly streamlines the migration process. Consider implementing a staging approach by writing migration data to intermediate tables, reducing the impact of complex queries on system performance. Process data in smaller, more frequent batches rather than large chunks to improve overall throughput.
Smart Contract Security
Protect against state inconsistencies by implementing migration contracts with sequence IDs for transaction validation. This prevents duplicate state updates and provides a safety mechanism for handling interrupted or repeated migrations. Utilize block number tracking to maintain precise migration boundaries and ensure data consistency.
Database Implementation
Leverage high-performance database systems like PostgreSQL with binary insertion capabilities for reliable data storage. This approach offers much better reliability compared to disk-based storage solutions while maintaining data integrity throughout the migration process.
A Technical Milestone
The migration of Lens Protocol from V2 to Lens Chain represents one of the most significant technical transitions. This comprehensive data transfer encompassed over two years of user activity and community engagement, requiring meticulous planning and execution to maintain data integrity throughout the process.
Scale of Migration

The migration successfully transferred 125GB of smart contract storage logs, encompassing:
- 650,000 user accounts with their associated digital identities
- 650,000 unique usernames maintaining user recognition across the platform
- 28 million follower connections preserving the social graph
- 360 applications ensuring ecosystem continuity
- 16 million posts containing user-generated content
Beyond the core protocol data, the migration also included the transfer of 50 million user reactions, preserving the engagement metrics and social interactions.
Looking Ahead
Upon mainnet launch, Lens users will be able to open their favorite apps, interact with content, and manage their accounts effortlessly, all on the new Lens Chain. Lens is proud to have successfully completed the migration from Lens V2 on Polygon to Lens V3 on the Lens Chain, and would like to thank the ZKsync team for the joint effort. The robust tooling developed for this migration will be open-sourced, allowing other development teams to leverage it. This migration process not only sets a new standard for seamless transitions—eliminating the need for user actions or crypto spending—but also raises the bar for onchain innovation.