Tokenized Content System Development
Tokenized content—model where creators issue their work as tokens (NFT or fungible), and readers/viewers gain financial stake in the content's success. This goes beyond simple "buy NFT" to dynamic economy around content.
Content Tokenization Models
Collect NFT (Lens Protocol Model)
Each publication = unique NFT that can be collected (bought). Creator sets limit (e.g., only 100 copies) and price. Early buyers get early supporter status and potential upside on resale.
Fractional Content Ownership
Content (article, music track, video) represented as NFT, right to share of revenue divided into ERC-20 fractions. Buying tokens—get share of royalties.
Bonding Curve Tokens
Each content has own token on bonding curve. More people buying—more expensive. Early buyers win from growth.
Subscription Tokens (Creator Coins)
Token giving access to creator's content for period (month, year). ERC-20 with expire logic or NFT with time attributes.
Smart Contract: Collect with Royalties
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/interfaces/IERC2981.sol";
contract TokenizedContent is ERC721, IERC2981 {
struct ContentItem {
address creator;
string contentURI; // IPFS CID
uint256 price; // in wei
uint256 maxSupply; // 0 = unlimited
uint256 currentSupply;
uint256 royaltyPercent; // basis points
bool paywalled; // requires collect to view
ContentType contentType;
}
enum ContentType { ARTICLE, IMAGE, VIDEO, MUSIC, EBOOK, NEWSLETTER }
mapping(uint256 => ContentItem) public contentItems;
mapping(uint256 => mapping(address => bool)) public hasCollected;
uint256 public platformFee = 250; // 2.5%
address public platform;
// Create content with monetization parameters
function publishContent(
string calldata contentURI,
uint256 price,
uint256 maxSupply,
uint256 royaltyPercent,
bool paywalled,
ContentType contentType
) external returns (uint256 contentId) {
require(royaltyPercent <= 2000, "Royalty too high"); // max 20%
contentId = ++_contentCounter;
contentItems[contentId] = ContentItem({
creator: msg.sender,
contentURI: contentURI,
price: price,
maxSupply: maxSupply,
currentSupply: 0,
royaltyPercent: royaltyPercent,
paywalled: paywalled,
contentType: contentType,
});
emit ContentPublished(contentId, msg.sender, contentURI, price, contentType);
}
// Collect (buy) content
function collect(uint256 contentId) external payable returns (uint256 tokenId) {
ContentItem storage item = contentItems[contentId];
require(item.creator != address(0), "Content not found");
require(msg.value == item.price, "Wrong price");
require(
item.maxSupply == 0 || item.currentSupply < item.maxSupply,
"Max supply reached"
);
item.currentSupply++;
// Payment distribution
uint256 fee = (msg.value * platformFee) / 10000;
uint256 creatorProceeds = msg.value - fee;
payable(platform).transfer(fee);
payable(item.creator).transfer(creatorProceeds);
// Mint collect token NFT
tokenId = ++_tokenCounter;
_mint(msg.sender, tokenId);
hasCollected[contentId][msg.sender] = true;
// Map tokenId → contentId
tokenToContent[tokenId] = contentId;
emit Collected(contentId, tokenId, msg.sender, msg.value);
}
// ERC-2981 royalties for secondary market
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external view override returns (address receiver, uint256 royaltyAmount)
{
uint256 contentId = tokenToContent[tokenId];
ContentItem storage item = contentItems[contentId];
receiver = item.creator;
royaltyAmount = (salePrice * item.royaltyPercent) / 10000;
}
// Access to paywalled content
function canAccessContent(uint256 contentId, address user)
external view returns (bool)
{
ContentItem storage item = contentItems[contentId];
if (!item.paywalled) return true;
if (item.creator == user) return true;
if (hasCollected[contentId][user]) return true;
return false;
}
}
Bonding Curve for Creator Coins
contract CreatorCoin is ERC20 {
// Bonding curve: price = reserveRatio * totalSupply / reserveBalance
uint256 public reserveBalance;
uint256 public reserveRatio = 500000; // 50% (in ppm, 1_000_000 = 100%)
address public creator;
uint256 public creatorFee = 500; // 5%
function buy(uint256 minReturn) external payable returns (uint256 tokensReturned) {
tokensReturned = calculatePurchaseReturn(
totalSupply(),
reserveBalance,
uint32(reserveRatio),
msg.value
);
require(tokensReturned >= minReturn, "Slippage exceeded");
uint256 fee = (msg.value * creatorFee) / 10000;
reserveBalance += msg.value - fee;
payable(creator).transfer(fee);
_mint(msg.sender, tokensReturned);
emit Buy(msg.sender, msg.value, tokensReturned);
}
function sell(uint256 amount, uint256 minReturn) external returns (uint256 ethReturned) {
ethReturned = calculateSaleReturn(
totalSupply(),
reserveBalance,
uint32(reserveRatio),
amount
);
require(ethReturned >= minReturn, "Slippage exceeded");
_burn(msg.sender, amount);
reserveBalance -= ethReturned;
payable(msg.sender).transfer(ethReturned);
emit Sell(msg.sender, amount, ethReturned);
}
}
Token Gating Content
// Backend: check content access
async function checkContentAccess(
userAddress: string,
contentId: string
): Promise<{ hasAccess: boolean; reason?: string }> {
const content = await db.getContent(contentId);
if (!content.isTokenGated) return { hasAccess: true };
// Check NFT ownership
if (content.requiredNFT) {
const balance = await nftContract.balanceOf(userAddress);
if (balance > 0n) return { hasAccess: true };
}
// Check creator coin holdings
if (content.requiredCreatorCoinAmount) {
const coinBalance = await creatorCoinContract.balanceOf(userAddress);
if (coinBalance >= content.requiredCreatorCoinAmount) {
return { hasAccess: true };
}
return {
hasAccess: false,
reason: `Hold ${formatUnits(content.requiredCreatorCoinAmount, 18)} $CREATOR to access`,
};
}
// Check collect
const hasCollected = await contentContract.hasCollected(contentId, userAddress);
if (hasCollected) return { hasAccess: true };
return { hasAccess: false, reason: "Collect to access" };
}
Analytics for Creators
interface CreatorDashboard {
totalEarned: bigint; // total earned
totalCollects: number; // how many times collected
uniqueCollectors: number; // unique collectors
topContent: Array<{
contentId: string;
title: string;
collects: number;
earned: bigint;
}>;
revenueByDay: Array<{ date: string; revenue: bigint }>;
secondarySalesRoyalties: bigint; // income from secondary sales
}
Development of basic tokenized content system (collect + paywall + creator dashboard)—5-7 weeks. Bonding curve creator coins add 3-4 weeks.







