CN112435121A - Token transaction method and device based on block chain, electronic equipment and storage medium - Google Patents
Token transaction method and device based on block chain, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN112435121A CN112435121A CN202011277424.4A CN202011277424A CN112435121A CN 112435121 A CN112435121 A CN 112435121A CN 202011277424 A CN202011277424 A CN 202011277424A CN 112435121 A CN112435121 A CN 112435121A
- Authority
- CN
- China
- Prior art keywords
- token
- transaction
- token transaction
- tokens
- intelligent contract
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/382—Payment protocols; Details thereof insuring higher security of transaction
- G06Q20/3829—Payment protocols; Details thereof insuring higher security of transaction involving key management
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/50—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
Abstract
The application relates to the technical field of online transactions, in particular to a token transaction method and device based on a block chain, electronic equipment and a storage medium. The token transaction method based on the block chain comprises the following steps: receiving a token transaction request of a user; analyzing the token transaction request, and acquiring token transaction contents carried in the token transaction request; performing transaction processing on the token transaction content based on the market maker intelligent contract accessed to the blockchain network to obtain a corresponding token transaction result; sending the token transaction result to the user. In the application, the automatic transaction of the token is realized, and the decentralization is realized by introducing and combining the blockchain network, so that the monopolization is avoided, the transaction peer performance and the data stability are improved, and the transaction safety is improved.
Description
Technical Field
The application relates to the technical field of online transactions, in particular to a token transaction method and device based on a block chain, electronic equipment and a storage medium.
Background
At present, in the trading of various commodities, a centralized large mechanism generally plays the role of a market maker, and common users trade with the market maker through a centralized trading system. However, for market makers with centralized large organizations, professional organizations need to operate, and for this reason, the organization operation and transaction costs are high; and the transaction between assets needs to be matched and completed through a centralized market maker transaction system, so that the automated transaction cannot be realized, and the transaction is complicated. Based on this, how to realize the automatic transaction of the token becomes a technical problem which needs to be solved urgently at present.
Disclosure of Invention
The application provides a token transaction method and device based on a block chain, electronic equipment and a storage medium, so as to realize automatic transaction of tokens.
In a first aspect, a token trading method based on a blockchain is provided, in which a market maker intelligent contract is connected to a blockchain network, and the method includes:
receiving a token transaction request of a user;
analyzing the token transaction request, and acquiring token transaction contents carried in the token transaction request;
performing transaction processing on the token transaction content based on the market maker intelligent contract accessed to the blockchain network to obtain a corresponding token transaction result;
sending the token transaction result to the user.
In one possible implementation, the token transaction content includes a token transaction category, a token transaction amount, and a transaction ID.
In one possible implementation, the transacting the token transaction content based on the market maker smart contract accessed on a blockchain network to obtain a corresponding token transaction result includes:
inquiring the market maker intelligent contract accessed to the blockchain network according to the token transaction content to determine the transaction intention of each token transaction party;
and determining the token transaction party matched with the token transaction content to perform transaction according to the transaction intention to obtain a corresponding token transaction result.
In one possible implementation, the transacting the token transaction content based on the market maker smart contract accessed on a blockchain network to obtain a corresponding token transaction result includes:
inquiring the market maker intelligent contract accessed to the block chain network according to the token transaction content, and determining the number of tokens to be traded in an asset pool corresponding to the token transaction content;
and carrying out token transaction according to the token transaction content and the number of tokens to be transacted in the asset pool to obtain a corresponding token transaction result.
In one possible implementation, before receiving the token transaction request of the user, the method further includes:
issuing tokens to enable the user to construct a token transaction request for a target token from the issued tokens;
the issuing token, comprising:
constructing a token issuance intelligent contract based on the token issuer's instructions;
uploading the constructed token issuance intelligent contract onto the blockchain network to issue tokens to be issued through the token issuance intelligent contract.
In one possible implementation, the building of a token issuance intelligent contract based on an indication of a token issuer includes:
acquiring a public and private key pair carried in the indication;
encrypting an account of the token issuer based on the public and private key;
constructing a token intelligent issuing contract based on the indication, wherein the token intelligent issuing contract comprises parameter information of tokens to be issued;
an association between the encrypted account and the token issuance smart contract is constructed.
In a second aspect, there is provided a token transaction apparatus based on a blockchain, wherein a market maker intelligent contract is connected to a blockchain network, the apparatus comprising:
a receiving module for receiving a token transaction request of a user;
the processing module is used for analyzing the token transaction request and acquiring token transaction contents carried in the token transaction request;
the trading module is used for carrying out trading processing on the token trading content based on the market maker intelligent contract accessed to the block chain network to obtain a corresponding token trading result;
a sending module for sending the token transaction result to the user.
In one possible implementation, the token transaction content includes a token transaction category, a token transaction amount, and a transaction ID.
In one possible implementation, the transaction module is configured to query the market maker intelligent contract accessed to the blockchain network according to the token transaction content, and determine the transaction intention of each token transaction party; and determining the token transaction party matched with the token transaction content to perform transaction according to the transaction intention to obtain a corresponding token transaction result.
In one possible implementation manner, the transaction module is used for inquiring the market maker intelligent contract accessed to the blockchain network according to the token transaction content and determining the number of tokens to be traded in an asset pool corresponding to the token transaction content; and carrying out token transaction according to the token transaction content and the number of tokens to be transacted in the asset pool to obtain a corresponding token transaction result.
In one possible implementation, the method further includes:
an issuing module for issuing a token so that the user constructs a token transaction request of a target token according to the issued token;
the issuing module is used for constructing a token issuing intelligent contract based on the indication of the token issuer; uploading the constructed token issuance intelligent contract onto the blockchain network to issue tokens to be issued through the token issuance intelligent contract.
In one possible implementation, the issuing module is specifically configured to obtain a public-private key pair carried in the indication; encrypting an account of the token issuer based on the public and private key; constructing a token intelligent issuing contract based on the indication, wherein the token intelligent issuing contract comprises parameter information of tokens to be issued; an association between the encrypted account and the token issuance smart contract is constructed.
In a third aspect, an electronic device is provided, including: a processor and a memory;
the memory for storing a computer program;
the processor is used for executing the token transaction method based on the block chain by calling the computer program.
In a fourth aspect, there is provided a computer-readable storage medium for storing a computer program which, when run on a computer, enables the computer to perform the above-described blockchain-based token transaction method.
By means of the technical scheme, the technical scheme provided by the application at least has the following advantages:
in the application, the automatic transaction of the token is realized, and the decentralization is realized by introducing and combining the blockchain network, so that the monopolization is avoided, the transaction peer performance and the data stability are improved, and the transaction safety is improved.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the embodiments of the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a schematic flow chart of a token transaction method based on a blockchain provided herein;
FIG. 2 is a detailed process flow diagram of one possible implementation of a blockchain based token transaction method provided herein;
FIG. 3 is a block chain based token transaction device configuration diagram provided herein;
fig. 4 is a schematic structural diagram of an electronic device of a token transaction method based on a blockchain according to the present application.
Detailed Description
The present application provides a token transaction method, apparatus, electronic device and storage medium based on a block chain, and the following describes in detail embodiments of the present application with reference to the accompanying drawings.
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
It will be understood by those within the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
As shown in fig. 1, a schematic flow chart of a token transaction method based on a blockchain provided by the present application is provided, in which a market maker intelligent contract is connected to a blockchain network, and the method includes the following steps:
step S101, receiving a token transaction request of a user;
step S102, analyzing the token transaction request and acquiring token transaction contents carried in the token transaction request;
step S103, carrying out transaction processing on the token transaction content based on the market maker intelligent contract accessed to the block chain network to obtain a corresponding token transaction result;
step S104, the token transaction result is sent to the user.
In the application, the automatic transaction of the token is realized, and the decentralization is realized by introducing and combining the blockchain network, so that the monopolization is avoided, the transaction peer performance and the data stability are improved, and the transaction safety is improved.
Based on the technical solution provided in the present application, the following explains the technical solution in detail, as shown in fig. 2, which is a specific processing flow chart of one possible implementation of the token transaction method based on the blockchain provided in the present application.
Before the above explanation of the technical solution of the present application, a blockchain network related thereto is first explained, and the architecture of the blockchain network system of the present application is generally divided into three layers: bottom-level services, core-level, and top-level applications.
The underlying services include P2P web services, databases, cryptographic algorithms, and other basic services. Based on a P2P network, all nodes are peer-to-peer and run the same node program; the data of blocks, transactions and the like are finally stored in the database; the cryptographic algorithm is used for ensuring the privacy of data and the safety of a block chain; the block chain system is made to run smoothly by these underlying services together.
The core layer comprises core elements such as a block chain, a consensus algorithm, a virtual machine and the like, the block chain technology is taken as a main body, the consensus algorithm is combined, and the virtual machine is taken as a carrier for running an intelligent contract; this layer is the core component of the entire blockchain network system; based on the decentralized distributed account book, the whole system can be guaranteed to operate effectively, the account book data on all the nodes keep the consistency and correctness of the data according to the preset rules, and the legality of the transaction is agreed between the nodes which are not trusted with each other.
And the top-level application comprises an API (application programming interface), intelligent contracts, decentralized applications and the like, and all the intelligent contracts run on the virtual machine. The enterprise can realize the special intelligent contract according to the business logic of the enterprise, so as to help the enterprise to execute the business efficiently.
The data of transaction, block and the like are stored in the database of the bottom-layer service, the cryptographic algorithm is used for encrypting block generation, transaction transmission and the like, the consensus algorithm is used for solving the consistency of accounts among P2P network nodes, and the decentralized application in the top-layer application needs to be executed on a virtual machine, so that the structures of all layers cooperate with each other and each plays its own role to form a complete block chain network system.
For the present application, in one possible implementation, the processing of step S101 described above specifically includes the processing of step S201 to step S202 described below.
In step S201, a token is issued.
In one possible implementation, a user issues tokens as a token issuer. Specifically, a public and private key pair is generated as a token issuer, the generated public and private key pair is sent to a market maker system through indication information, a surgery making system encrypts an account of the token issuer according to the public and private key pair, a token issuing intelligent contract of the token issuer is constructed based on ERC20 protocol specifications, basic parameters of a token to be issued are set, and then an association relation between the encrypted account and the token issuing intelligent contract is constructed, and the token required to be issued by the token issuer is issued to a blockchain network through the token issuing intelligent contract.
In one embodiment, the process of issuing tokens may be divided into 3 parts:
(1) a user generates a public and private key pair for encrypting a management account;
generating a 256-bit account private key (256-bit, 32 bytes in 16) from the pseudorandom number; mapping the private key (32 bytes) to the public key (65 bytes) by an elliptic curve digital signature algorithm; an address is generated by performing a hash operation on the public key (taking the last 20 bytes of the result after the hash operation as the address).
(2) Constructing a token issuing intelligent contract;
the user creates new token through market maker system and issues intelligent contract, such as: sol is named as Currency exchange;
the interface standard defined by the ERC20 protocol is as follows:
in the constructor of the contract above, totalSupply number is specified and all initial tokens are assigned to the msg.
(3) And compiling contract codes according to the defined interface, selecting an account number for deploying the contract after the compiling is successful, executing contract deployment transaction, and issuing a token to issue an intelligent contract to a block chain network.
The above scheme is illustrated below by a specific embodiment, such as the first specific embodiment.
Detailed description of the preferred embodiment
The currency is issued based on a unified standard, and the ERC-20 standard is selected in the application. The following steps are token issuing processes:
user a builds a smart contract for issuing tokens:
the AllOfToken intelligent contract functions are as follows:
defining an ERC-20 standard interface;
the AllOfToken intelligent contract implements the standard interface of ERC-20:
initializing the attribute: specify token name AllOfToken, token abbreviation symbol: AOT, minimum unit of transactable token decimal point, 0.000000000000000001decimals-18 digits, total token issued amount totalSupply-100000000, and the account initializing the token will own all tokens;
token transfer transaction transfer for transferring tokens from one address to another:
checking whether the to address of the receiver is legal;
checking whether the sender's from balance is sufficient;
checking whether the balance of the to address of the receiver is overflowed;
calculating the sum of the sender from balance and the balance of the recipient to address previousBalances;
deducting the sender account balance;
increasing the account balance of the receiver;
triggering a token transfer transaction event;
and comparing whether the sum of the balance of the sender from and the balance of the receiver to address after the dynamic account is consistent with the balance before the dynamic account and previousBalances or not, if not, the transaction fails, and terminating the transaction.
Authorizing transfer transaction transfer from, token holding account authorizing, target account to may obtain authorized amount of tokens from authorized person from:
checking whether the address of the authorized person and the address of the target person are legal;
checking whether the account balance of the authorized person is sufficient;
checking whether the amount of the authorized person is enough;
checking whether the balance of the target account is overflowed;
deducting the amount of the authorized person;
deducting the account balance of the authorized person;
increasing the balance of the target account;
triggering a token transfer transaction event to be monitored by a contract listener.
Authorizing an account may obtain the balance of the token holding account:
setting an authorized accessible token number;
and triggering an Approval event to be monitored by a contract monitor.
And inquiring the authorized surplus amount.
Sol, the intelligent contract code issuetoken is developed according to the above functions as follows:
after the codes are compiled, selecting the compiled IssueToken contract to compile;
a contract creation transaction is executed, which deploys the coin-out transaction to the blockchain network.
Of course, the above specific examples are only provided for illustrating a preferred embodiment of the present application in detail, and any other examples capable of implementing the above embodiments of the present application are within the scope of the present application.
In step S202, a token transaction request from a user is received.
In one possible implementation, after a token issuer issues a token, a user views a desired token by browsing a market maker system, and constructs a token transaction request for the desired token and sends the token transaction request to the market maker system.
For the present application, in one possible implementation, the aforementioned processing of step S102 specifically includes the processing of step S203 described below.
Step S203, obtaining the token transaction content carried in the token transaction request.
In one possible implementation, upon receiving a token transaction request sent by a user, the token transaction request is analyzed for token transaction content carried therein. The token transaction content may include a token transaction type, a token transaction amount, and a transaction ID, and may also carry an asset pool address corresponding to the token transaction.
For the present application, in one possible implementation, the processing of step S103 specifically includes the processing of step S204 to step S205 described below.
Among them, the above mentioned token transaction may include two transaction modes, i.e., a sales transaction of the token and an injection/withdrawal of the token, which are explained below separately.
For token trading transactions, including:
in step S204, the transaction intention is determined according to the transaction contents of the token.
In one possible implementation, after obtaining token transaction content, a market maker intelligent contract is queried to determine transaction intent of each token transaction party based on a blockchain network. The system carries out market maker intelligent contract and involves the processing of market maker algorithm when determining trading intention.
The target is as follows:
the cost function V is kept at a constant value (the pre-trade cost function is equal to the post-trade cost function).
And automatically adjusting the exchange relationship among the tokens through a market maker algorithm according to the liquidity of the tokens in the current asset pool.
Wherein the content of the first and second substances,
t represents a token range in the asset pool;
Btrepresenting a balance of tokens in the asset pool;
Wtrepresenting the normalized weight of the token.
The principle is as follows:
calculating the amount A of tokens o obtained when a trader sends a certain amount of tokens i through a market maker algorithmoIs what.
Wherein the content of the first and second substances,
k represents a token range in the asset pool;
Bkrepresenting a balance of tokens in the asset pool;
Wkrepresents a normalized weight of the token;
Borepresents the balance of token o, which the trader would buy from the pool;
Aorepresents the number of tokens o purchased by the trader;
Worepresents the weight of token o;
Birepresents the balance of token i, which the trader entering the pool would sell;
Airepresents the number of tokens sold by the trader;
Wirepresenting the weight of token i.
Calculating how many tokens i a trader sends to obtain a desired number of tokens o through an automated market maker algorithm
From the reasoning process described above, it can be seen that the value share of each token in the asset pool remains constant.
For the market maker intelligent contract, the following characteristics are provided:
(1) and (3) automatic adjustment of quotation: based on the market maker algorithm, an on-demand price, i.e., a theoretical price for the minimum trade, is calculated based on the weight and balance of the token, which does not generate any slip. In fact, the effective price for any transaction depends on the transaction amount, which always results in a price change. When the transaction amount approaches 0, the effective price tends to the spot price, namely the spot price and the token price, and the specific calculation process is shown in the scheme that the spot price is in the following schemeAnd (4) calculating.
(2) Token transaction: when a trading party purchases and sells the token through a market maker intelligent contract, the exchange quantity between the tokens is calculated based on the market maker algorithm and according to the invariant rule of the value function before and after trading, and therefore the automatic token trading is completed.
(3) Asset management: interacting with liquidity providers, allowing any liquidity provider to inject and withdraw assets in different ways (all assets and single assets) into the fund pool of a market maker's smart contract, improving fund liquidity.
The above scheme is illustrated below by a specific embodiment, such as specific embodiment two.
Detailed description of the invention
User a creates the token pool by himself to provide token liquidity and obtain the transaction fee benefits paid by the trader for each transaction.
First, user a associates his wallet account 0x1016f75c54c607f082ae6b0881fac0abeda 21781;
user a creates a token pool:
setting a value function algorithm:
selecting five tokens of VBI, ESC, WESH, UIK and WFT to be added into the token pool;
and calculate the weight of each token in the token pool (which can be added according to any proportion) as follows:
a calculation function V is defined according to the cost function, V being initialized to a constant value:
V=14.026.00%*14.026.00%*100.4843.00%*39.7217.00%*65.4328.00%
≈1.171669*1.171669*7.259292*1.869957*3.224167
≈60.083233
the rate for the token pool is set to 0.07%, which determines the extra transaction cost that the trader needs to pay for each transaction, i.e., the percentage of revenue that the liquidity provider can earn;
token pool creation is complete, generating token pool address: 0x66Cb5458ef540ade6068dfe2f4e8fa7333 FcbB.
Of course, the above specific examples are only provided for illustrating a preferred embodiment of the present application in detail, and any other examples capable of implementing the above embodiments of the present application are within the scope of the present application.
In step S205, a token transaction is performed.
In one possible implementation, after determining the transaction intent of a token, a respective token transaction is conducted, resulting in a corresponding token transaction result.
In one embodiment, the token transactions described above may be described separately in specific instances.
(1) The amount of token o available to the trader for sending token i
The trader sends a request for exchanging the token to the market maker intelligent contract; wherein, the request information: transaction ID, buy tokens, sell token quantity.
The market maker intelligent contract analyzes the request information and automatically adjusts the price of the token;
on-demand priceEach pair of tokens in the asset pool has an on-demand price, the on-demand price between any two tokens is the ratio of token balances normalized by their weights, and is calculated as follows:
wherein the content of the first and second substances,
Birepresents the balance of token i, which the trader entering the pool would sell;
Borepresents the balance of token o, which the trader would buy from the pool;
Wirepresents the weight of token i;
Worepresenting the weight of token o.
Effective priceThe effective price for any transaction depends on the transaction amount, which always results in a price change. The calculation formula is as follows:
as above, when the transaction amount tends to 0, the EP tends to SP:
wherein the content of the first and second substances,
Aorepresents the number of tokens o purchased by the trader;
Airepresenting the number of tokens i sold by the trader.
The intelligent contract of the market maker calculates the quantity of the tokens o which can be obtained by the token i according to the invariant rules of the value function before the transaction and the value function after the transaction, and the calculation method is as the following specific embodiment;
redeem successfully and exchange token o (quantity A)o) And returning to the trader.
(2) How many tokens a the trader sendsiA desired number of tokens a can be obtainedo
The trader sends a request for exchanging the token to the intelligent contract of the automatic market maker;
request information: transaction ID, buy tokens, sell token quantity
The intelligent contract of market maker analyzes the request information and automatically adjusts the effective price of the token, and the specific calculation method is the same as the on-demand priceThe calculation method of (1);
calculating the quantity A of the token i obtained by the token o according to the invariance of the value function before the transaction and the value function after the transactioni;
Exchange successfully, and exchange token i (quantity A)i) And returning to the trader.
The above scheme is illustrated below by a specific embodiment, such as the third embodiment.
Detailed description of the preferred embodiment
The token transactions are as follows:
after selecting selling currency, selling quantity and buying currency, the user B sends a token purchasing request to a market maker intelligent contract in the block chain, wherein the token purchasing request comprises a transaction ID, a token buying request, a token selling request and a token selling amount {0135366759, VBI, WESH, 2.003005220767003784 };
the market maker smart contract parses the request and all other token balances remain unchanged while user B sends token WESH to get token VBI. Calculating the number of VBI tokens that can be purchased by 2.003005220767003784 WESH tokens;
knowing that the value function after a transaction should be the same as before the transaction, the formula is derived as follows:
sales volume of token WESH sold by Ai: ai is 2.003005220767003784
Bo is the current balance of the sold token WESH: bo 100.48
Bi is the current balance of the VBI of the purchased token: bi ═ 14.02
Wo is the weight of sold token WESH: wo 43.00%
Wi is the weight of the buy token VBI: wi is 6.00%
Calculate the buy amount Ao of buying token VBI:
the income earned by the liquidity provider is determined according to the rate of 0.07%.
Of course, the above specific examples are only provided for illustrating a preferred embodiment of the present application in detail, and any other examples capable of implementing the above embodiments of the present application are within the scope of the present application.
For token injection/extraction, including:
step S204', the number of the tokens to be traded is determined according to the token trading content.
In one possible implementation, upon obtaining token transaction content, a market maker intelligent contract is queried to determine a quantity of tokens to be traded in the asset pool corresponding to the token transaction content based on the blockchain network. Wherein the token transaction may be an injection of a token asset or a withdrawal of a token asset and the subject of the initiated transaction also becomes a liquidity provider. Interacting with market makers' intelligent contracts, liquidity providers can inject or redeem tokens into or from a pool of assets in two ways: the two modes are respectively as follows: all asset injection/extraction and single asset injection/extraction.
All asset injection/extraction: the fill/withdrawal number of each token is calculated based on the weight of the tokens present in the pool, and when the liquidity provider fills or withdraws assets that include each token present in the pool by a percentage, the merit function will increase or decrease by the corresponding percentage.
Single asset injection: the token can be filled as long as the token exists in the asset pool, the filling is successful, the cost function is updated, and the token supply amount of the asset pool is guaranteed to be increased in proportion to the increase of the cost function.
Single asset extraction: the merit function is updated based on the proportional share of the total assets the token holder desires to redeem in the pool of assets, and the amount of tokens that can be exchanged is deduced from the updated merit function.
In step S205', a token transaction is performed.
In one possible implementation, after determining the number of tokens to be traded, the respective token transaction is conducted, resulting in a corresponding token transaction result.
In one embodiment, the token asset injection/extraction described above may be separately described in specific examples.
(1) Single asset injection mobility flow:
the liquidity provider sends a single asset injection request to an intelligent contract of a market maker; wherein the request information includes a transaction ID, a type of deposited token, a quantity of deposited token, and an asset pool address.
And the market maker intelligent contract analyzes the request information, injects the assets into the asset pool according to the request information, and updates the cost function, so that the increase of the token supply amount of the asset pool is in direct proportion to the increase of the cost function.
Wherein the content of the first and second substances,
v' represents a cost function after injection;
v represents a cost function before injection;
P'supplyrepresents the total amount of asset pool tokens after injection;
Psupplyrepresents the total amount of asset pool tokens prior to injection;
Pissuedrepresenting the total amount of newly added asset pool tokens.
Meanwhile, consider B'kIs the balance of the asset k after injection, BkIs the balance of the asset k before injection, WkIs the normalized weight of the token; then:
assuming that a single asset injection is done in asset t, the balances of all other tokens do not change after the injection. Then:
wherein the content of the first and second substances,
Btrepresents the total amount of tokens t in the pre-fill asset pool;
B'trepresents the total amount of tokens t in the post-injection asset pool;
Wtrepresents the normalized weight of the token, so the sum of all normalized weights is 1.
At number of assets t injected, then the total amount of assets t after injection is B't=Bt+At. The final formula for the token issue amount:
and the market maker intelligent contract returns successful information of the injected asset pool to the liquidity provider and records the share of the liquidity provider in the asset pool.
(2) Single asset extraction fluidity flow:
the liquidity provider sends a single asset extraction request to an intelligent contract of a market maker; wherein, the request information: transaction ID, token type draw, number of tokens drawn, asset pool address.
The market maker intelligent contract analyzes the request information, updates the value function according to the proportion of the total assets of the redeeming token in the asset pool expected by the liquidity provider, and calculates the quantity A of the redeeming token through the updated value functiont。
Wherein the content of the first and second substances,
Btrepresents the total amount of tokens t in the asset pool before withdrawal;
Predeemedrepresenting the total amount of redeemed asset pool tokens;
Psupplyrepresenting the total amount of asset pool tokens prior to withdrawal.
WtRepresents the normalized weight of the token, so the sum of all normalized weights is 1.
The single asset extraction was successful and the extracted tokens were returned to the liquidity provider.
(3) All asset injection mobility flow:
the liquidity provider sends an injection request of all assets to the market maker intelligent contract; wherein, the request information: transaction ID, type of token injected, number of tokens injected, asset pool address.
The market maker intelligent contract analyzes the request information, and the quantity D of each token in the pool is calculated according to the distribution condition of the existing assets in the asset poolkThe calculation formula is as follows:
wherein the content of the first and second substances,
Psupplyrepresenting the total amount of existing asset pool tokens;
Pissuedrepresenting a total amount of newly added asset pool tokens;
Bkrepresents the total amount of tokens k in the asset pool prior to injection.
When the assets injected by the liquidity provider comprise each token existing in the asset pool and account for a certain percentage, the cost function is increased by the corresponding percentage, and the outstanding supply amount of the asset pool token is in direct proportion to the asset pool cost function, so that the outstanding supply amount of the asset pool token is also increased by the corresponding percentage.
And the market maker intelligent contract returns all the asset injection success information to the liquidity provider and records the share of the liquidity provider in the asset pool.
(4) All asset extraction mobility flow:
the liquidity provider sends an extraction request of all assets to an intelligent contract of a market maker; wherein, the request information: transaction ID, token type draw, number of tokens drawn, asset pool address.
The market maker intelligent contract analyzes the request information, and each token in the computing pool is extracted according to the distribution condition of the existing assets in the asset poolNumber of taking AkThe calculation formula is as follows:
wherein the content of the first and second substances,
Psupplyrepresenting the total amount of existing asset pool tokens;
Predeemedrepresenting a total amount of draw asset pool tokens;
Bkrepresenting the total amount of tokens k in the asset pool prior to withdrawal.
Wherein, when the liquidity provider extracts assets that include each token present in the asset pool in a certain percentage, the cost function is reduced by the corresponding percentage. The outstanding supply of tokens in the asset pool is proportional to the asset pool cost function, and the outstanding supply of asset pool tokens is also reduced by a corresponding percentage.
All asset withdrawals were successful and the withdrawn tokens were returned to the liquidity provider.
The above scheme is illustrated below by a specific example, such as the fourth specific example.
Detailed description of the invention
1. The user B performs token pool management operation;
2. user B selects a liquidity asset pool to be added, and the asset pool addresses are as follows: 0x66Cb5458ef540ade6068dfe2f4e8fa7333FcbB, making deposit and withdrawal operation, namely initiating a request to the market maker intelligent contract, analyzing the request information and processing the request information;
1) deposit and withdrawal of all assets:
A. the value function will increase by 10% for all deposits of the asset, the deposits containing 10% of each asset already in the asset pool.
The outstanding supply of the asset pool token is proportional to the value function of the pool, then the outstanding supply of the asset pool token is also increased by 10%:
the known conditions are:
serial number | Token coin | Weight of | Balance of token S |
1 | VBI | 6.00% | 14.02 |
2 | ESC | 6.00% | 14.02 |
3 | WESH | 43.00% | 100.48 |
4 | UIK | 17.00% | 39.72 |
5 | WFT | 28.00% | 65.43 |
Total supply of existing asset pool tokens: 189.33 Psupply
Calculating a new asset pool token: pissued ═ Psupply%
Current unpaid pool token supply: pnoasset 49.55
Following the allocation of the existing assets in the pool of assets, Dk tokens are stored for each token in the pool, the calculation formula is as follows:
token VBI balance SVBI + DVBI 14.02+ 10% 14.02 15.422
Token ESC balance SESC + DESC 14.02+ 10% 14.02 15.422
Token WESH balance SWESH + DWESH 100.48+ 10% 100.48-110.528
Token UIK balance SUIK + DUIK 39.72+ 10% × 39.72 ═ 43.692
Token WFT balance SWFT + DWFT 65.43+ 10% 65.43 71.973
Serial number | Token coin | Weight of | Balance of token S |
1 | VBI | 6.00% | 15.422 |
2 | ESC | 6.00% | 15.422 |
3 | WESH | 43.00% | 110.528 |
4 | UIK | 17.00% | 43.692 |
5 | WFT | 28.00% | 71.973 |
The automated market maker smart contract returns all asset injection success information (transaction ID, amount of each token deposited in the pool) to user B and records the share of the token holder in the asset pool:
{0134998334,VBI:1.402,ESC:1.402,WESH:10.048,UIK:3.972, WFT:6.543}
B. withdrawal of all assets, weighted asset withdrawal is the reverse operation of all asset deposits, i.e., the pool token holder redeems its asset pool tokens (10% of the total supply) in exchange for a proportional share of each asset in the pool:
the known conditions are:
serial number | Token coin | Weight of | Balance of token S |
1 | VBI | 6.00% | 14.02 |
2 | ESC | 6.00% | 14.02 |
3 | WESH | 43.00% | 100.48 |
4 | UIK | 17.00% | 39.72 |
5 | WFT | 28.00% | 65.43 |
Total supply of existing asset pool tokens: psupply
Redemption asset pool token Predefemeted 10%
Given the existing total supply of Psupply, an Ak number of tokens k can be extracted from the pool for each pool token by redeeming the preferred asset pool token, the formula being:
token VBI balance SVBI-DVBI 14.02-1.402 12.618
Token ESC balance SESC-DESC 14.02-1.402 12.618
Token WESH balance SWESH-DWESH 100.48-10.048 90.432
Token UIK balance SUIK-DUIK 39.72-3.972 35.748
Token WFT balance SWFT-DWFT 65.43-6.543 58.887
User B obtains 10% of the current unpaid asset pool token supply:
Pnoasset*10%=49.55*10%=4.955
the automated market maker intelligent contract returns information on the amount of each asset pool token extracted (transaction ID, amount of each token in the pool to extract the asset pool tokens) to user B:
{0134998335,VBI:1.402,ESC:1.402,WESH:10.048,UIK:3.972, WFT:6.543}
2) single asset deposit and withdrawal:
A. single asset deposit:
user B deposits a single class of assets WESH into a shared pool, equivalent to depositing all pool assets in proportion, and then sells more assets WESH to reclaim all other tokens deposited:
the known conditions are:
the number of asset pool tokens used to deposit a single class of asset tokens WESH into the shared pool, the number of asset pool tokens issued for a deposit reward, may be calculated as follows:
total quantity of newly added asset pool tokens Pissued
Total asset pool token amount before injection Psupply 189.33
At is the amount At 200.96 of the deposited coin WESH
Bt is the balance Bt of the predeposit token WESH 100.48
W' is the weight taken by the token WESH: w' 43.00%
The automatic market maker intelligent contract returns successful information of filling the asset pool to the user B (transaction ID, token for short, the total amount of the newly added asset pool token) and records the share of the user B in the asset pool.
{0134998336,WESH:114.326}
B. Single asset withdrawal:
user B wishes to redeem his asset pool token preemed in exchange for a single class of asset WESH:
the known conditions are:
at is the token balance of the extracted asset WESH, which can be calculated as follows:
bt is the token balance of the asset WESH 100.48 before withdrawal
To total pool tokens before withdrawal: 189.33 Psupply
Redemption asset pool total amount of tokens: predememed 114.326
Wt asset WESH takes weight: 43.00 percent
The single asset extraction is successful and the token balance At (transaction ID, token amount for short, extracted asset pool token amount) of the extracted asset WESH is returned to the user B.
{0134998337,WESH:72.339}
Of course, the above specific examples are only provided for illustrating a preferred embodiment of the present application in detail, and any other examples capable of implementing the above embodiments of the present application are within the scope of the present application.
In the application, the automatic transaction of the token is realized, and the decentralization is realized by introducing and combining the blockchain network, so that the monopolization is avoided, the transaction peer performance and the data stability are improved, and the transaction safety is improved.
Based on the above technical solution of the token transaction method based on the block chain provided by the present application, the present application correspondingly provides a schematic structural diagram of a token transaction device based on the block chain, as shown in fig. 3, a market maker intelligent contract in the token transaction device 30 based on the block chain of the present application is connected to the block chain network, and the device may include:
a receiving module 31 for receiving a token transaction request of a user;
the processing module 32 is used for analyzing the token transaction request and acquiring token transaction contents carried in the token transaction request;
the trading module 33 is used for carrying out trading processing on the token trading content based on the market maker intelligent contract accessed to the block chain network to obtain a corresponding token trading result;
a sending module 34 for sending token transaction results to the user.
In one possible implementation, the token transaction content includes a token transaction category, a token transaction amount, and a transaction ID.
In one possible implementation, the trading module 33 is configured to query market maker intelligent contracts accessed on a blockchain network according to the trading content of the tokens, and determine the trading interest of each token trading party; and determining the token transaction party matched with the token transaction content to perform transaction according to the transaction intention, and obtaining a corresponding token transaction result.
In one possible implementation, the trading module 33 is configured to query a market maker intelligent contract accessed on the blockchain network according to the token trading content, and determine the number of tokens to be traded in the asset pool corresponding to the token trading content; and carrying out token transaction according to the token transaction content and the number of tokens to be transacted in the asset pool to obtain a corresponding token transaction result.
In one possible implementation, the method further includes:
an issuing module 35 for issuing tokens to enable a user to construct a token transaction request of a target token according to the issued tokens;
an issuing module 35 for constructing a token issuing intelligent contract based on an instruction of a token issuer; and uploading the constructed intelligent contract for issuing the tokens to the blockchain network so as to issue the tokens to be issued through the intelligent contract for issuing the tokens.
In one possible implementation, the issuing module 35 is specifically configured to obtain a public-private key pair carried in the indication; encrypting an account of a token issuer based on a public and private key; constructing a token intelligent issuing contract based on the indication, wherein the token intelligent issuing contract comprises parameter information of tokens to be issued; an association between the encrypted account and the token issuance intelligence contract is constructed.
In the application, the automatic transaction of the token is realized, and the decentralization is realized by introducing and combining the blockchain network, so that the monopolization is avoided, the transaction peer performance and the data stability are improved, and the transaction safety is improved.
Referring now to fig. 4, a block diagram of an electronic device (e.g., the terminal device of fig. 1) 400 suitable for implementing embodiments of the present application is shown. The terminal device in the embodiments of the present application may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 4, electronic device 400 may include a processing device (e.g., central processing unit, graphics processor, etc.) 401 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage device 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for the operation of the electronic apparatus 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
Generally, the following devices may be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 407 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 408 including, for example, tape, hard disk, etc.; and a communication device 409. The communication means 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. While fig. 4 illustrates an electronic device 400 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 409, or from the storage device 408, or from the ROM 402. The computer program, when executed by the processing device 401, performs the above-described functions defined in the methods of the embodiments of the present application.
It should be noted that the computer readable medium mentioned above in the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring at least two internet protocol addresses; sending a node evaluation request comprising the at least two internet protocol addresses to node evaluation equipment, wherein the node evaluation equipment selects the internet protocol addresses from the at least two internet protocol addresses and returns the internet protocol addresses; receiving an internet protocol address returned by the node evaluation equipment; wherein the obtained internet protocol address indicates an edge node in the content distribution network.
Alternatively, the computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving a node evaluation request comprising at least two internet protocol addresses; selecting an internet protocol address from the at least two internet protocol addresses; returning the selected internet protocol address; wherein the received internet protocol address indicates an edge node in the content distribution network.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or backend server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the disclosure. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.
The electronic device provided by the present application is applicable to any embodiment of the token transaction method based on the blockchain, and is not described herein again.
In the application, the automatic transaction of the token is realized, and the decentralization is realized by introducing and combining the blockchain network, so that the monopolization is avoided, the transaction peer performance and the data stability are improved, and the transaction safety is improved.
The present application provides a computer-readable storage medium storing a computer program that causes a computer to execute the token transaction method based on a blockchain shown in the above-described embodiments.
The computer-readable storage medium provided in the present application is applicable to any embodiment of the token transaction method based on the blockchain, and is not described herein again.
In the application, the automatic transaction of the token is realized, and the decentralization is realized by introducing and combining the blockchain network, so that the monopolization is avoided, the transaction peer performance and the data stability are improved, and the transaction safety is improved.
It will be understood by those within the art that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by computer program instructions. Those skilled in the art will appreciate that the computer program instructions may be implemented by a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, implement the aspects specified in the block or blocks of the block diagrams and/or flowchart illustrations disclosed herein.
The modules of the device can be integrated into a whole or can be separately deployed. The modules can be combined into one module, and can also be further split into a plurality of sub-modules.
Those skilled in the art will appreciate that the drawings are merely schematic representations of one preferred embodiment and that the blocks or flow diagrams in the drawings are not necessarily required to practice the present application.
Those skilled in the art will appreciate that the modules in the devices in the embodiments may be distributed in the devices in the embodiments according to the description of the embodiments, and may be correspondingly changed in one or more devices different from the embodiments. The modules of the above embodiments may be combined into one module, or further split into multiple sub-modules.
The above application serial numbers are for descriptive purposes only and do not represent the merits of the embodiments.
The disclosure of the present application is only a few specific embodiments, but the present application is not limited to these, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present application.
Claims (9)
1. A token transaction method based on a block chain is characterized in that a market maker intelligent contract is connected to a block chain network, and the token transaction method comprises the following steps:
receiving a token transaction request of a user;
analyzing the token transaction request, and acquiring token transaction contents carried in the token transaction request;
performing transaction processing on the token transaction content based on the market maker intelligent contract accessed to the blockchain network to obtain a corresponding token transaction result;
sending the token transaction result to the user.
2. The method of claim 1, wherein the token transaction content includes a token transaction category, a token transaction amount, and a transaction ID.
3. The method of claim 2, wherein the transacting the token transaction content based on the market maker intelligent contract accessed over a blockchain network to obtain a corresponding token transaction result comprises:
inquiring the market maker intelligent contract accessed to the blockchain network according to the token transaction content to determine the transaction intention of each token transaction party;
and determining the token transaction party matched with the token transaction content to perform transaction according to the transaction intention to obtain a corresponding token transaction result.
4. The method of claim 2, wherein the transacting the token transaction content based on the market maker intelligent contract accessed over a blockchain network to obtain a corresponding token transaction result comprises:
inquiring the market maker intelligent contract accessed to the block chain network according to the token transaction content, and determining the number of tokens to be traded in an asset pool corresponding to the token transaction content;
and carrying out token transaction according to the token transaction content and the number of tokens to be transacted in the asset pool to obtain a corresponding token transaction result.
5. The method of claim 1, wherein prior to receiving the user's token transaction request, further comprising:
issuing tokens to enable the user to construct a token transaction request for a target token from the issued tokens;
the issuing token, comprising:
constructing a token issuance intelligent contract based on the token issuer's instructions;
uploading the constructed token issuance intelligent contract onto the blockchain network to issue tokens to be issued through the token issuance intelligent contract.
6. The method of claim 5, wherein constructing a token issuance intelligent contract based on the token issuer's directives comprises:
acquiring a public and private key pair carried in the indication;
encrypting an account of the token issuer based on the public and private key;
constructing a token intelligent issuing contract based on the indication, wherein the token intelligent issuing contract comprises parameter information of tokens to be issued;
an association between the encrypted account and the token issuance smart contract is constructed.
7. A token transaction apparatus based on a blockchain, wherein a market maker intelligent contract is connected to a blockchain network, comprising:
a receiving module for receiving a token transaction request of a user;
the processing module is used for analyzing the token transaction request and acquiring token transaction contents carried in the token transaction request;
the trading module is used for carrying out trading processing on the token trading content based on the market maker intelligent contract accessed to the block chain network to obtain a corresponding token trading result;
a sending module for sending the token transaction result to the user.
8. An electronic device, comprising: a processor and a memory;
the memory for storing a computer program;
the processor for executing the blockchain-based token transaction method of any one of the above claims 1 to 6 by calling the computer program.
9. A computer-readable storage medium for storing a computer program which, when run on a computer, causes the computer to perform the blockchain based token transaction method of any one of the above claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011277424.4A CN112435121A (en) | 2020-11-16 | 2020-11-16 | Token transaction method and device based on block chain, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011277424.4A CN112435121A (en) | 2020-11-16 | 2020-11-16 | Token transaction method and device based on block chain, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112435121A true CN112435121A (en) | 2021-03-02 |
Family
ID=74700122
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011277424.4A Pending CN112435121A (en) | 2020-11-16 | 2020-11-16 | Token transaction method and device based on block chain, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112435121A (en) |
-
2020
- 2020-11-16 CN CN202011277424.4A patent/CN112435121A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102471948B1 (en) | How to exchange and evaluate virtual currency | |
US11893637B2 (en) | Systems and methods for cryptographic trading | |
US20210351915A1 (en) | Multi-blockchain digital transaction information segregation system | |
KR20210024994A (en) | Digital asset exchange | |
US20190081789A1 (en) | Tokens or crypto currency using smart contracts and blockchains | |
CN108960822B (en) | Block chain-based available resource quota exchange method and device | |
KR102120539B1 (en) | System for distributing gift certificate token based on blockchain | |
KR20200094531A (en) | System and method for providing digital asset services basesd on blockchain | |
JP7097980B2 (en) | Blockchain-based set replacement methods and equipment for available resource quotas | |
US20220130005A1 (en) | Digital asset management systems and methods | |
JP7042637B2 (en) | Programs, information processing equipment, information processing methods and virtual currency trading systems | |
Sönmeztürk et al. | Loyalty program using blockchain | |
US10140658B1 (en) | Commodity backed virtual currency method and system for network transactions | |
US11182775B2 (en) | Asset-backed electronic currency systems and methods | |
KR102572638B1 (en) | Digital NFT Sales Platform for Artists and the method using it | |
WO2019237762A1 (en) | Blockchain-based method and apparatus for pre-exchanging available resource quotas | |
US20220261908A1 (en) | System and method for dynamic user-based customization of a transaction product | |
CN112435121A (en) | Token transaction method and device based on block chain, electronic equipment and storage medium | |
KR20200094532A (en) | System and method for providing digital asset services to individual using crypto-branch basesd on blockchain | |
CN113159902A (en) | Auction method based on block chain | |
CN113095915A (en) | Auction method based on block chain | |
CN113095916A (en) | Auction method based on block chain | |
KR20190111436A (en) | System for currency exchanging using crypto currency | |
KR102638698B1 (en) | Method of trading resell goods based on blockchain | |
WO2022226204A1 (en) | A dynamic value and property conversion network applied to units of exchange and stores of value |
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 |