CN111461715A - Material donation method and system based on block chain, storage medium and server - Google Patents

Material donation method and system based on block chain, storage medium and server Download PDF

Info

Publication number
CN111461715A
CN111461715A CN202010239840.9A CN202010239840A CN111461715A CN 111461715 A CN111461715 A CN 111461715A CN 202010239840 A CN202010239840 A CN 202010239840A CN 111461715 A CN111461715 A CN 111461715A
Authority
CN
China
Prior art keywords
user
transaction
donation
account address
asset
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.)
Pending
Application number
CN202010239840.9A
Other languages
Chinese (zh)
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.)
Hangzhou Timestamp Information Technology Co ltd
Original Assignee
Hangzhou Timestamp Information Technology Co ltd
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 Hangzhou Timestamp Information Technology Co ltd filed Critical Hangzhou Timestamp Information Technology Co ltd
Priority to CN202010239840.9A priority Critical patent/CN111461715A/en
Publication of CN111461715A publication Critical patent/CN111461715A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • 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
    • 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/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3821Electronic credentials
    • 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
    • G06Q50/00Systems or methods specially adapted for specific business sectors, e.g. utilities or tourism
    • G06Q50/10Services
    • G06Q50/26Government or public services

Abstract

The application relates to a block chain-based material donation method, which comprises the following steps: in response to a third user entering asset information and an account address of a donating user, adding the asset information to the definition of the digital asset and initiating a first transaction on the blockchain, issuing the digital asset to the account address of the donating user; receiving a unique asset identifier generated by the blockchain according to the definition of the digital asset; responding to the input of the unique asset identification and the account address of the donated user by the donation user, initiating a second transaction on the blockchain, and sending the digital asset corresponding to the unique asset identification to the account address of the donated user; responding to the presented user to input the unique asset identification, initiating a third transaction on the block chain, and destroying the digital asset corresponding to the unique asset identification; the block chain-based material donation method can improve the transparency degree of material donation activities. The application also provides a method, a system, a storage medium and a server for donating materials based on the block chain.

Description

Material donation method and system based on block chain, storage medium and server
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a method, a system, a storage medium, and a server for donation of materials based on blockchains.
Background
The present material donation activities are mainly performed by receiving materials donated by a donor (an individual or a company that usually donates materials) by a public-interest organization (e.g., red cross), and then distributing the received materials to a recipient that needs the materials (an individual or an organization that receives the donated materials, e.g., a hospital).
However, how to make the material donation activity traceable is still a difficult problem to be solved urgently.
Disclosure of Invention
In view of the above, it is necessary to provide a method, a system, a storage medium and a server for donation of materials based on block chains, which enable the donation of materials to be traceable.
A method for donating materials based on a blockchain, the method comprising:
in response to a third user entering asset information and an account address of a donating user, adding the asset information to a definition of a digital asset and initiating a first transaction on a blockchain; the first transaction is for issuing a digital asset to an account address of the donating user;
receiving a unique asset identifier generated by the blockchain according to the definition of the digital asset;
initiating a second transaction at the blockchain in response to the donating user entering the unique asset identification and the account address of the recipient user; the second transaction is used for sending the digital assets corresponding to the unique asset identification on the account address of the donation user to the account address of the donated user;
initiating a third transaction on the blockchain in response to the gifted user entering the unique asset identification; the third transaction is used for destroying the digital assets corresponding to the unique asset identification on the account address of the gifted user.
A method for donating materials based on a blockchain, the method comprising:
the first node processing server responds to the third user input material information and the first transaction initiated by the account address of the donation user; the first transaction is for issuing a digital asset to an account address of a donating user; the digital assets are defined as the material information;
the first node generates a unique asset identifier according to the definition of the digital asset;
the first node sends the unique asset identification to the server;
the second node processing server responds to the donation user to input the unique asset identification and the account address of the donated user to initiate a second transaction; the second transaction is used for sending the digital assets corresponding to the unique asset identification on the account address of the donation user to the account address of the donated user;
the third node receives a third transaction initiated by the server in response to the gifted user entering the unique asset identification; the third transaction is used for destroying the digital assets corresponding to the unique asset identification on the account address of the gifted user;
returning a unique transaction identifier to the server according to the third transaction so that the server determines the material donation result as a first donation result; the first donation result is used to indicate that the recipient user confirms the receipt of the material.
A material donation system based on a block chain comprises a first transaction module, an asset identifier receiving module, a second transaction module, a third transaction module, a transaction identifier judging module and a donation result determining module.
The first transaction module is used for responding to the third user input material information and the account address of the donation user, adding the material information into the definition of the digital asset, and initiating a first transaction on the block chain; the first transaction is for issuing a digital asset to an account address of the donating user;
the asset identification receiving module is used for receiving a unique asset identification generated by the block chain according to the definition of the digital asset;
the second transaction module is used for responding to the unique asset identifier input by the donation user and the account address of the donated user and initiating a second transaction in the block chain; the second transaction is used for sending the digital assets corresponding to the unique asset identification on the account address of the donation user to the account address of the donated user;
the third transaction module is used for responding to the unique asset identification input by the gifted user and initiating a third transaction on the block chain; the third transaction is used for destroying the digital assets corresponding to the unique asset identification on the account address of the gifted user.
A server comprising a memory and a processor, the memory storing a computer program that when executed by the processor performs the steps of:
in response to a third user entering asset information and an account address of a donating user, adding the asset information to the definition of the digital asset and initiating a first transaction on the blockchain; a first transaction for issuing a digital asset to an account address of a donating user;
receiving a unique asset identifier generated by the blockchain according to the definition of the digital asset;
initiating a second transaction at the blockchain in response to the donating user entering the unique asset identification and an account address of a recipient user; the second transaction is used for sending the digital assets corresponding to the unique asset identification on the account address of the donation user to the account address of the donated user;
initiating a third transaction on the blockchain in response to the gifted user entering the unique asset identification; the third transaction is used for destroying the digital assets corresponding to the unique asset identification on the account address of the gifted user.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
in response to a third user entering asset information and an account address of a donating user, adding the asset information to the definition of the digital asset and initiating a first transaction on the blockchain; a first transaction for issuing a digital asset to an account address of a donating user;
receiving a unique asset identifier generated by the blockchain according to the definition of the digital asset;
initiating a second transaction at the blockchain in response to the donating user entering the unique asset identification and an account address of a recipient user; the second transaction is used for sending the digital assets corresponding to the unique asset identification on the account address of the donation user to the account address of the donated user;
initiating a third transaction on the blockchain in response to the gifted user entering the unique asset identification; the third transaction is used for destroying the digital assets corresponding to the unique asset identification on the account address of the gifted user.
Compared with the prior art, the block chain-based material donation method initiates a first transaction on the block chain by responding to the third user input material information and the account address of the donation user so as to issue the digital asset to the account address of the donation user, realizes material chaining, and can trace the actual donation situation of the donation user by using the transaction of the block chain, thereby avoiding the problem of donation people's fraud or public welfare organization's virtual donation of materials.
The method further comprises adding the asset information to a definition of a digital asset; and receiving a unique asset identifier generated by the block chain according to the definition of the digital asset, so that the material information is recorded in the block chain and is not easy to be tampered.
The method also initiates a second transaction at the blockchain in response to the input of the unique asset identifier and the account address of the given user by the donating user, so as to send the digital asset corresponding to the unique asset identifier on the account address of the donating user to the account address of the given user through the blockchain, so that the donating user can confirm that the material donated by the donating user is consistent with the material information corresponding to the digital asset through the transfer of the digital asset, and the given user can trace the material information which should be given through the digital asset received on the account address of the given user, thereby verifying the actually received material and the material information which should be given.
The method also responds to the unique asset identification input by the given user, and initiates a third transaction on the block chain, so that the digital asset corresponding to the unique asset identification on the account address of the given user is destroyed through the block chain, the given user can conveniently feed back a verification result by destroying the digital asset after verifying the goods, and therefore the problem that public welfare organizations are not practical to issue the goods is effectively prevented, the whole goods and materials giving process can be traced, and the supervision on the goods and materials giving process is favorably realized.
Drawings
FIG. 1 is a diagram illustrating an application environment of a blockchain-based donation method according to an embodiment;
FIG. 2 is a diagram illustrating an application architecture of a blockchain-based donation method according to an embodiment;
FIG. 3 is a flowchart illustrating a method for donation of materials based on blockchains according to an embodiment I;
FIG. 4 is a flowchart of the method for donating materials based on blockchains according to the second embodiment;
FIG. 5 is a flowchart of the method for donating materials based on blockchains according to the third embodiment;
FIG. 6 is a block diagram of a blockchain-based material donation system in one embodiment;
FIG. 7 is a flowchart of a blockchain-based donation method according to the fourth embodiment;
fig. 8 is an internal structural diagram of a server in an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The terms "first," "second," and the like in the description and in the claims of the embodiments of the application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Referring to fig. 1, the method for donating materials based on a blockchain according to an embodiment of the present invention may be applied to an application environment shown in fig. 1, where a terminal 5 and a server 3 communicate with each other through a network, and the server 3 and any node 1 in a blockchain 10 may communicate with each other through the network.
The terminal 102 may be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server 3 may be implemented by an independent server or a server cluster composed of a plurality of servers.
In general, blockchains can be divided into three types: public, private, and federation chains. Various combinations of public, private, and federation chains are also currently available, such as different block chains accessible through the blockcenter of the Bystack chain.
Any two blockchain nodes 1 adopt a P2P (Peer To Peer) protocol for network communication. A node may be implemented as a stand-alone server or as a server cluster of multiple servers.
As shown in fig. 2, the user sends a request to the server backend through an application running on the terminal 5, where the application may be an applet or an application. An applet is an application that can be used without download and installation; applications include, but are not limited to, APP and computer applications. The server backend runs in the server 3, and can initiate a transaction on a Blockchain (Blockchain) according to a request.
Optionally, the server backend may also invoke the application interface service, for example, if the application is a wechat applet, the server backend may log in the wechat applet by invoking the wechat interface service.
After the server back end initiates a transaction on the block chain, the transaction is broadcasted to nodes in the block chain 10, the nodes broadcast the transaction to nodes around the server after receiving the transaction, the transaction is finally spread to all the nodes in the block chain 10, the nodes which acquire the accounting right verify the transaction, the transaction is generated into a new block, and the new block is added into the block chain.
In the first embodiment, as shown in fig. 3, a block chain-based material donation method is provided, which is described by taking the application of the method to the server 3 in fig. 1 as an example, and includes steps S200 to S212:
step S202, responding to the third user inputting the material information and the account address of the donation user, adding the material information into the definition of the digital assets, and initiating a first transaction on the block chain.
The third users are third parties such as public welfare organizations and the like, and the donation users donate the materials to the third users and distribute the materials to the donated users by the third users.
Specifically, when the material information is added to the definition of the digital asset, the material information is added to the definition of the digital asset in the form of additional information.
The material information may include description information such as name, number and/or weight of the material, for example, the name of the material is a mask, and the number of the material is 10000.
Blockchain accounts, which may be referred to as wallet accounts; typically, a blockchain account includes a public key, a private key, and an address. The address of the blockchain account, referred to herein as the account address, may also be referred to as the wallet address, and functions similarly to a bank card account number, and when any party wants to send a digital asset to another party, the account address of the other party needs to be known.
Specifically, the user may obtain the account address of another user by way of wechat or obtaining information from reliable information that the user discloses to the outside, for example, obtaining from official website information of a certain organization or unit, or obtaining from information published in a blockchain. The user can directly obtain account addresses of other users, and can also obtain two-dimensional codes of other users, and the account addresses are obtained through the two-dimensional codes. For example, the blockchain-based material donation method further includes: responding to the input of the two-dimension code of the donation user by the third user, and obtaining the account address of the donation user according to the two-dimension code of the donation user; the account address of the donating user is returned to the third user.
Further, the user's two-dimensional code may be generated by the server when the user requests to create an account, and optionally, the block chain-based material donation method further includes:
receiving an account creation request input by a donation user; the account creation request includes the name of the donating user;
creating a block chain account for the donation user, and generating a two-dimensional code of the donation user according to the account address;
and returning the two-dimension code of the donation user to the donation user.
In other embodiments, the blockchain-based donation method further includes:
receiving an account creation request input by a donation user; the account creation request includes the name of the donating user;
creating a block chain account for the donation user, and generating a two-dimensional code of the donation user according to the account address;
generating a JWT of the donation user according to the name and the account address of the donation user;
returning the two-dimension code and the JWT of the donation user to the donation user;
adding the asset information to the definition of the digital asset, including, in response to the third user entering the asset information and the account address of the donating user;
responsive to a third user entering the third user's JWT, the asset information, and the donation user's two-dimensional code, the asset information is added to the definition of the digital asset responsive to the third user entering the asset information and the donation user's account address.
The first transaction is for issuing the digital asset to an account address of a donating user.
Optionally, the type and number of digital assets issued are the same for different assets. The server need only publish the default digital assets and need not determine the number of digital assets published at a time, reducing server stress. In other embodiments, for different supplies, the category of the digital asset may be determined according to the name of the supply; or determining the number of digital assets based on the number or weight of the assets.
Step S204, receiving the unique asset identification generated by the blockchain according to the definition of the digital asset.
The unique asset identification is used for identifying the issued digital asset, and the corresponding digital asset can be uniquely determined on the block chain through the unique asset identification.
Further, the method also includes:
and correspondingly storing the received unique asset identification and the material information.
And binding the unique asset identification with the material information so that the donation user or the donated user can inquire the unique asset identification corresponding to the material information.
Initiating a first transaction on the blockchain to issue the digital asset to the account address of the donating user by responding to the third user entering the asset information and the account address of the donating user, in combination with adding the asset information to the definition of the digital asset; and receiving the unique asset identifier generated by the block chain according to the definition of the digital asset, realizing material chaining, and tracing the actual donation condition of the donation user by using the transaction of the block chain, thereby avoiding the problem of donator fraud or public service organization false donation of the material.
In response to the donor user entering the unique asset identification and the account address of the recipient user, a second transaction is initiated at the blockchain, step S206. The second transaction is for sending the digital asset corresponding to the unique asset identification on the account address of the donating user to the account address of the recipient user.
In particular, the donating user can identify the unique asset by looking up the unique asset in a database that stores asset information.
The donation user can transfer the digital assets through the second transaction to confirm that the materials donated by the donation user are consistent with the material information corresponding to the digital assets; through the result of the second transaction, the gifted user can trace back the goods and materials information which should be received through the digital assets received on the account address of the gifted user, and therefore the goods and materials which are actually received and the goods and materials information which should be received can be verified.
In response to the gifted user entering the unique asset identification, a third transaction is initiated on the blockchain, step S208. And the third transaction is used for destroying the digital assets corresponding to the unique asset identification on the account address of the gifted user.
In a third transaction, the digital asset corresponds to the asset that the gifted user should receive. The gifted user can verify the actually received materials and the materials to be received, and the digital assets are destroyed through the third transaction to feed back the verification result, so that the problem that the public welfare organization is not practical to issue the materials is effectively prevented.
Therefore, the method for donating materials based on the blockchain provided by the embodiment can prevent any party from being counterfeited, so that the whole process of donating materials can be traced, and the supervision on the process of donating materials is favorably realized.
It should be understood that, although the steps in the flowchart of fig. 3 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in fig. 3 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
In the second embodiment, as shown in fig. 4, a block chain-based material donation method is provided, which is described by taking the application of the method to the server 3 in fig. 1 as an example, and includes steps S400 to S420:
in step S400, an account creation request input by any user is received. The account creation request includes the name of the user.
Step S402, creating a blockchain account for the user, and generating a two-dimensional code of the user according to an account address of the blockchain account.
Illustratively, the application running on the terminal 5 is a WeChat applet. Specifically, the account creation request includes the name and password of the user.
After receiving the account creation request, the server back end invokes a wechat interface service, for example, auth. code2session. api, the wechat interface service returns information required for generating a private key and a public key to the server back end, the server back end sends the public key to the blockchain to create an account, and the blockchain returns a newly created account address.
The blockchain account includes a public key, a private key, and an address. The private key is maintained by the user. Optionally, the server generates a mnemonic word according to the private key, returns the mnemonic word to the user, and the user can log in the wallet account through the mnemonic word.
Step S404, generating the JWT of the user according to the name and the account address of the user.
Step S406, the two-dimensional code and JWT of the user are returned to the user.
Jwt (JSON Web token) is an open standard (RFC 7519) that defines a compact, self-contained way to securely transfer information between parties as JSON objects. This information can be verified and trusted because it is digitally signed. JWT can be used for cross-domain identity authentication. After a user logs in the WeChat applet through a user login password and the name of the user, the JWT of the user is generated according to the name of the user and the two-dimensional code, and the JWT can be sent to a server by the user through the WeChat applet to operate digital assets on a wallet account of the user, so that the pressure of the server is reduced.
Step S408, in response to the third user entering the third user' S JWT, the asset information, and the account address of the donating user, adding the asset information to the definition of the digital asset, initiating a first transaction on the blockchain. The first transaction is for issuing the digital asset to an account address of a donating user.
Specifically, the third user obtains the third user's JWT and account address by sending an account creation request before the third user enters the third user's JWT, asset information, and the account address of the donating user. The third user also obtains the account address of the donation user by obtaining the two-dimensional code of the donation user and sending the two-dimensional code of the donation user to the server.
Specifically, the third user sends a credential addition request to the server, the credential addition request including the third user's JWT, the asset information, and the account address of the donating user.
Step S412, receiving a unique asset identifier generated by the blockchain according to the definition of the digital asset.
In response to the donating user entering the unique asset identification and the account address of the recipient user, a second transaction is initiated at the blockchain, step S414. The second transaction is for sending the digital asset corresponding to the unique asset identification on the account address of the donating user to the account address of the recipient user.
In response to the gifted user entering the unique asset identification, a third transaction is initiated on the blockchain, step S416. And the third transaction is used for destroying the digital assets corresponding to the unique asset identification on the account address of the gifted user.
Step S418, determine whether the unique transaction identifier returned by the blockchain according to the third transaction is received.
After processing the transaction, the blockchain node generates a unique transaction identifier for the transaction, and the transaction record can be uniquely determined through the unique transaction identifier.
Step S420, in response to determining that the unique transaction identifier returned by the blockchain according to the third transaction is received, determining the material donation result as the first donation result. The first donation result is used to indicate that the recipient user confirms the receipt of the material.
Each transaction in the block chain has a corresponding unique transaction identifier, and the transaction can be traced through the unique transaction identifier.
Step S422, after the material donation result is determined as the first donation result, generating a visual voucher according to the material information and the material donation result.
Through generating visual certificates, the user can conveniently and intuitively obtain the material information and the corresponding donation results.
Specifically, step S420 may include: after the material donation result is determined as the first donation result, generating a picture according to the material information; and generating the watermark of the picture according to the material donation result.
In other embodiments, step S420 may include: and correspondingly adding the material information and the material donation result into the material list after the material donation result is determined as the first donation result.
In other embodiments, step S420 may include: after the material donation result is determined as the first donation result, generating a two-dimensional code according to the material information; and updating the color of the two-dimensional code according to the material donation result. For example, if the material donation result is the first donation result, the color of the two-dimensional code may be updated to a predetermined color such as blue. Further, the material information comprises a material code; then generate the two-dimensional code according to the goods and materials information, including: and generating the two-dimensional code according to the material code.
It should be understood that, although the steps in the flowchart of fig. 4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in fig. 4 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
In the fourth embodiment, as shown in fig. 5, a block chain-based material donation method is provided, which is described by taking the application of the method to the server 3 in fig. 1 as an example, and includes steps S600 to S624:
step S600, in response to the third user entering the third user' S JWT, the asset information, and the account address of the donating user, adding the asset information to the definition of the digital asset, and initiating a first transaction on the blockchain. The first transaction is for issuing the digital asset to an account address of a donating user.
Specifically, the third user sends a credential addition request to the server, the credential addition request including the third user's JWT, the asset information, and the account address of the donating user.
Step S604, receiving a unique asset identifier generated by the blockchain according to the definition of the digital asset.
In step S606, a second transaction is initiated at the blockchain in response to the donating user entering the unique asset identification and the account address of the recipient user. The second transaction is for sending the digital asset corresponding to the unique asset identification on the account address of the donating user to the account address of the recipient user.
In response to the gifted user entering the unique asset identification, a third transaction is initiated on the blockchain, step S608. And the third transaction is used for destroying the digital assets corresponding to the unique asset identification on the account address of the gifted user.
Step S610, determining whether the unique transaction identifier returned by the blockchain according to the third transaction is received.
Each transaction in the block chain has a corresponding unique transaction identifier, and the transaction can be traced through the unique transaction identifier.
Step S612, in response to determining that the unique transaction identifier returned by the blockchain according to the third transaction is received, determining the material donation result as the first donation result. The first donation result is used to indicate that the recipient user confirms the receipt of the material.
In step S614, in response to determining that the unique transaction identifier returned by the blockchain according to the third transaction is not received, it is determined whether the unique transaction identifier returned by the blockchain according to the second transaction is received.
In step S616, in response to determining that the unique transaction identifier returned by the blockchain according to the second transaction is received, the material donation result is determined as the second donation result. The second donation result is used for indicating that the donation user confirms that the materials donated by the donation user are consistent with the material information corresponding to the digital assets.
In step S618, in response to determining that the unique transaction identifier returned by the blockchain according to the second transaction is not received, it is determined whether the unique transaction identifier returned by the blockchain according to the first transaction is received.
Step S620, in response to determining that the unique transaction identifier returned by the blockchain according to the first transaction is received, determining the material donation result as a third donation result. The third donation result is used to indicate that the third user confirms receipt of the material donated by the donor user.
In step S622, in response to determining that the unique transaction identifier returned by the blockchain according to the first transaction is not received, the material donation result is determined as a fourth donation result. The fourth donation result is used to indicate that the third user has not confirmed receipt of the material donated by the donor user.
Optionally, the method further includes:
correspondingly storing the unique transaction identifier, the unique asset identifier and the material information into a material list;
responding to a target material selection instruction input by a user, and determining material information of the target material according to the target material selection instruction;
searching a unique transaction identifier corresponding to the material information of the target material in the material list;
acquiring a transaction record corresponding to the found unique transaction identifier in the block chain;
and determining a material donation result according to the acquired transaction record.
And step S624, generating a visual certificate according to the material information and the material donation result.
Further, the method also includes:
responding to a holder query request of a visual certificate input by a user, and determining the material information of the target material according to the material donation progress query request;
searching a unique transaction identifier corresponding to the material information of the target material in the material list;
acquiring a transaction record corresponding to the found unique transaction identifier in the block chain;
judging whether the transaction corresponding to the unique transaction identification belongs to a first transaction or not according to the transaction record;
in response to determining that the transaction corresponding to the unique transaction identifier belongs to the first transaction, determining a current holder of the visual credential as a donating user;
judging whether the transaction corresponding to the unique transaction identification belongs to a second transaction or not according to the transaction record;
and in response to determining that the transaction corresponding to the unique transaction identification belongs to the second transaction, determining the current holder of the visual certificate as the gifted user.
Optionally, the method further includes:
the current holder and the previous holder of the visual credential are presented in response to a change in the holder of the visual credential.
It should be understood that, although the steps in the flowchart of fig. 5 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in fig. 5 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
In one embodiment, as shown in FIG. 6, a blockchain-based asset donation system 7 is provided that includes a first transaction module 103, an asset identification receipt module 105, a second transaction module 107, and a third transaction module 109.
The first transaction module 101 is operable to add the asset information to the definition of the digital asset and initiate a first transaction on the blockchain in response to the third user entering the asset information and the account address of the donating user. The first transaction is for issuing the digital asset to an account address of the donating user.
The asset identification receiving module 105 is configured to receive a unique asset identification generated by the blockchain according to the definition of the digital asset.
The second transaction module 107 is used to initiate a second transaction at the blockchain in response to the donating user entering the unique asset identification and the account address of the recipient user. The second transaction is used for sending the digital assets corresponding to the unique asset identification on the account address of the donation user to the account address of the donated user;
a third transaction module 109 for initiating a third transaction on the blockchain in response to the gifted user entering the unique asset identification; the third transaction is used for destroying the digital assets corresponding to the unique asset identification on the account address of the gifted user;
for specific limitations of the blockchain-based material donation system, reference may be made to the above limitations of the blockchain-based material donation method, which are not described herein again. The various modules in the above block chain-based material donation system 7 may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent of a processor in the server, and can also be stored in a memory in the server in a software form, so that the processor can call and execute operations corresponding to the modules.
In an embodiment, as shown in fig. 7, a blockchain-based donation method is provided, which is applied to the first node, the second node, and the third node in the blockchain 10 in fig. 1 as an example. The first node is a node for obtaining the accounting right of the first transaction; the second node is a node for obtaining the accounting right of the second transaction; the third node is a node that obtains billing rights for the third transaction. The block chain-based material donation method comprises the following steps of S300-S310:
in step S300, the first node processes the first transaction initiated by the server in response to the third user inputting the asset information and the account address of the donating user.
The first transaction is for issuing a digital asset corresponding to the asset to an account address of the donating user. The digital asset is determined by the server according to the material information in response to the third user inputting the material information and the account address of the donating user. The definition of the digital assets is the asset information.
Step S302, the first node generates a unique asset identifier according to the definition of the digital asset.
Specifically, step S302 includes: step S302 includes: the first node performs a hash calculation based on the definition of the digital asset to generate a unique asset identification.
Optionally, step S302 includes: the first node hashes according to the definition and other fields of the digital asset to generate a unique asset identification.
Step S304, the first node sends the unique asset identifier to the server.
In step S306, the second node processes a second transaction initiated by the server in response to the donating user entering the unique asset identification and the account address of the recipient user. The second transaction is used for sending the digital assets corresponding to the unique asset identification on the account address of the donation user to the account address of the donated user;
in step S308, the third node processing server initiates a third transaction in response to the gifted user entering the unique asset identification. And the third transaction is used for destroying the digital assets corresponding to the unique asset identification on the account address of the gifted user.
Further, the method also includes:
returning the unique transaction identifier of the first transaction to the server according to the first transaction so that the server determines the material donation result as a first donation result; the first donation result is used for identifying the fact that the third user confirms that the third user receives the materials donated by the donation user;
returning the unique transaction identifier of the second transaction to the server according to the second transaction so that the server determines the material donation result as a second donation result; the second donation result is used for indicating that the donation user confirms that the materials donated by the donation user accord with the material information corresponding to the digital assets;
returning the unique transaction identifier of the third transaction to the server according to the third transaction so that the server determines the material donation result as a third donation result; the third donation result is used to indicate that the recipient user confirms the receipt of the material.
It should be noted that, in the embodiment of the present invention, a manner of competing for the accounting right by the nodes in the block chain is not limited, and in the embodiment, the nodes that obtain the accounting right of the first transaction, the second transaction, and the third transaction may be the same node, or may not be, which is not limited by the present invention.
It should be understood that, although the steps in the flowchart of fig. 7 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in fig. 7 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
In one embodiment, a server is provided, the internal structure of which may be as shown in fig. 8. The server includes a processor, a memory, a network interface, and a database connected by a device bus. Wherein the processor of the server is configured to provide computing and control capabilities. The memory of the server includes media and internal memory. The medium is a computer readable storage medium. In particular, the computer-readable storage medium is a non-volatile computer-readable storage medium. The non-transitory computer-readable storage medium stores an operating device, a computer program, and a database. The internal memory provides an environment for the operation device and execution of the computer program in the non-volatile computer-readable storage medium. The database of the server is used for storing data. The network interface of the server is used for communicating with an external terminal through network connection. The computer program is executed by a processor to implement a blockchain-based donation method for materials.
Those skilled in the art will appreciate that the architecture shown in fig. 8 is a block diagram of only a portion of the architecture associated with the subject application, and does not constitute a limitation on the servers to which the subject application applies, as a particular server may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, there is provided a server comprising a memory and a processor, the memory having a computer program stored therein, the processor when executing the computer program implementing the steps of:
in response to a third user entering asset information and an account address of a donating user, adding the asset information to the definition of the digital asset and initiating a first transaction on the blockchain; a first transaction for issuing a digital asset to an account address of a donating user;
receiving a unique asset identifier generated by the blockchain according to the definition of the digital asset;
initiating a second transaction at the blockchain in response to the donating user entering the unique asset identification and an account address of a recipient user; the second transaction is used for sending the digital assets corresponding to the unique asset identification on the account address of the donation user to the account address of the donated user;
initiating a third transaction on the blockchain in response to the gifted user entering the unique asset identification; the third transaction is used for destroying the digital assets corresponding to the unique asset identification on the account address of the gifted user.
In one embodiment, the processor, when executing the computer program, performs the steps of:
responding to the third user to input the two-dimension code of the donation user, and obtaining the account address of the donation user according to the two-dimension code of the donation user;
returning the account address of the donating user to the third user.
In one embodiment, the processor, when executing the computer program, performs the steps of:
receiving an account creation request input by the donation user; the account creation request includes a name of the donating user;
creating a block chain account for the donation user, and generating a two-dimensional code of the donation user according to an account address;
and returning the two-dimension code of the donation user to the donation user.
In one embodiment, the processor, when executing the computer program, performs the steps of:
receiving an account creation request input by any user; the account creation request includes a name of the arbitrary user;
creating a block chain account for any user, and generating a two-dimensional code of any user according to an account address;
generating a JWT of the arbitrary user according to the name and the account address of the arbitrary user;
returning the two-dimension code and the JWT of the arbitrary user to the arbitrary user;
determining digital assets corresponding to the goods according to the goods information in response to the third user inputting the goods information and the account address of the donation user, including;
and in response to the third user inputting the JWT of the third user, the goods and materials information and the two-dimensional code of the donation user, determining the digital assets corresponding to the goods and materials according to the goods and materials information.
In one embodiment, the processor, when executing the computer program, performs the steps of:
and after the material donation result is determined as the first donation result, generating a visual certificate according to the material information and the material donation result.
In one embodiment, a storage medium is provided, the medium being a computer readable storage medium having a computer program stored thereon, the computer program when executed by a processor implementing the steps of:
in response to a third user entering asset information and an account address of a donating user, adding the asset information to the definition of the digital asset and initiating a first transaction on the blockchain; a first transaction for issuing a digital asset to an account address of a donating user;
receiving a unique asset identifier generated by the blockchain according to the definition of the digital asset;
initiating a second transaction at the blockchain in response to the donating user entering the unique asset identification and an account address of a recipient user; the second transaction is used for sending the digital assets corresponding to the unique asset identification on the account address of the donation user to the account address of the donated user;
initiating a third transaction on the blockchain in response to the gifted user entering the unique asset identification; the third transaction is used for destroying the digital assets corresponding to the unique asset identification on the account address of the gifted user.
In one embodiment, the computer program when executed by the processor further performs the steps of:
responding to the third user to input the two-dimension code of the donation user, and obtaining the account address of the donation user according to the two-dimension code of the donation user;
returning the account address of the donating user to the third user.
In one embodiment, the computer program when executed by the processor further performs the steps of:
receiving an account creation request input by the donation user; the account creation request includes a name of the donating user;
creating a block chain account for the donation user, and generating a two-dimensional code of the donation user according to an account address;
and returning the two-dimension code of the donation user to the donation user.
In one embodiment, the computer program when executed by the processor further performs the steps of:
receiving an account creation request input by any user; the account creation request includes a name of the arbitrary user;
creating a block chain account for any user, and generating a two-dimensional code of any user according to an account address;
generating a JWT of the arbitrary user according to the name and the account address of the arbitrary user;
returning the two-dimension code and the JWT of the arbitrary user to the arbitrary user;
determining digital assets corresponding to the goods according to the goods information in response to the third user inputting the goods information and the account address of the donation user, including;
and in response to the third user inputting the JWT of the third user, the goods and materials information and the two-dimensional code of the donation user, determining the digital assets corresponding to the goods and materials according to the goods and materials information.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and after the material donation result is determined as the first donation result, generating a visual certificate according to the material information and the material donation result.
Those of ordinary skill in the art will appreciate that all or a portion of the processes of the methods of the embodiments described above may be implemented by instructions associated with hardware via a computer program, which may be stored on a computer readable storage medium, which when executed, may include the processes of the embodiments of the methods described above, wherein any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, non-volatile memory may include read-only memory (ROM), programmable ROM (prom), electrically programmable ROM (eprom), electrically erasable programmable ROM (eeprom), or flash memory, volatile memory may include Random Access Memory (RAM) or external cache memory, RAM is available in a variety of forms, such as static RAM (sram), Dynamic RAM (DRAM), synchronous DRAM (sdram), double data rate sdram (ddrsdram), enhanced sdram (sdram), dynamic RAM (rdram), and dynamic RAM (rdram) and direct memory (rdram).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A block chain-based material donation method is characterized by comprising the following steps:
in response to a third user entering asset information and an account address of a donating user, adding the asset information to a definition of a digital asset and initiating a first transaction on a blockchain; the first transaction is for issuing a digital asset to an account address of the donating user;
receiving a unique asset identifier generated by the blockchain according to the definition of the digital asset;
initiating a second transaction at the blockchain in response to the donating user entering the unique asset identification and an account address of a recipient user; the second transaction is used for sending the digital assets corresponding to the unique asset identification on the account address of the donation user to the account address of the donated user;
initiating a third transaction on the blockchain in response to the gifted user entering the unique asset identification; the third transaction is used for destroying the digital assets corresponding to the unique asset identification on the account address of the gifted user.
2. The method of claim 1, further comprising:
responding to the third user to input the two-dimension code of the donation user, and obtaining the account address of the donation user according to the two-dimension code of the donation user;
returning the account address of the donating user to the third user.
3. The method of claim 1 or 2, further comprising:
receiving an account creation request input by the donation user; the account creation request includes a name of the donating user;
creating a block chain account for the donation user, and generating a two-dimensional code of the donation user according to an account address of the block chain account;
and returning the two-dimension code of the donation user to the donation user.
4. The method of claim 1 or 2, further comprising:
receiving an account creation request input by any user; the account creation request includes a name of the arbitrary user;
creating a block chain account for any user, and generating a two-dimensional code of any user according to an account address;
generating a JWT of the arbitrary user according to the name and the account address of the arbitrary user;
returning the two-dimension code and the JWT of the arbitrary user to the arbitrary user;
determining digital assets corresponding to the goods according to the goods information in response to the third user inputting the goods information and the account address of the donation user, including;
and in response to the third user inputting the JWT of the third user, the goods and materials information and the two-dimensional code of the donation user, determining the digital assets corresponding to the goods and materials according to the goods and materials information.
5. The method of claim 1, further comprising:
and after the material donation result is determined as the first donation result, generating a visual certificate according to the material information and the material donation result.
6. A block chain-based material donation method is characterized by comprising the following steps:
the first node processing server responds to the third user input material information and the first transaction initiated by the account address of the donation user; the first transaction is for issuing a digital asset to an account address of a donating user; the digital assets are defined as the material information;
the first node generates a unique asset identifier according to the definition of the digital asset;
the first node sends the unique asset identification to the server;
the second node processing a second transaction initiated by the server in response to the donating user entering the unique asset identification and the account address of the recipient user; the second transaction is used for sending the digital assets corresponding to the unique asset identification on the account address of the donation user to the account address of the donated user;
the third node receiving a third transaction initiated by the server in response to the gifted user entering the unique asset identification; the third transaction is used for destroying the digital assets corresponding to the unique asset identification on the account address of the gifted user.
7. The method of claim 6, further comprising:
returning the unique transaction identifier of the first transaction to the server according to the first transaction so that the server determines the material donation result as a first donation result; the first donation result is used for identifying the fact that the third user confirms that the third user receives the materials donated by the donation user;
returning the unique transaction identifier of the second transaction to the server according to the second transaction so that the server determines the material donation result as a second donation result; the second donation result is used for indicating that the donation user confirms that the materials donated by the donation user accord with the material information corresponding to the digital assets;
returning the unique transaction identifier of the third transaction to the server according to the third transaction so that the server determines the material donation result as a third donation result; the third donation result is used to indicate that the recipient user confirms the receipt of the material.
8. A blockchain-based material donation system, comprising:
a first transaction module for adding the asset information to the definition of the digital asset and initiating a first transaction on the blockchain in response to a third user entering the asset information and an account address of a donating user; the first transaction is for issuing the digital asset to an account address of the donating user;
the asset identification receiving module is used for receiving a unique asset identification generated by the block chain according to the definition of the digital asset;
a second transaction module to initiate a second transaction at the blockchain in response to the donating user entering the unique asset identification and an account address of a recipient user; the second transaction is used for sending the digital assets corresponding to the unique asset identification on the account address of the donation user to the account address of the donated user;
a third transaction module to initiate a third transaction on the blockchain in response to the gifted user entering the unique asset identification; the third transaction is used for destroying the digital assets corresponding to the unique asset identification on the account address of the gifted user.
9. A server, characterized in that it comprises a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the blockchain-based donation method according to any one of claims 1 to 5.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the blockchain-based donation method according to one of claims 1 to 5.
CN202010239840.9A 2020-03-30 2020-03-30 Material donation method and system based on block chain, storage medium and server Pending CN111461715A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010239840.9A CN111461715A (en) 2020-03-30 2020-03-30 Material donation method and system based on block chain, storage medium and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010239840.9A CN111461715A (en) 2020-03-30 2020-03-30 Material donation method and system based on block chain, storage medium and server

Publications (1)

Publication Number Publication Date
CN111461715A true CN111461715A (en) 2020-07-28

Family

ID=71683425

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010239840.9A Pending CN111461715A (en) 2020-03-30 2020-03-30 Material donation method and system based on block chain, storage medium and server

Country Status (1)

Country Link
CN (1) CN111461715A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112053271A (en) * 2020-10-14 2020-12-08 腾讯科技(深圳)有限公司 Public service platform data evidence management method and system based on block chain
CN113222588A (en) * 2021-06-03 2021-08-06 支付宝(杭州)信息技术有限公司 Method, device and equipment for creating, updating and inquiring cash card based on block chain

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101784197B1 (en) * 2017-03-07 2017-11-06 유한회사 엘민벤처스 System and method of donating using assets including digital virtual money based on blockchain
CN109242477A (en) * 2018-06-28 2019-01-18 平安科技(深圳)有限公司 Charitable donation method, system and storage medium based on block chain
CN109447647A (en) * 2018-11-19 2019-03-08 上海趣链信息科技有限公司 A kind of safety payment system based on block chain
CN109583862A (en) * 2018-11-29 2019-04-05 广州大学 A kind of point-to-point internet public good management method and device based on block chain technology

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101784197B1 (en) * 2017-03-07 2017-11-06 유한회사 엘민벤처스 System and method of donating using assets including digital virtual money based on blockchain
CN109242477A (en) * 2018-06-28 2019-01-18 平安科技(深圳)有限公司 Charitable donation method, system and storage medium based on block chain
CN109447647A (en) * 2018-11-19 2019-03-08 上海趣链信息科技有限公司 A kind of safety payment system based on block chain
CN109583862A (en) * 2018-11-29 2019-04-05 广州大学 A kind of point-to-point internet public good management method and device based on block chain technology

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112053271A (en) * 2020-10-14 2020-12-08 腾讯科技(深圳)有限公司 Public service platform data evidence management method and system based on block chain
CN112053271B (en) * 2020-10-14 2022-01-28 腾讯科技(深圳)有限公司 Public service platform data evidence management method and system based on block chain
CN113222588A (en) * 2021-06-03 2021-08-06 支付宝(杭州)信息技术有限公司 Method, device and equipment for creating, updating and inquiring cash card based on block chain

Similar Documents

Publication Publication Date Title
US10824701B2 (en) System and method for mapping decentralized identifiers to real-world entities
JP6873270B2 (en) Handling of transaction activities based on smart contracts in the blockchain Caution Methods and devices for protecting data
US11277268B2 (en) System and method for verifying verifiable claims
US11165576B2 (en) System and method for creating decentralized identifiers
US11316697B2 (en) System and method for issuing verifiable claims
US20220092586A1 (en) Off network identity tracking in anonymous cryptocurrency exchange networks
CN112003858B (en) Block chain-based platform docking method, electronic device and storage medium
WO2019127532A1 (en) Blockchain-based crowdfunding information processing method and device, storage medium and electronic device
US20210099431A1 (en) Synthetic identity and network egress for user privacy
EP4002786B1 (en) Distributed ledger system
CN111476572A (en) Data processing method and device based on block chain, storage medium and equipment
US11856107B2 (en) Methods and systems for exchanging confidential information via a blockchain
CN111460457A (en) Real estate property registration supervision method, device, electronic equipment and storage medium
CN111460400A (en) Data processing method and device and computer readable storage medium
CN111131234A (en) Intelligent contract data processing method and device in supply chain and computer equipment
CN111461715A (en) Material donation method and system based on block chain, storage medium and server
CN111880919A (en) Data scheduling method, system and computer equipment
CN111461882A (en) Public good material donation method, system, computer readable storage medium and server
CN112528268B (en) Cross-channel applet login management method and device and related equipment
CN115801317A (en) Service providing method, system, device, storage medium and electronic equipment
EP4022872B1 (en) Distributed ledger system
CN112948789B (en) Identity authentication method and device, storage medium and electronic equipment
CN109688158B (en) Financial execution chain authentication method, electronic device and storage medium
CN110830449B (en) File processing method and device, electronic equipment and readable storage medium
CN117061089B (en) Voting management method, device, equipment and storage medium

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
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20200728