CN113806817B - Method for constructing twin NFT, NFT protocol and system for full trusted storage - Google Patents

Method for constructing twin NFT, NFT protocol and system for full trusted storage Download PDF

Info

Publication number
CN113806817B
CN113806817B CN202111168545.XA CN202111168545A CN113806817B CN 113806817 B CN113806817 B CN 113806817B CN 202111168545 A CN202111168545 A CN 202111168545A CN 113806817 B CN113806817 B CN 113806817B
Authority
CN
China
Prior art keywords
nft
twin
block chain
contract
original
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111168545.XA
Other languages
Chinese (zh)
Other versions
CN113806817A (en
Inventor
韦继富
焦臻桢
尚德重
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongke Wuyuan Hangzhou Computing Technology Co ltd
Zhongke Computing Technology Innovation Research Institute
Original Assignee
Zhongke Wuyuan Hangzhou Computing Technology Co ltd
Zhongke Computing Technology Innovation Research Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongke Wuyuan Hangzhou Computing Technology Co ltd, Zhongke Computing Technology Innovation Research Institute filed Critical Zhongke Wuyuan Hangzhou Computing Technology Co ltd
Priority to CN202111168545.XA priority Critical patent/CN113806817B/en
Publication of CN113806817A publication Critical patent/CN113806817A/en
Application granted granted Critical
Publication of CN113806817B publication Critical patent/CN113806817B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9566URL specific, e.g. using aliases, detecting broken or misspelled links
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Storage Device Security (AREA)

Abstract

The invention relates to a method for constructing a twin NFT, an NFT protocol of full trusted storage and a system, wherein the method comprises the following steps: deploying a twin intelligence contract on all blockchains that are likely to produce a twin NFT; the twin intelligent contract generates a corresponding contract address; recording the identification of each block chain and the contract address of the twin intelligent contract deployed by the identification through a cross-chain communication module on the block chain; the twin intelligent contract generates a twin NFT request based on the id of the original NFT to be twin on the block chain and the identification of the target block chain; after receiving the twin NFT request, the cross-chain communication module identifies a target block chain corresponding to the twin NFT request and a contract address of a twin intelligent contract corresponding to the target block chain, and sends an http request of the twin NFT to the corresponding twin intelligent contract based on the identified target block chain and the contract address of the twin intelligent contract corresponding to the target block chain; and the twin intelligent contract generates the NFT with the id of the original NFT to be twin on the block chain where the twin NFT is located according to the http request of the twin NFT, and marks a twin mark.

Description

Method for constructing twin NFT, NFT protocol and system for full trusted storage
Technical Field
The invention relates to a method for constructing a twin NFT, an NFT protocol and a system for full-scale trusted storage. The method is suitable for the technical field of block chains.
Background
Due to the characteristics of decentralization and Non-tampering, the block chain technology can provide ownership certification with Non-homogeneous Tokens (NFTs) as a certification type for various digital assets such as digital contents, and store and distribute the digital assets in a distributed mode and the like, and simultaneously ensure the uniqueness and Non-tampering, and due to the characteristics, the NFTs are widely applied to the fields of digital assets and the like. The Ethereum Request for Comment-721(ERC721) standard describes a non-interchangeable corroboration, and most methods of generating NFT are based on the ERC721 standard, however, the current mainstream NFT and ERC721 protocols still fail to solve the following two problems:
(1) NFTs on different blockchains cannot flow through each other. At present, the owner of digital content makes his own work into NFT and releases it on a certain blockchain, but due to the lack of NFT cross-chain mechanism, the NFT cannot be circulated and traded in other blockchain systems. If an issuer wants to issue the digital asset on another blockchain, the NFT can be made only once again in the corresponding blockchain system. This creates two completely independent and unrelated NFTs, which creates a contradiction to the fact that the digital content to which the NFTs themselves correspond should be unique. If an issuer simply wants to promote the same digital content on more blockchain platforms, but does not want to create multiple independent NFTs resulting in a spread of value, the current protocol cannot do so;
(2) storage security and reliability issues for digital content. Each NFT corresponds to a unique digital content, however, most blockchain systems cannot store a full amount of digital content similar to video, i.e. a large file of multimedia type, on the blockchain due to the limitations and high cost of the prior art. Therefore, it is a common practice to chain up the intelligent contract and the certificate corresponding to the NFT protocol, and store the corresponding digital content in a down-link storage manner, such as a centralized website or a distributed storage platform such as IPFS and Sia, and store the data such as the Hash value of the file in the NFT. However, there is a certain risk in doing so, for example, data stored under a chain may be tampered, and a data permanent guarantee mechanism is not set in a distributed storage manner such as IPFS, and therefore, it cannot be guaranteed that the data does not disappear; therefore, even if the NFT still streams on the chain, the digital content corresponding to the NFT is tampered or deleted, i.e. the storage of the content itself is insecure and unreliable.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: in view of the above existing problems, a method for constructing a twin NFT, a full trusted storage NFT protocol and a system are provided.
The technical scheme adopted by the invention is as follows: a method of constructing twin NFTs on different blockchains, characterized by:
a. deploying a twin intelligence contract on all blockchains that are likely to produce a twin NFT;
b. twin intelligent contracts deployed on blockchains generate their corresponding contract addresses;
c. recording the identification of each block chain and the contract address of the twin intelligent contract deployed by the identification through a cross-chain communication module on the block chain;
d. generating a twin NFT request by a twin intelligent contract on a block chain based on the id of an original NFT to be twin on the block chain and the identification of a target block chain, wherein the request comprises the id of the original NFT to be twin and the identification of the target block chain, and the owner account and storage information corresponding to the original NFT to be twin;
e. after receiving the twin NFT request, the cross-chain communication module identifies a target block chain corresponding to the twin NFT request and a contract address of a twin intelligent contract corresponding to the target block chain, and sends an http request of the twin NFT to the corresponding twin intelligent contract based on the identified target block chain and the contract address of the twin intelligent contract corresponding to the target block chain, wherein the request comprises an id of an original NFT to be twin, an owner account and storage information;
f. and the twin intelligent contract generates the NFT with the id of the original NFT to be twin on the block chain where the twin NFT is located according to the http request of the twin NFT, and marks a twin mark.
The cross-chain communication module comprises:
the standard communication interface module is used for establishing communication connection between the block chain and the block chain;
the domain name resolution module is used for resolving and accessing the link address in the NFT storage information;
and the data recording module is used for recording the identification of each block chain and the contract address of the twin intelligent contract deployed by the block chain.
The storage information comprises a link address of a JSON file corresponding to an original NFT to be twin in a block chain;
the JSON file is generated based on the name, content description and link address of the digital content corresponding to the original NFT to be twin.
And the block chain where the original NFT to be twinned is located is an ImSQL block chain, and digital content corresponding to the original NFT to be twinned is stored on the ImSQL block chain.
A NFT transfer transaction method, comprising:
transferring the NFT to be transferred to a new owner account on a blockchain, wherein the NFT to be transferred is a twin NFT constructed according to the method for constructing the twin NFT or is an original NFT in the method for constructing the twin NFT;
after the NFT transfer is completed, generating an http request for the successful NFT transfer, wherein the request comprises the id of the NFT which is successfully transferred and a new owner account;
the cross-chain communication module receives an http request for NFT transfer success, and determines block chain addresses where a corresponding original NFT and all twin NFTs are located and contract addresses of twin intelligent contracts on corresponding block chains according to the ID of the NFT in the request;
the cross-chain communication module sends an http request for changing the NFT owner to the twin intelligent contract according to the block chain address and the contract address of the twin intelligent contract, wherein the request comprises the id of the NFT which is successfully transferred and a new owner account;
and the twin intelligent contract receives the http request for changing the NFT owner, and changes the corresponding NFT owner on the block chain where the twin intelligent contract is located according to the http request for changing the NFT owner.
An NFT protocol that supports trusted storage of a full amount of digital content, comprising:
the ERC721 protocol;
the full data storage protocol comprises a method for generating a JSON file based on the name, content description and link address of digital content, and a method for generating an NFT based on the id of the NFT, an owner account and the link address of the corresponding JSON file;
the NFT cross-chain consistency protocol comprises a method for realizing step d and e twin NFT to other block chains in the method for constructing the twin NFT, a method for realizing step f to generate the twin NFT on the block chains, and a method for changing an NFT owner in the NFT transfer transaction method.
An NFT system supporting trusted storage of a full amount of digital content, characterized by: the system comprises a plurality of block chains, and an ImNFT protocol module for storing the NFT protocol is configured on each block chain.
The plurality of block chains comprise an ImSQL block chain, and the ImSQL block chain is also provided with a cross-chain communication module and a digital content storage module for storing digital content.
The beneficial effects of the invention are: the NFT created on the block chain can be twinned to other block chains, the NFT after twinning is completely consistent with the original NFT right, circulation and transaction of the original NFT can be represented, and the ownership states of all the twin NFTs on different block chain systems can be synchronized after the circulation and transaction are completed, so that the value dispersion risk caused by the conditions of each NFT ownership division, single transaction and the like is avoided.
According to the method, the digital content pointed by the NFT is linked in a manner of combining the ImSQL block chain capable of supporting the mass data full-quantity link storage, so that the digital content full-quantity credible storage is ensured.
Drawings
Fig. 1 is a system architecture diagram of an NFT system supporting full trusted storage of digital content in an embodiment.
Fig. 2 is an architecture diagram of the NFT protocol supporting trusted storage of digital content totals in an embodiment.
FIG. 3 is a block diagram of a cross-chain communication module in an embodiment.
Detailed Description
As shown in fig. 1, this embodiment is an NFT system supporting digital content full-scale trusted storage, and the NFT system has a plurality of different block chains, including an ImSQL block chain (http:// ImSQL. chainccomp. net /), a block chain system a, and a block chain system B, where each block chain is configured with an ImNFT protocol module, and the ImSQL block chain is further configured with a digital content storage module and a cross-chain communication module.
As shown in fig. 2, in this example, the ImNFT protocol module stores an NFT protocol (ImNFT protocol) supporting trusted storage of the digital content gross, and the module is divided into three modules: the first module is the ERC721 standard part, which ensures compatibility by including the ERC721 protocol; the second module is a full data storage protocol, and ensures the chain evidence storage and retrievability of data; the third module is the NFT cross-chain consistency protocol, which ensures that NFTs generated by the ImNFT protocol can be circulated across chains over different blockchains without causing confusion in entitlements.
In this embodiment, the ImNFT protocol standard defines the following interfaces:
(1) returning to the account holding NFT number, this interface belongs to the first module of the protocol:
balanceOf(address _owner)
where owner is the owner account address;
(2) returning the address of the NFT owner, this interface belongs to the first module of the protocol:
ownerOf(uint256 _tokenId)
wherein _ token Id is the id of NFT, the same below;
(3) checking whether the NFT exists, this interface belonging to the first module of the protocol:
exists(uint256 _tokenId)
(4) the granted account has the right to operate the NFT, this interface belongs to the first module of the protocol:
approve(address _to, uint256 _tokenId)
where _ to is the account address
(5) Returning the address authorized by the NFT, this interface belonging to the first module of the protocol:
getApproved(uint256 _tokenId)
(6) authorizing (canceling) the account number to operate all NFTs, wherein the interface belongs to a first module of the protocol:
setApprovalForAll(address _operator, bool _approved)
wherein, the _ operator is an account address, when the _ approved is true, the _ operator is authorized to have all NFT authorities, and when the _ approved is false, all NFT authorities of the _ operator are cancelled;
(7) inquiring authorization, wherein the interface belongs to a first module of the protocol:
isApprovedForAll(address _owner, address _operator)
wherein, the _ owner is the account address of the NFT owner, the _ operator is the account address, if the _ operator is authorized by the _ owner, the value returns true, otherwise, the value returns false;
(8) NFT asset transfer, this interface belongs to the first module of the protocol:
transferFrom(address _from, address _to, uint256 _tokenId)
the NFT can be transferred from _ from account to _ to account;
(9) NFT asset transfer, this interface belongs to the first module of the protocol:
safeTransferFrom(address _from, address _to, uint256 _tokenId)
the NFT can be transferred from _ from account to _ to account;
(10) returning the name of the NFT, this interface belongs to the first module of the protocol:
name()
(11) returning the abbreviated name (symbol) of the NFT, this interface belongs to the first module of the protocol:
symbol()
(12) returning the URL of the NFT external digital content, this interface belongs to the first module of the protocol:
tokenURI(uint256 _tokenId)
the interface returns an external URL which can be identified by a domain name resolution module in the cross-chain communication module, and the URL corresponds to a description NFT metadata JSON file after the domain name resolution identification;
(13) setting the name, description and content of NFT pointing to digital content, generating a JSON file to be stored in a block chain, wherein the interface belongs to a second module of the protocol:
setDigitalAssetInfo(string _name, string _description, string _url)
where _ name is the name of the digital content, _ description is the content description of the digital content, and _urlis the external link address of the digital content. And generating a JSON file according to the participation meeting and storing the JSON file in a block chain, wherein the JSON format is as follows:
{
"name": "_name",
"description": "_description",
"image": "_url ",
}
after the files are successfully stored, returning a link address _ url Json capable of accessing the JSON file;
(14) returning the name of the NFT pointing to the digital content, this interface belongs to the second module of the protocol:
getDigitalAssetName(uint256 _tokenId)
(15) returning to the description that NFT points to digital content, this interface belongs to the second module of the protocol:
getDigitalAssetDescription(uint256 _tokenId)
(16) querying the link _ url of the digital content of the NFT, this interface belongs to the second module of the protocol:
getDigitalAsset(uint256 _tokenId)
(17) generating NFT, the interface belonging to the second module of the protocol:
newNft(address _owner, uint256 _tokenId,string _url)
wherein _ owner is the address owned by the NFT, _ tokenId is the id of the set NFT, _ url is the interface setDigitalasAssetInfo () returned _ urlJson;
(18) synchronizing the NFT to another blockchain system, this interface belongs to the third module of the protocol:
synNft(uint256 _tokenId, string _toBlockchain)
wherein _ toBlockchain is an identifier for synchronizing the NFT to a target block chain, and _ tokenId is an id of the NFT to be synchronized;
(19) a twin NFT is generated on the block chain (corresponding to step S6 below), this interface belonging to the third module of the protocol:
twinNft(address _owner, uint256 _tokenId,string _url)
wherein _ owner is the address of the NFT owner, _ tokenId and _ url are _ tokenId and _ urlJson returned by the interface setdigitamasetinfo (), respectively; when the interface generates the NFT, the interface adds a twin label to the NFT, namely the return value of the isTwin () is true;
(20) twinning the NFT to another blockchain system (corresponding to the following step S5), which belongs to the third module of the protocol:
synTwinNft(uint256 _tokenId, string _toBlockchain)
wherein _ toBlockchain is an identifier for twinning the NFT to a target block chain, and _ tokenId is an id of the NFT to be twinned; the method can twins the NFT to a target blockchain system, the twin NFT is completely consistent with the original NFT, and the method can replace the original NFT to circulate and trade in a new blockchain system;
(21) querying whether it is a twin NFT, this interface belongs to the third module of the protocol:
isTwin(uint256 _tokenId)
if the NFT is original NFT, returning to 0, and twin NFT, returning to 1;
(22) the address of the owner of the NFT is changed, this interface belongs to the third module of the protocol:
setOwner(uint256 _tokenId,address _newOwner)
where _ newOwner is the NFT owner account.
The ImNFT protocol consisting of the above 22 interfaces can generate NFT of the digital content full-volume trusted storage and can support NFT cross-chain viewing and cross-chain circulation.
The cross-chain communication module in this embodiment includes a standard communication interface module, a domain name resolution module, and a data recording module (see fig. 3), where the standard communication interface module is used to establish a communication connection between a block chain and a block chain, the domain name resolution module is used to resolve and access a link address of digital content and a link address of a JSON file, and the data recording module is used to record an identifier of each block chain in the system and a contract address of a twin intelligent contract deployed on each block chain.
The functions provided by the NFT system supporting the full trusted storage of digital content in this embodiment include:
function one: creating an NFT, and uplink of digital content pointed by the NFT to ensure that the whole digital content is stored in a credible mode;
and a second function: the created NFT can twinned to other block chains, and the twin NFT is completely consistent with the original NFT rights and can represent the original NFT circulation and transaction.
The method and the flow for realizing the first function in the embodiment comprise the following steps:
the method comprises the following steps: editing an intelligent contract on the ImSQL block chain according to the ImNFT protocol specification, and deploying the intelligent contract in the ImSQL block chain system;
step two: uploading the digital content to be pointed by the NFT to be generated into an ImSQL block chain, and returning an https link capable of accessing the digital content, such as: https:// chaincomp. com/asset/QmZzBdKF7sQX1Q49CQGmreuZHxt9sVB3hTc3TTXYcVZ7jC, the link can be resolved and accessed by a domain name resolution module in the cross-chain communication module, and the corresponding digital content is stored in a digital content storage module;
step three: and calling a setDigitataAssetInfo () method in the intelligent contract, and setting the name, the description information and the link of the digital content (which is the return value of the step two). After the execution, a JSON file is generated and stored in the block chain system, and finally a url address _ urlJson capable of inquiring the generated JSON file is returned, wherein the following steps are carried out: https:// chainccomp. com/json/qmzbdkf 7sQX1Q49CQGmreuZHxt9sVB3hTc3TTXYcVZ7j, the link being capable of being resolved and accessed by a domain name resolution module of a cross-chain communication module;
step four: calling a newNft () method in the intelligent contract, and entering the parameters of _ tokenId of NFT, the address _ owner of the receiver and the _ urlJson returned in the third step, wherein the NFT is generated after the method is executed.
The method for constructing the twin NFT on different block chains for implementing the function two in this embodiment includes:
s1: completing environmental deployment of the twin system, and deploying a twin intelligent contract which is in accordance with the ImNFT protocol specification on all block chains which can generate the twin NFT, wherein the code of the contract is as follows:
pragma solidity >=0.4.21 <0.7.0;
import 'zeppelin-solidity/contracts/token/ERC721/ERC721.sol';
import 'zeppelin-solidity/contracts/ownership/Ownable.sol';
contract myImNft is ERC721, Ownable {
// digital content structure
struct digitalAsset {
string name;
string description;
string url;
}
// Uri and twin identity Structure of NFT
struct nftInfo {
string uri;
uint256 isTwin;
}
/mapping relationship between uri of NFT and digital content
mapping(string => digitalAsset) public digitalAssetMap;
// NFT for tokenId and uri and isTwin mapping
mapping(uint256 => nftInfo) public nftInfoMap;
// constructor
constructor() {
nftName = "ImNft";
nftSymbol = "Nft";
}
Setting name, description and link address of digital content, generating JSON file to be stored in block chain, and storing the transmitted information into digitalAsset structure
function setDigitalAssetInfo(string _name, string _description, string _url) returns (string) {
string _uri = saveJsonFile(_name, _description, _url);
digitalAssetMap[_uri] = digitalAsset({name: _name, description: _description, url: _url});
return _uri;
}
V/generating NFT and setting the NFT generated in this manner to 0 for twin flag, representing native
function newNft(address _owner, uint256 _tokenId, string _uri) external onlyOwner {
super._mint(_owner,_tokenId);
super._setTokenUri(_tokenId, _uri);
nftInfoMap[_tokenId] = nftInfo({uri: _uri, isTwin: 0});
}
V/name of digital content
function getDigitalAssetName(uint256_tokenId) returns (string) {
return digitalAssetMap[nftInfoMap[_tokenId].uri].name;
}
V/description of query digital content
function getDigitalAssetDescription(uint256 _tokenId) returns (string) {
return digitalAssetMap[nftInfoMap[_tokenId].uri].description;
}
// querying links to digital content
function getDigitalAsset(uint256_tokenId) returns (string) {
return digitalAssetMap[nftInfoMap[_tokenId].uri].url;
}
// sending twin NFT requests
function synTwinNft(uint256 _tokenId, string _toBlockchain) {
address_owner=ownerOf(tokenId);
string_uri = getDigitalAsset(_tokenId);
httpRequestPost(_owner, _tokenId, _uri, _toBlockchain);
}
Generating twin NFT and storing digital content information in digitalAsset structure
function twinNft(address _owner, uint256 _tokenId, string _uri) {
super._mint(_owner, _tokenId);
super._setTokenUri(_tokenId, _uri);
digitalAsset = httpRequestGet(_uri);
digitalAssetMap[_uri]=digitalAsset({name:digitalAsset.name,description:digitalAsset.description, url: digitalAsset.url});
nftInfoMap[_tokenId] = nft({uri: _uri, isTwin: 1});
}
I/enquiring whether NFT is twin
functionisTwin(uint256_tokenId){
return nftInfoMap[_tokenId].isTwin;
}
// transfer NFT
function setOwner(uint256_tokenId, address_newOwner) {
address_nowOwner=ownerOf(tokenId);
super._transfer(_nowOwner, _newOwner, tokenId);
}
}
The contract is named as myImNft, inherits the ERC721 and Ownable contract, the ERC721 contract comprises the first module realization of the ImNFT protocol in the example, and the myImNft contract does not need to repeatedly realize the first module interface; digitalAsset represents a structure of digital content, and consists of a name, a description and a link url of the digital content; the digitalAssetInfoMap represents the mapping relation between the link uri of the JSON file and the digital content; the nftInfo represents that the NFT digital content links uri and a structural body which is a twin NFT identifier isTwin; the nftMap represents the mapping relation between the tokenId and the NFT of the NFT; andtomlockchain represents a unique identification ID of the block chain; andowner is the account address; initializing the name and symbol of NFT in the constructor; the functions of each function in the contract are annotated, and some of the functions are functions that call other functions defined and implemented in the contract.
S2: after the first step is completed, the twin intelligent contract deployed on each different blockchain generates a corresponding contract address, namely _ smartcontraceaddress.
S3: each different block chain system has a unique identification ID, namely _ ToBlockchain, in the cross-chain communication module; in this embodiment, a data recording module in the cross-chain communication module is used to record an identifier _ toBlockchain of each blockchain in the system and a contract address _ smartcondrectaddress of a twin intelligent contract deployed thereon.
S4: an NFT is generated in the ImSQL blockchain as per the step of function one in this example.
S5: twinning the NFT to another blockchain system. And twinning the NFT in the ImSQL blockchain to the blockchain system A and the blockchain system B simultaneously.
S51, the twin intelligence contract on the blockchain generates a twin NFT request based on the id of the original NFT to be twinned on the blockchain and the identification of the target blockchain, where the request includes the id of the original NFT to be twinned and the identification of the target blockchain, and the owner account and storage information corresponding to the original NFT to be twinned.
(1) Calling a synTwinNft () method in a contract on an ImSQL block chain, and transmitting a _ tokenId of the NFT and an identifier _ toBlockchain of a target block chain;
(2) inquiring an owner account _ owner of an original NFT to be twin and a _ url of a JSON file by a synTwinNft () method in the step (1), generating a twin NFT request based on the information, and sending the twin NFT request to a cross-chain communication module, wherein the contents of the entry JSON of the twin NFT request are as follows:
{
"tokenId": "_tokenId",
"owner": "_owner",
"url": "_url",
"toBlockchain":"_toBlockchain",
}
s52, after the cross-chain communication module receives the twin NFT request, the data recording module identifies a target block chain address of the to-be-twin NFT and a contract address _ smartcondtraceAddress of the twin intelligent contract on the target block chain according to the parameter _ toBlockchain, and sends a http request of the twin NFT to the corresponding twin intelligent contract based on the identified target block chain and the corresponding twin intelligent contract address, wherein the JSON format of the request is as follows:
{
"tokenId": "_tokenId",
"owner": "_owner",
"url": "_url",
"smartcontractAddress":"_smartcontractAddress",
}
the purpose of this http interface is to call the twinNft () method in the twin smart contract with address smartontractaddress in the target blockchain system.
And S6, generating twin NFT on the block chain. And (4) calling a twinNft () method in the twin intelligent contract according to the http request of the twin NFT by the twin intelligent contract on the target block chain to generate the NFT with the id of the original NFT on the block chain where the twin intelligent contract is located, wherein the NFT is called as the twin NFT, and the twin mark is marked. The only difference between the twin NFT and the original NFT is the flag of whether twin occurs, i.e., the return value of the isTwin () method is different.
After a plurality of twin NFTs are generated on the NFT system supporting the entire trusted storage of digital content in this embodiment, when any one of the NFTs is transacted, the following NFT transfer transaction method is adopted:
(1) receiving a NFT transferring request, and transferring the NFT to be transferred to a new owner account _ newOwner by using a safeTransferFrom () method in a protocol;
(2) after the NFT transfer is successful, sending an http request of the NFT transfer to the cross-chain communication module, wherein the reference JSON content of the request is as follows:
{
"tokenId": "_tokenId",
"newOwner": "_newOwner",
}
wherein, token Id is id of NFT to be transferred, newOwner is new owner account of NFT;
(3) after receiving an http request for successful NFT transfer, the cross-chain communication module judges the block chain addresses of the original NFT represented by the _ token Id and all the twin NFTs according to the content in the data recording module, and finds out the contract address of each twin intelligent contract on the corresponding block chain;
(4) the cross-chain communication module sends an http request for changing the NFT owner to the twin intelligent contract of the block chain where the original NFT and all the twin NFTs are located, and the request JSON is as follows:
{
"tokenId": "_tokenId",
"newOwner": "_newOwner",
"smartcontractAddress":"_smartcontractAddress",
}
(5) and after receiving the http request, the intelligent contract of the target block chain executes a setTwinOwner () method in the intelligent contract to change the owner of the target block chain NFT.
Therefore, the transfer of the NFT and the synchronization of the ownership states of all twin NFTs on different blockchain systems are completed, and the value dispersion risk caused by the conditions of each NFT ownership split, independent transaction and the like is avoided.

Claims (7)

1. A method of constructing twin NFTs on different blockchains, characterized by:
a. deploying a twin intelligence contract on all blockchains that are likely to produce a twin NFT;
b. twin intelligent contracts deployed on the blockchain generate contract addresses corresponding to the twin intelligent contracts;
c. recording the identification of each blockchain and the contract address of the twin intelligent contract deployed by each blockchain through a cross-chain communication module on each blockchain;
d. generating a twin NFT request by a twin intelligent contract on a block chain based on the id of an original NFT to be twin on the block chain and the identification of a target block chain, wherein the request comprises the id of the original NFT to be twin and the identification of the target block chain, and the owner account and storage information corresponding to the original NFT to be twin;
e. after receiving the twin NFT request, the cross-chain communication module identifies a target block chain corresponding to the twin NFT request and a contract address of a twin intelligent contract corresponding to the target block chain, and sends an http request of the twin NFT to the twin intelligent contract on the target block chain based on the identified contract address of the twin intelligent contract corresponding to the target block chain and the target block chain, wherein the request comprises an id of an original NFT to be twin, an owner account and storage information;
f. a twin intelligent contract on the target block chain generates an NFT with the id being the id of the original NFT to be twinned on the target block chain according to the id of the original NFT to be twinned in the http request of the twin NFT, the owner account and the storage information, and marks a twin mark;
the twin intelligent contract can send a contract address corresponding to the twin intelligent contract to the cross-chain communication module on each blockchain after being deployed on the blockchain; the twin intelligent contract can also receive a twin NFT http request sent by the cross-chain communication module, and after the twin NFT http request is received, an NFT with the id being the id of the original NFT to be twinned is generated on the target block chain according to the id, the owner account and the storage information of the original NFT to be twinned in the http request of the twin NFT, and a twin mark is marked;
the storage information comprises a link address of a JSON file corresponding to an original NFT to be twin in a block chain;
the JSON file is generated based on the name, content description and link address of the digital content corresponding to the original NFT to be twin.
2. The method of constructing a twin NFT over different blockchains according to claim 1, wherein the cross-chain communication module comprises:
the standard communication interface module is used for establishing communication connection between the block chain and the block chain;
the domain name resolution module is used for resolving and accessing the link address in the NFT storage information;
and the data recording module is used for recording the identification of each block chain and the contract address of the twin intelligent contract deployed by each block chain.
3. The method of constructing twin NFTs on different blockchains according to claim 1, wherein: and the block chain where the original NFT to be twinned is located is an ImSQL block chain, and digital content corresponding to the original NFT to be twinned is stored on the ImSQL block chain.
4. A NFT transfer transaction method, characterized by:
transferring the NFT to be transferred to a new owner account on a blockchain, wherein the NFT to be transferred is a twin NFT constructed by the method for constructing the twin NFT according to any one of claims 1 to 3 or an original NFT in the method for constructing the twin NFT;
after the NFT transfer is completed, generating an http request for the successful NFT transfer, wherein the request comprises the id of the NFT which is successfully transferred and a new owner account;
the cross-chain communication module receives an http request for NFT transfer success, and determines block chain addresses where a corresponding original NFT and all twin NFTs are located and contract addresses of twin intelligent contracts on corresponding block chains according to the ID of the NFT in the request;
the cross-chain communication module sends an http request for changing the NFT owner to the twin intelligent contract according to the block chain address and the contract address of the twin intelligent contract, wherein the request comprises the id of the NFT which is successfully transferred and a new owner account;
and the twin intelligent contract receives an http request for changing the NFT owner, and changes the corresponding NFT owner on the block chain where the twin intelligent contract is located according to the http request for changing the NFT owner.
5. An NFT protocol that supports trusted storage of a full amount of digital content, comprising:
the ERC721 protocol;
the full data storage protocol comprises a method for generating a JSON file based on the name, content description and link address of digital content, and a method for generating an NFT based on the id of the NFT, an owner account and the link address of the corresponding JSON file;
the NFT cross-chain consistency protocol comprises a method for realizing step d and e twin NFT to other block chains in the method for constructing the twin NFT, described in any one of claims 1 to 3, a method for generating the twin NFT on the block chains in the step f, and a method for changing an NFT owner in the NFT transfer transaction method described in claim 4.
6. An NFT system supporting trusted storage of a full amount of digital content, characterized by: the NFT system comprises a plurality of block chains, and an ImNFT protocol module storing the NFT protocol of claim 5 is configured on each block chain.
7. The NFT system supporting trusted storage of full amounts of digital content according to claim 6, wherein: the plurality of block chains comprise an ImSQL block chain, and the ImSQL block chain is also provided with a cross-chain communication module and a digital content storage module for storing digital content.
CN202111168545.XA 2021-10-08 2021-10-08 Method for constructing twin NFT, NFT protocol and system for full trusted storage Active CN113806817B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111168545.XA CN113806817B (en) 2021-10-08 2021-10-08 Method for constructing twin NFT, NFT protocol and system for full trusted storage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111168545.XA CN113806817B (en) 2021-10-08 2021-10-08 Method for constructing twin NFT, NFT protocol and system for full trusted storage

Publications (2)

Publication Number Publication Date
CN113806817A CN113806817A (en) 2021-12-17
CN113806817B true CN113806817B (en) 2022-07-05

Family

ID=78897372

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111168545.XA Active CN113806817B (en) 2021-10-08 2021-10-08 Method for constructing twin NFT, NFT protocol and system for full trusted storage

Country Status (1)

Country Link
CN (1) CN113806817B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115796868A (en) * 2022-11-22 2023-03-14 紫绶(上海)信息科技有限公司 Method for realizing multi-block chain simultaneous casting launch and multi-chain NFT application

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112287029A (en) * 2020-11-17 2021-01-29 北京物资学院 Block chain multi-chain cross-chain system and implementation mechanism thereof
CN112862486A (en) * 2021-02-25 2021-05-28 杭州链网科技有限公司 Multi-party chain crossing method and system based on mirror image chain crossing
WO2021121090A1 (en) * 2019-12-17 2021-06-24 Shanghai Weilian Information Technology Co., Ltd. Property right confirmation and transfer methods and systems, electronic device, and storage medium
CN113407640A (en) * 2021-07-21 2021-09-17 杭州链网科技有限公司 Multi-chain NFT (network File transfer) based chain crossing method and system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11354615B2 (en) * 2017-11-21 2022-06-07 International Business Machines Corporation Blockchain-implemented digital agreement management for digital twin assets
US20190317935A1 (en) * 2017-11-21 2019-10-17 International Business Machines Corporation Blockchain-implemented smart contract management for digital twin assets
US11488176B2 (en) * 2019-01-31 2022-11-01 Salesforce.Com, Inc. Systems, methods, and apparatuses for implementing certificates of authenticity of digital twins transacted onto a blockchain using distributed ledger technology (DLT)

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021121090A1 (en) * 2019-12-17 2021-06-24 Shanghai Weilian Information Technology Co., Ltd. Property right confirmation and transfer methods and systems, electronic device, and storage medium
CN112287029A (en) * 2020-11-17 2021-01-29 北京物资学院 Block chain multi-chain cross-chain system and implementation mechanism thereof
CN112862486A (en) * 2021-02-25 2021-05-28 杭州链网科技有限公司 Multi-party chain crossing method and system based on mirror image chain crossing
CN113407640A (en) * 2021-07-21 2021-09-17 杭州链网科技有限公司 Multi-chain NFT (network File transfer) based chain crossing method and system

Also Published As

Publication number Publication date
CN113806817A (en) 2021-12-17

Similar Documents

Publication Publication Date Title
CN110620810B (en) Non-linked ownership of continuous asset transfer over blockchain
CN110311790B (en) Method and device for sending authenticable message in cross-link mode
CN110060162B (en) Data authorization and query method and device based on block chain
US11438139B2 (en) Blockchain based secure naming and update verification
CN110430162B (en) Method and device for sending authenticable message in cross-link mode
CN110399338B (en) Distributed file index system and method based on block chain and cloud storage server
US7127429B2 (en) Digital contents superdistribution system and method of distributing digital contents
US11533166B2 (en) Method for controlling distribution of a product in a computer network and system
CN112287034B (en) Data synchronization method, equipment and computer readable storage medium
CN109582473A (en) Across chain data access method and device based on block chain
CN111314172B (en) Block chain-based data processing method, device, equipment and storage medium
CN112883117B (en) Data synchronization method, equipment and computer readable storage medium
CN110851877B (en) Data processing method and device, block chain node equipment and storage medium
KR102166690B1 (en) Management server and method of digital signature for electronic document
US20230289782A1 (en) Smart contract-based data processing
CN111429250A (en) Data management method and device in escort scene
CN110674531A (en) Residence information management method, device, server and medium based on block chain
CN113806817B (en) Method for constructing twin NFT, NFT protocol and system for full trusted storage
CN113127811A (en) Cultural relic digital resource safety sharing method, cultural relic digital resource safety sharing system and information data processing terminal
CN116894732A (en) Digital asset management method, device, system and readable storage medium
CN110417742B (en) Method, device and storage medium for cross-link sending, transferring and receiving authenticable message
CN115408590B (en) Document tracking and tracing method, device and system
CN115098893A (en) Data storage method and device based on block chain
CN114707973A (en) Method and protocol for managing downlink and uplink coordinated digital assets of chain oriented to metauniverse application
TW202135504A (en) Platform services verification

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant