flask-vialOnchain Lab

The programmable onchain identity that owns, controls, and extends everything in a research project

What is a Lab?

An Onchain Lab is the core primitive of Molecule Protocol V3. It is an NFT (ERC-721) that is permanently bound to its own smart contract wallet (ERC-6551), enhanced with account abstraction (ERC-4337), and extensible through a modular plugin architecture (ERC-7579) secured by an onchain attestation registry (ERC-7484).

Together, these standards give each Lab its own persistent onchain identity, a fully functional wallet capable of holding any onchain asset, a frictionless user experience that abstracts away gas and key management, and the ability to gain new capabilities over time through installable modules.

When a user creates a Lab, they mint a LabNFT that automatically receives its own smart contract account. This account can own assets, sign transactions, and interact with other protocols β€” independent of whoever currently holds the LabNFT. Transferring the NFT transfers control of the account and everything inside it in a single transaction.

The Standards

An Onchain Lab converges five Ethereum standards into a single primitive.

ERC-721 makes the Lab a tradable, transferable NFT compatible with the entire NFT ecosystem β€” marketplaces, wallets, and any contract that understands the ERC-721 interface. The LabNFT is implemented using ERC-721A for gas-efficient minting.

ERC-6551 gives the NFT its own smart contract wallet, known as a Token Bound Account. The wallet has no private key of its own β€” it derives its authority entirely from the current NFT owner. The account address is deterministic, computed from the chain ID, the NFT contract address, the token ID, and a salt. This means the address is known before deployment and is consistent across any chain where the ERC-6551 Registry is deployed.

ERC-4337 introduces account abstraction, enabling gasless transactions through paymasters, transaction batching (multiple actions in a single signature), and a validation pipeline that decouples signature verification from execution. Users interact with Labs by signing intents offchain; the protocol handles gas, relay, and execution.

ERC-7579 defines a modular account interface. Labs can install executor modules (which perform actions on behalf of the Lab) and fallback modules (which extend the Lab with new function selectors) without changing the core contract. This means Labs can gain new capabilities β€” licensing logic, governance, oracle integrations, automated royalty distribution β€” through modules developed by Molecule or third-party developers.

ERC-7484 secures the module system through an onchain attestation registry. Before any module can be installed on a Lab, it must be attested by a trusted Molecule attestor. This prevents malicious or unaudited code from being installed while keeping the module ecosystem permissionless for development.

Identity & Ownership

A Lab maintains two distinct concepts that are often conflated in traditional systems: a persistent identity and a transferable controller.

The Lab's identity is its Token Bound Account address. This address is permanent and deterministic β€” it is derived from the LabNFT's contract address and token ID at deploy time and never changes, regardless of who owns the Lab. Reputation, transaction history, data provenance, and onchain relationships all accrue to this address permanently.

The Lab's controller is the wallet currently holding the LabNFT. This can change through sales, transfers, or marketplace transactions. When it does, the new holder immediately gains full control of the Lab account β€” the account's owner() function dynamically resolves the current NFT holder on every call. No migration, no re-keying, no governance vote.

This separation is what makes Labs composable. A Lab can be sold on a marketplace and the buyer receives not just an NFT, but the entire project: its treasury, its data references, its IP-NFTs, its transaction history, and its onchain reputation. The identity persists; only the controller changes.

What Labs Own

Asset Type
Description

IP-NFTs

Onchain representation of intellectual property rights

IP Tokens

Fungible tokens created from tokenizing IP-NFTs

Treasury

ETH, stablecoins, or any ERC-20 tokens

Data References

CIDs pointing to encrypted research data stored off-chain

Child Labs

Nested Labs for hierarchical research programs

Licenses

Rentable NFTs (ERC-4907) for time-bound IP access

External Assets

Any ERC-20/721/1155 from the broader ecosystem

Because the Token Bound Account is a general-purpose smart contract wallet, a Lab can hold any asset that any Ethereum account can hold. The asset types listed above represent the assets that are semantically meaningful within the Molecule ecosystem, but the wallet is not limited to these.

Module Registry

Labs extend functionality through installable modules, governed by the ERC-7579 modular account standard and secured by the ERC-7484 attestation registry.

Modules come in two types. Executor modules can initiate transactions from the Lab account β€” they call into the Lab to execute actions on its behalf. This is the mechanism by which third-party logic (automated royalty distribution, milestone-based fund release, governance voting) can operate on a Lab without requiring the owner to manually trigger each action. Fallback modules extend the Lab's interface by registering new function selectors, allowing the Lab to respond to function calls it does not natively support.

All modules must be attested by a trusted Molecule attestor in the ERC-7484 registry before they can be installed. This creates a permissionless development model with a security gate: anyone can build a module, but it must pass attestation before any Lab can use it. Module installation requires a valid UserOperation through the ERC-4337 EntryPoint, meaning only the Lab's owner can authorize the installation.

Role-Based Access Control

The modular architecture enables Labs to support delegated permissions without transferring ownership. Lab owners can authorize scoped, expiring access β€” for example, allowing a collaborator to upload data to the data room, or an AI agent to decrypt specific files for the duration of a research session β€” without surrendering the LabNFT or treasury control.

Delegated access is enforced on-chain by the AccessResolver contract, which implements a hierarchical role system per-lab: Owner (the LabNFT holder, resolved through the ERC-6551 TBA), Contributor (full data-room access, can manage Viewers), and Viewer (read-only). Each grant carries an optional expiry and an isAgent flag to distinguish AI-agent session keys from human collaborators. The core Lab contract itself still only recognises the NFT owner and the ERC-4337 EntryPoint β€” roles are layered on top and consulted by the GraphQL API, encryption layer, and UI.

See Roles & Permissions for the capability matrix, grant semantics, and the on-chain interface.

Onchain Activity Log

Every transaction executed through a Lab creates a permanent, timestamped onchain record. Because all execution flows through the Token Bound Account, the Lab's transaction history forms a complete audit trail of its lifecycle.

Event
What's Recorded

Data upload

Timestamp, uploader, data reference, version

Funding received

Source address, amount, token type

IP-NFT minted

Metadata, linked data, ownership

License issued

Licensee, duration, terms, payment

Treasury transaction

Recipient, amount, purpose

Role change

Address, role granted/revoked, timestamp

This creates a verifiable chain of custody for the entire research lifecycle. Reputation accrues to the Lab's permanent address, not to a CV, not to an institution. When collaborators or funders evaluate a project, the evidence is cryptographic and publicly auditable.

Lab Tokenization (Coming soon)

Labs will be able to affiliate with or mint a Group Token to create an economic layer around the Lab's assets. The planned model allows Lab owners to select or mint an ERC-20 token, attach a fee router to direct revenue from the Lab's assets (IP licensing royalties, dataset access payments, trading fees, DeFi yield), enable staking for token holders to receive a share of fee flows, and optionally configure automatic token buybacks from revenue.

*This feature is part of the V3 roadmap and is not yet available in the current protocol deployment.

Last updated