链上身份与内容创作:DID的创作者经济
在互联网时代,创作者的身份由平台定义。你在YouTube上是一个账号,在Twitter上是一个ID,在Instagram上是一个标签。但你的"真实身份"——属于你自己的数字身份——却分散在多个平台之间。去中心化身份(DID)正在改变这一切,让创作者真正掌控自己的数字身份和声誉。
第一幕:身份的平台困境
在传统互联网中,内容创作者的身份被碎片化在多个平台之间。你在YouTube上有10万粉丝,但在Instagram上只有1000个粉丝。你的内容、你的声誉、你的收入——都依赖于你使用的平台。
这种"平台依赖"在电影制作中也有对应——在好莱坞体系下,导演、演员、编剧的身份由制片厂定义。一个导演被称为"派拉蒙的导演"或"华纳的导演",而不是"自己的导演"。
DID(去中心化身份)正在改变这一切。DID是一个基于区块链的数字身份系统,它允许创建者创建和管理自己的数字身份,而不需要依赖任何中心化平台。
2026年,DID的采用率已经显著增长。据Ceramic Network的数据,全球已有超过5000万个DID被创建,其中约30%用于内容创作领域。
第二幕:DID与创作者声誉
在传统平台中,创作者的声誉是通过平台内部的评分系统来衡量的。在YouTube,是订阅数和播放量;在Twitter,是粉丝数和互动率。但这些声誉指标无法跨平台传输。
DID通过链上声誉系统解决了这个问题。创作者的声誉被记录在区块链上,可以跨平台传输。你可以在一个平台上建立声誉,然后在另一个平台上使用它。
2026年,多个去中心化内容平台已经开始使用DID作为核心身份系统。在Mirror.xyz上,创作者使用DID管理他们的内容,并建立链上声誉。在Lens Protocol上,用户的社交图谱被记录在链上,可以跨应用使用。
第三幕:DID与内容版权
DID不仅是一个身份系统,它还可以与版权管理结合。当一个创作者使用DID注册内容时,内容的版权信息被自动记录在链上,与创作者的身份绑定。
2026年,多个内容平台使用DID进行版权管理。在Audius上,音乐人使用DID管理他们的音乐版权;在Zora上,艺术家使用DID管理他们的NFT版权。
第四幕:Solidity —— DID注册合约
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
/**
* @title DID注册合约
* @notice 去中心化身份注册和管理
*/
contract DIDRegistry {
struct DIDDocument {
address subject;
bytes32 id;
string publicKey;
string serviceEndpoint;
uint256 created;
uint256 updated;
bool active;
string[] contexts;
string[] alsoKnownAs;
}
struct Delegation {
address delegate;
bytes32[] permissions;
uint256 expiry;
bool active;
}
mapping(bytes32 => DIDDocument) public documents;
mapping(address => bytes32) public addressToDID;
mapping(bytes32 => Delegation[]) public delegations;
bytes32 public constant DID_METHOD = keccak256("did:ethr:");
event DIDCreated(bytes32 indexed did, address indexed subject);
event DIDUpdated(bytes32 indexed did);
event DIDDeactivated(bytes32 indexed did);
event DelegationAdded(bytes32 indexed did, address delegate);
/**
* @notice 创建DID
*/
function createDID(
string memory publicKey,
string memory serviceEndpoint
) external returns (bytes32) {
require(addressToDID[msg.sender] == bytes32(0), "DID exists");
bytes32 did = keccak256(abi.encodePacked(DID_METHOD, msg.sender));
documents[did] = DIDDocument({
subject: msg.sender,
id: did,
publicKey: publicKey,
serviceEndpoint: serviceEndpoint,
created: block.timestamp,
updated: block.timestamp,
active: true,
contexts: new string[](0),
alsoKnownAs: new string[](0)
});
addressToDID[msg.sender] = did;
emit DIDCreated(did, msg.sender);
return did;
}
/**
* @notice 更新DID文档
*/
function updateDIDDocument(
string memory publicKey,
string memory serviceEndpoint
) external {
bytes32 did = addressToDID[msg.sender];
require(did != bytes32(0), "DID not found");
require(documents[did].active, "DID inactive");
DIDDocument storage doc = documents[did];
doc.publicKey = publicKey;
doc.serviceEndpoint = serviceEndpoint;
doc.updated = block.timestamp;
emit DIDUpdated(did);
}
/**
* @notice 添加委托
*/
function addDelegation(address delegate, bytes32[] memory permissions, uint256 expiry) external {
bytes32 did = addressToDID[msg.sender];
require(did != bytes32(0), "DID not found");
delegations[did].push(Delegation({
delegate: delegate,
permissions: permissions,
expiry: expiry,
active: true
}));
emit DelegationAdded(did, delegate);
}
/**
* @notice 解析DID
*/
function resolveDID(bytes32 did) external view returns (DIDDocument memory) {
require(documents[did].active, "DID not found");
return documents[did];
}
/**
* @notice 验证签名者身份
*/
function verifySigner(bytes32 did, bytes32 message, bytes memory signature)
external view returns (bool) {
DIDDocument storage doc = documents[did];
require(doc.active, "DID not active");
// 签名验证逻辑
return true;
}
}
第五幕:Python —— DID管理工具
from web3 import Web3
from typing import Dict, List, Optional
import json
import hashlib
class DIDManager:
"""去中心化身份管理器"""
def __init__(self, rpc_url: str):
self.w3 = Web3(Web3.HTTPProvider(rpc_url))
self.dids = {}
def create_did(self, address: str, public_key: str) -> Dict:
"""创建DID"""
did = f"did:ethr:{address}"
doc = {
'@context': 'https://www.w3.org/ns/did/v1',
'id': did,
'verificationMethod': [{
'id': f"{did}#keys-1",
'type': 'EcdsaSecp256k1VerificationKey2019',
'controller': did,
'publicKeyHex': public_key
}],
'service': [{
'id': f"{did}#content-endpoint",
'type': 'ContentService',
'serviceEndpoint': f"https://api.creator.com/{address}"
}],
'created': str(self.w3.eth.get_block('latest').timestamp)
}
self.dids[address] = doc
return doc
def verify_did(self, did: str) -> bool:
"""验证DID的有效性"""
return did in [d['id'] for d in self.dids.values()]
def link_content(self, did: str, content_hash: str) -> Dict:
"""将内容链接到DID"""
return {
'did': did,
'content_hash': content_hash,
'timestamp': str(self.w3.eth.get_block('latest').timestamp),
'verified': True
}
def get_creator_profile(self, address: str) -> Dict:
"""获取创作者档案"""
did = self.dids.get(address, {})
return {
'did': did.get('id', ''),
'address': address,
'content_count': 0,
'reputation_score': 0,
'verified': bool(did)
}
manager = DIDManager('https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY')
doc = manager.create_did('0x123...', '0xpubkey...')
print(json.dumps(doc, indent=2))
第六幕:JavaScript —— 前端DID登录
const ethers = require('ethers');
class DIDAuth {
constructor(provider) {
this.provider = provider;
this.signer = null;
}
async connect() {
this.signer = this.provider.getSigner();
return this.signer;
}
async authenticate() {
const address = await this.signer.getAddress();
const message = `Authenticate as creator: ${address}`;
const signature = await this.signer.signMessage(message);
return { address, signature };
}
async createDIDDocument(publicKey) {
const address = await this.signer.getAddress();
return {
'@context': 'https://www.w3.org/ns/did/v1',
id: `did:ethr:${address}`,
verificationMethod: [{
id: `did:ethr:${address}#keys-1`,
type: 'EcdsaSecp256k1VerificationKey2019',
controller: `did:ethr:${address}`,
publicKeyHex: publicKey
}]
};
}
}
const auth = new DIDAuth(new ethers.providers.Web3Provider(window.ethereum));
终场:身份回归创作者
在互联网时代,创作者的身份被平台定义。在Web3时代,创作者的身份属于自己。DID不仅是一个技术标准,更是一种哲学宣言——你的身份、你的内容、你的声誉,都属于你自己。
在这个万物皆可Token化的时代,技术的迭代往往比镜头切换更快。作为北京城市学院2021级广播电视编导的毕业生,我始终在影像与区块链的交汇处寻找共鸣。感谢阅读,我是王森涛,让我们在视听与去中心化的世界里,继续探索。