在区块链中,每个块包含了一定数量的交易信息和该块的唯一标识符,同时还包含了前一个块的哈希值。这样的设计保证了区块之间的顺序和完整性,一旦一个块被添加到区块链中,它就不可更改。This makes blockchain a secure and trustworthy distributed ledger that can be used to record and verify various types of transactions.
从逻辑表现的角度去看互联网发展,信息技术和数字化发展的逻辑从Web1.0到Web3.0有哪些变化呢?Web1.0的入口体现为网页浏览器,解决的核心问题是信息聚集、搜索和分发问题,逻辑处理主要是在门户网站上,数据存储在服务器上。到了Web2.0呢?Web2.0入口表现为APP应用,基于各平台的封闭协议处理内容的分发,逻辑处理主要在各大平台上,数据存储主要是在云服务器上。而Web3.0表现为各种形式的DAPP应用,逻辑处理是基于一种公开规则和分布式组织定义的协议标准,数据的处理和存储是在分布式开放协议上。
Digital Collection:
It refers to the use of blockchain technology to generate unique digital credentials for specific works and artworks,while protecting their digital copyright,to achieve authentic and trustworthy digital distribution,purchase,collection,and use.
contract MyNFT{
mapping(address=>mapping(address=>uint256))allowed;
function approve(address _to,uint256 _tokenId){
require(msg.sender==ownerOf(_tokenId));
require(msg.sender!=_to);
allowed[msg.sender][_to]=_tokenId;
Approval(msg.sender,_to,_tokenId);
}
}
contract MyNFT{
function takeOwnership(uint256_tokenId){
require(tokenExists[_tokenId]);
address oldOwner=ownerOf(_tokenId);
address newOwner=msg.sender;
require(newOwner!=oldOwner);
require(allowed[oldOwner][newOwner]==_tokenId);
balances[oldOwner]-=1;
tokenOwners[_tokenId]=newOwner;
balances[oldOwner]+=1;
Transfer(oldOwner,newOwner,_tokenId);
}
}
contract MyNFT{
mapping(address=>mapping(uint256=>uint256))private ownerTokens;
function removeFromTokenList(address owner,uint256 _tokenId)private{
for(uint256 i=0;ownerTokens[owner]<i>!=_tokenId;i++){
ownerTokens[owner]<i>=0;
}
}
function transfer(address _to,uint256 _tokenId){
address currentOwner=msg.sender;
address newOwner=_to;
require(tokenExists[_tokenId]);
require(currentOwner==ownerOf(_tokenId));
require(currentOwner!=newOwner);
require(newOwner!=address(0));
removeFromTokenList(_tokenId);
balances[oldOwner]-=1;
tokenOwners[_tokenId]=newOwner;
balances[newOwner]+=1;
Transfer(oldOwner,newOwner,_tokenId);
}
}