WO2020042586A1 - 智能合约地址生成方法、装置、计算机设备及可读存储介质 - Google Patents

智能合约地址生成方法、装置、计算机设备及可读存储介质 Download PDF

Info

Publication number
WO2020042586A1
WO2020042586A1 PCT/CN2019/077933 CN2019077933W WO2020042586A1 WO 2020042586 A1 WO2020042586 A1 WO 2020042586A1 CN 2019077933 W CN2019077933 W CN 2019077933W WO 2020042586 A1 WO2020042586 A1 WO 2020042586A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
smart contract
hash value
calculation method
account
Prior art date
Application number
PCT/CN2019/077933
Other languages
English (en)
French (fr)
Inventor
许敏勋
程文彬
陈飞杨
Original Assignee
深圳前海益链网络科技有限公司
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 深圳前海益链网络科技有限公司 filed Critical 深圳前海益链网络科技有限公司
Publication of WO2020042586A1 publication Critical patent/WO2020042586A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • 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/3827Use of message hashing

Definitions

  • the present invention relates to the field of blockchain, and in particular, to a method, an apparatus, a computer device, and a readable storage medium for generating a smart contract address.
  • each smart contract needs to be given a contract address.
  • the contract address corresponds to the contract content, and its role is to be used for contract storage retrieval and balance accounting.
  • the smart contract address generation methods of mainstream blockchain projects rely on the smart contract content code for hashing. It is more classic, such as Ethereum, whose smart contract address is the smart contract content code plus a random number. The two key pieces of Nonce are hashed.
  • this generation method that relies only on the smart contract content code to hash to generate a smart contract address, the generated smart contract address has a large randomness, so it is not possible to directly judge the smart contract release from the generated smart contract address Address of the smart contract issuer.
  • the smart contract issue process must be queried through the system to determine the account information of the smart contract issuer.
  • An embodiment of the present invention provides a method for generating a smart contract address.
  • a user on a blockchain can directly determine an account address of a publisher of the smart contract through the smart contract address obtained by the generating method, without querying the system.
  • the smart contract address obtained by relying on the generation method is related to the user's account address, which is convenient for the user to manage the smart contracts issued by the user.
  • An embodiment of the present invention provides a method for generating a smart contract address.
  • the method includes the following steps:
  • a smart contract address is generated by combining the address type identification character string, an account address hash value, a smart contract hash value, and an address check value.
  • An embodiment of the present invention further provides a device for generating a smart contract, including:
  • Account address hash unit which is used to generate an account address hash value according to the account address of the smart contract issuer
  • the smart contract hash unit is used to generate a smart contract hash value according to the smart contract content code
  • An address check value unit configured to generate an address check value according to the account address hash value and the smart contract hash value
  • An address type determining unit configured to generate an address type identification string according to a calculation method of the account address hash value, a calculation method of the smart contract hash value, and a calculation method of the address check value;
  • the combination generating unit is configured to combine the address type identification character string, an account address hash value, a smart contract hash value, and an address check value to generate a smart contract address.
  • An embodiment of the present invention further provides a computer device, where the computer device includes a processor, and the processor is configured to implement the steps of the smart contract address generation method described above when executing a computer program stored in a memory.
  • An embodiment of the present invention also provides a computer-readable storage medium.
  • a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the processor is caused to perform the foregoing smart contract address generation. Method steps.
  • the method for generating a smart contract address includes adding an address type identification string to the smart contract address, where the identification string contains corresponding information of the address, which is convenient for judging the type of the address, and publishing the smart contract.
  • the hash value of the account address of the user is combined with the hash value of the smart contract content code, and the hash value of the account address can correspond to the unique account address and thus can be used as the identification information of the account address.
  • the existing hashing algorithm makes the probability that the same account address hash value corresponds to multiple account addresses is far less than a few trillionths, infinitely close to 0.
  • the hash of the general default account address The value can correspond to a unique account address), so that the generated smart contract address can contain identification information of the smart contract issuer's account address, which is convenient for directly confirming the smart contract issuer's account address and identity information. It can be understood that when the user obtains the address type identification string and the hash value of the account address, the user can determine the account address information and further confirm the identity of the contract issuer; when the two smart contract addresses, the address type identification character When the hash value of the string and the account address are the same, it means that the two smart contracts have the same account address of the issuer, that is, the issuers of the two smart contracts are the same.
  • a smart contract publisher only needs to manage smart contract addresses with the same address type identification string and account address hash value. Compared with managing several smart contract addresses with completely different address information, it has strong practicality. Adding an address check value is convenient to confirm the validity of the smart contract address.
  • the check digit is calculated based on the hash value of the account address and the hash value of the smart contract content code. When a certain value of the content code hash value is changed, the obtained address check value is completely different, so it can be used to determine whether an error occurred during the input process.
  • FIG. 1 is an overall flowchart of a method for generating a smart contract address according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a calculation process for generating a hash value of an account address based on an account address of a smart contract issuer provided by the implementation of the present invention
  • FIG. 3 is a flowchart of a calculation process for generating a smart contract hash value according to a smart contract content code according to an embodiment of the present invention
  • FIG. 4 is a flowchart of a calculation process for generating an address check value according to an account address hash value and a smart contract hash value according to an embodiment of the present invention
  • FIG. 5 is a flowchart of generating an address type identification character string according to an account address hash value calculation method, a smart contract hash value calculation method, and an address check value calculation method according to an embodiment of the present invention
  • FIG. 6 is a flowchart of combining an address type identification character string, an account address hash value, a smart contract hash value, and an address check value to generate a smart contract address according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a smart contract address generating device according to an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of an address type determination unit in a smart contract address generation device according to an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of a combination generation unit provided in a smart contract address generation device according to an embodiment of the present invention.
  • a method for generating a smart contract address may be applied to a terminal; a computer device, a computer device may be an independent physical server or terminal, or a server cluster composed of multiple physical servers, or may provide a cloud server , Cloud database, cloud storage and CDN and other basic cloud computing services.
  • the terminal may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto.
  • FIG. 1 shows an overall flowchart of a method for generating a smart contract address according to an embodiment of the present invention, which is described in detail below.
  • Step S101 Generate an account address hash value according to the account address of the smart contract issuer.
  • an account address hash value is generated according to an account address of the smart contract issuer.
  • the calculation method for generating an account address hash value based on the account address of a smart contract issuer includes: using sha256 (Secure Hash Algorithm, a hash algorithm), RIPEMD160 ( One or more combinations of hash algorithms such as RACE Integrity, Evaluation, Message Digest, RACE original integrity check message digest, a hash algorithm, and one or more repeated hash calculations.
  • sha256 Secure Hash Algorithm, a hash algorithm
  • RIPEMD160 One or more combinations of hash algorithms such as RACE Integrity, Evaluation, Message Digest, RACE original integrity check message digest, a hash algorithm, and one or more repeated hash calculations.
  • Step S102 Generate a smart contract hash value according to the smart contract content code.
  • a smart contract hash value is generated according to the smart contract content code.
  • the calculation method for generating a hash value of a smart contract according to the smart contract content code includes: using sha256 (Secure Hash Algorithm, a hash algorithm), RIPEMD160 (RACEIntegrity, Primitives) Evaluation Message Digest, one or more combinations of hash algorithms such as RACE original integrity check message digest, a hash algorithm, and one or more repeated hash calculations.
  • Step S103 Generate an address check value according to the account address hash value and the smart contract hash value.
  • an address check value is generated according to the account address hash value and the smart contract hash value.
  • the step of generating an address check value based on the account address hash value and the smart contract hash value specifically includes:
  • the calculation method for generating an account address and a smart contract combination hash value based on the sequence of the account address hash value and the smart contract hash value combination includes: using sha256 (Secure Hash Algorithm, a secure hash algorithm, a ha Greek algorithm), RIPEMD160 (RACE, Integration, Evaluation, Message Digest, RACE original integrity check message digest, a hash algorithm) and other hash algorithms in one or more combinations and one or more repeated hash calculations .
  • Step S104 Generate an address type identification character string according to the calculation method of the account address hash value, the smart contract hash value calculation method, and the address check value calculation method.
  • the account address hash value calculation method, the smart contract hash value calculation method, and the address check value calculation method are preset with corresponding character strings, and different calculations are performed. Methods correspond to different strings.
  • the The steps include:
  • a character string corresponding to the calculation method of the account address hash value is determined according to the correspondence between the account address hash value calculation method and a preset account address hash value calculation method and a character string.
  • a string corresponding to the calculation method of the smart contract hash value is determined according to the corresponding relationship between the calculation method of the smart contract hash value and a preset calculation method of the smart contract hash value and a character string.
  • a character string corresponding to the calculation method of the address check value is determined according to a correspondence between the calculation method of the address check value and a preset calculation method of the address check value and a character string.
  • the character string corresponding to the calculation method of the account address hash value, the character string corresponding to the method of calculating the smart contract hash value, and the character string corresponding to the method of calculating the address check value Sort and combine to generate an address type identification string.
  • Step S105 Combine the address type identification character string, the account address hash value, the smart contract hash value, and the address check value to generate a smart contract address.
  • the character string and the account address hash value may not be identified according to the address type.
  • the order of the smart contract hash value and the address check value are combined for each string, but if you do this, you need to remember the address type identification string, account address hash value, smart contract hash value, and address check The position of the value in the last generated string. Therefore, the preferred solution is to combine in the order of the address type identification character string, the account address hash value, the smart contract hash value, and the address check value.
  • the step of combining the address type identification character string, an account address hash value, a smart contract hash value, and an address check value to generate a smart contract address specifically includes:
  • the address type identification character string, the account address hash value, the smart contract hash value, and the address check value are combined.
  • the combined address type identification string, account address hash value, smart contract hash value and address check value sequence are reversibly encoded to generate a smart contract address.
  • the method for generating a smart contract address includes adding an address type identification string to the smart contract address, where the identification string contains corresponding information of the address, which is convenient for judging the type of the address, and publishing the smart contract.
  • the hash value of the account address of the user is combined with the hash value of the smart contract content code, and the hash value of the account address can correspond to the unique account address and thus can be used as the identification information of the account address.
  • the existing hashing algorithm makes the probability that the same account address hash value corresponds to multiple account addresses is far less than a few trillionths, infinitely close to 0.
  • the hash of the general default account address The value can correspond to a unique account address), so that the generated smart contract address can contain identification information of the smart contract issuer's account address, which is convenient for directly confirming the smart contract issuer's account address and identity information. It can be understood that when the user obtains the address type identification string and the hash value of the account address, the user can determine the account address information and further confirm the identity of the contract issuer; when the two smart contract addresses, the address type identification character When the hash value of the string and the account address are the same, it means that the two smart contracts have the same account address of the issuer, that is, the issuers of the two smart contracts are the same.
  • a smart contract publisher only needs to manage smart contract addresses with the same address type identification string and account address hash value. Compared with managing several smart contract addresses with completely different address information, it has strong practicality. Adding an address check value is convenient to confirm the validity of the smart contract address. Since the check digit is calculated based on the hash value of the account address and the hash value of the smart contract content code, when the hash value of the account address and the smart contract When a certain value of the content code hash value is changed, the obtained address check value is completely different, so it can be used to determine whether an error occurred during the input process.
  • FIG. 2 shows a flowchart of a calculation process for generating an account address hash value based on an account address of a smart contract issuer provided by the implementation of the present invention, which is described in detail below.
  • Step S201 Obtain account address information of the smart contract issuer.
  • Step S202 Perform a hash calculation on the account address information of the smart contract issuer using the sha256 algorithm to generate a 64-bit hexadecimal number.
  • Step S203 Perform a hash calculation on the 64-bit hexadecimal number using the RIPEMD160 algorithm to generate a 40-bit hexadecimal number.
  • the generated 40-digit hexadecimal number is the account address hash value.
  • FIG. 3 shows a flowchart of a calculation process for generating a smart contract hash value according to a smart contract content code according to an embodiment of the present invention, which is described in detail below.
  • Step S301 Obtain content code information of the smart contract.
  • step S302 a hash calculation is performed on the smart contract content code information using the sha256 algorithm to generate a 64-bit hexadecimal number.
  • Step S303 Perform a hash calculation on the 64-bit hexadecimal number using the RIPEMD160 algorithm to generate a 40-bit hexadecimal number.
  • the generated 40-digit hexadecimal number is the smart contract hash value.
  • FIG. 4 shows a flowchart of a calculation process for generating an address check value according to an account address hash value and a smart contract hash value according to an embodiment of the present invention, which is described in detail below.
  • step S401 the account address hash value and the smart contract hash value generated in the foregoing steps S203 and S303 are obtained.
  • Step S402 Combine the hash value of the account address and the hash value of the smart contract.
  • Step S403 Perform a hash calculation using the sha256 algorithm on the sequence obtained by combining the hash value of the account address and the smart contract hash value to generate a 64-bit hexadecimal number.
  • Step S404 Perform a hash calculation on the 64-bit hexadecimal number using the sha256 algorithm to generate a 64-bit hexadecimal number.
  • Step S405 Take the first 8 bits of the generated 64-bit hexadecimal number as the address check bit.
  • FIG. 5 shows a flowchart of generating an address type identification character string according to an account address hash value calculation method, a smart contract hash value calculation method, and an address check value calculation method according to an embodiment of the present invention. Details are as follows.
  • Step S501 Determine a character string corresponding to the calculation method of the account address hash value according to the correspondence between the account address hash value calculation method and a preset account address hash value calculation method and a character string.
  • step S202 and step S203 If the preset character string corresponding to the calculation method of the account address hash value according to step S202 and step S203 is 001, the character string corresponding to the account address hash value calculation method is 001.
  • Step S502 Determine a character string corresponding to the calculation method of the smart contract hash value according to the correspondence between the smart contract hash value calculation method and a preset smart contract hash value calculation method and a character string.
  • step S302 and step S303 the character string corresponding to the method for calculating the smart contract hash value is 101.
  • Step S503 Determine a character string corresponding to the calculation method of the address check value according to the correspondence between the calculation method of the address check value and the preset calculation method of the address check value and the character string.
  • step S403 If the preset character string corresponding to the method for calculating the address check value according to step S403, step S404, and step S405 is 201, the character string corresponding to the method for calculating the address check value is 201.
  • Step S504 the character string corresponding to the calculation method of the account address hash value, the character string corresponding to the calculation method of the smart contract hash value, and the character string corresponding to the calculation method of the address check value
  • the strings are sorted in order and combined to generate an address type identification string.
  • the generated address type identification character string is 001101201.
  • FIG. 6 shows a flowchart of combining an address type identification character string, an account address hash value, a smart contract hash value, and an address check value to generate a smart contract address according to an embodiment of the present invention, which is described in detail below.
  • the step of combining the address type identification character string, an account address hash value, a smart contract hash value, and an address check value to generate a smart contract address specifically includes:
  • Step 601 Combine the address type identification character string, an account address hash value, a smart contract hash value, and an address check value.
  • Step 602 Reversibly encode the combined address type identification character string, account address hash value, smart contract hash value, and address check value sequence to generate a smart contract address.
  • the smart contract address generated by reversible encoding means that the smart contract address generated by reversible encoding can be decoded to generate a combined address type identification string, account address hash value, smart contract hash value and address before encoding. Check value sequence.
  • the reversible encoding includes a reversible encoding method such as basic58, basic64.
  • FIG. 7 is a schematic structural diagram of a smart contract address generation device according to an embodiment of the present invention. For ease of description, only relevant parts in the embodiment of the present invention are shown.
  • the smart contract address generating device includes:
  • the account address hash unit 701 is configured to generate an account address hash value according to the account address of the smart contract issuer.
  • the smart contract hash unit 702 is configured to generate a smart contract hash value according to a smart contract content code.
  • the address check value unit 703 is configured to generate an address check value according to the account address hash value and the smart contract hash value.
  • the address type determining unit 704 is configured to generate an address type identification character string according to a calculation method of the account address hash value, a calculation method of the smart contract hash value, and a calculation method of the address check value.
  • the combination generating unit 705 is configured to combine the address type identification character string, an account address hash value, a smart contract hash value, and an address check value to generate a smart contract address.
  • FIG. 8 is a schematic structural diagram of an address type determination unit in a smart contract address generating device according to an embodiment of the present invention. For ease of description, only relevant parts of the embodiment of the present invention are shown.
  • the address type determining unit in the smart contract generating device includes:
  • the account address hash value string obtaining module 801 is configured to determine the account address hash value according to the calculation method of the account address hash value and the preset calculation method of the account address hash value and the corresponding relationship between the character string and the account address. Greek string corresponding to the calculation method.
  • the smart contract hash value string obtaining module 802 is configured to determine the smart contract hash value string according to the smart contract hash value calculation method and the preset smart contract hash value calculation method and the corresponding relationship between the character string and the smart contract. Greek string corresponding to the calculation method.
  • the address check value string obtaining module 803 is configured to determine the calculation with the address check value according to the calculation method of the address check value and the preset correspondence between the calculation method of the address check value and the character string. The string corresponding to the method.
  • a combination generation module configured to convert a character string corresponding to the calculation method of the account address hash value, a character string corresponding to the calculation method of the smart contract hash value, and a calculation method to the address check value
  • the corresponding strings are sorted and combined in order to generate an address type identification string.
  • FIG. 9 is a schematic structural diagram of a combination generation unit in a smart contract generation device according to an embodiment of the present invention. For ease of description, only relevant parts of the embodiment of the present invention are shown.
  • the combination generation unit in the smart contract generation device includes:
  • a combining module 901 is configured to combine the address type identification character string, an account address hash value, a smart contract hash value, and an address check value.
  • the encoding module 902 is configured to reversibly encode a combined address type identification character string, an account address hash value, a smart contract hash value, and an address check value sequence to generate a smart contract address.
  • the method for generating a smart contract address includes adding an address type identification string to the smart contract address, where the identification string contains corresponding information of the address, which is convenient for judging the type of the address, and publishing the smart contract.
  • the hash value of the account address of the user is combined with the hash value of the smart contract content code, and the hash value of the account address can correspond to the unique account address and thus can be used as the identification information of the account address.
  • the existing hashing algorithm makes the probability that the same account address hash value corresponds to multiple account addresses is far less than a few trillionths, infinitely close to 0.
  • the hash of the general default account address The value can correspond to a unique account address), so that the generated smart contract address can contain identification information of the smart contract issuer's account address, which is convenient for directly confirming the smart contract issuer's account address and identity information. It can be understood that when the user obtains the address type identification string and the hash value of the account address, the user can determine the account address information and further confirm the identity of the contract issuer; when the two smart contract addresses, the address type identification character When the hash value of the string and the account address are the same, it means that the two smart contracts have the same account address of the issuer, that is, the issuers of the two smart contracts are the same.
  • the address check value is added to confirm the validity of the smart contract address.
  • the check digit is calculated based on the hash value of the account address and the hash value of the smart contract content code.
  • An embodiment of the present invention provides a computer device.
  • the computer device includes a processor, and the processor is configured to implement generation of a smart contract address provided by the embodiments shown in FIG. 1 to FIG. 6 when executing a computer program stored in a memory. Method steps.
  • a computer program may be divided into one or more modules, and one or more modules are stored in a memory and executed by a processor to complete the present invention.
  • One or more modules may be a series of computer program instruction segments capable of performing a specific function, and the instruction segments are used to describe a computer program execution process in a computer device.
  • the computer program may be divided into steps of the smart contract address generation method provided by the foregoing method embodiments.
  • the above description of the computer device is merely an example and does not constitute a limitation on the computer device, and may include more or less components than the above description, or a combination of some components, or different components, such as It can include input and output devices, network access devices, and buses.
  • the processor can be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), off-the-shelf Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, etc.
  • the processor is a control center of the computer device and connects various parts of the entire computer device by using various interfaces and lines.
  • the memory may be used to store the computer program and / or module, and the processor implements the computer by running or executing the computer program and / or module stored in the memory, and calling data stored in the memory.
  • the memory may mainly include a storage program area and a storage data area, where the storage program area may store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), etc .; the storage data area may store Data (such as audio data, phone book, etc.) created based on the use of the mobile phone.
  • the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as a hard disk, an internal memory, a plug-in hard disk, a Smart Media Card (SMC), and a Secure Digital (SD) card.
  • a non-volatile memory such as a hard disk, an internal memory, a plug-in hard disk, a Smart Media Card (SMC), and a Secure Digital (SD) card.
  • Flash card Flash card
  • flash card at least one disk storage device, flash memory device, or other volatile solid-state storage device.
  • the modules / units integrated in the computer device When the modules / units integrated in the computer device are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the methods of the above embodiments, and may also be completed by a computer program instructing related hardware.
  • the computer program may be stored in a computer-readable storage medium.
  • the computer When the program is executed by a processor, the steps of the foregoing method embodiments can be implemented.
  • the computer program includes computer program code, and the computer program code may be in a source code form, an object code form, an executable file, or some intermediate form.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM, Read-Only Memory) , Random Access Memory (RAM, Random Access Memory), electric carrier signals, electric signals, and software distribution media.
  • a recording medium a U disk, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM, Read-Only Memory) , Random Access Memory (RAM, Random Access Memory), electric carrier signals, electric signals, and software distribution media.

Abstract

本发明实施例适用于区块链领域,提供了一种智能合约地址生成方法,所述方法包括:生成智能合约发布者账户地址哈希值;生成智能合约哈希值;根据账户地址哈希值和智能合约哈希值生成地址校验码;生成地址类型标识字符串;将地址类型标识字符串、账户地址哈希值、智能合约哈希值以及地址校验码组合生成智能合约地址。本发明实施例提供的一种智能合约地址的生成方法,能够绑定智能合约地址与发布者的账户地址,使得区块链上其他用户能够直接从智能合约地址上判断出智能合约发布者的账户信息,无需通过系统查询。另外,本发明实施例提供的一种智能合约地址的生成方法,使得根据同一用户发布的不同的智能合约所生成的地址之间存在一定的相关性,便于智能合约发布者进行智能合约管理。

Description

智能合约地址生成方法、装置、计算机设备及可读存储介质 技术领域
本发明涉及区块链领域,特别是涉及一种智能合约地址的生成方法、装置、计算机设备及可读存储介质。
背景技术
当前,区块链的发展越来越迅速,智能合约作为区块链中一项重要的技术,相比于常规合约,拥有数据透明、不可篡改、持久有效等特性,能够适用于更加广泛的领域。而为了在区块链中标记智能合约,需要给每个智能合约一个合约地址,合约地址与合约内容是一一对应的,其作用是用于合约存储检索和余额记账。
现有技术中,主流区块链项目的智能合约地址生成方式都是依赖于智能合约内容代码进行哈希,比较经典的,如以太坊,其智能合约地址就是采用智能合约内容代码加上随机数Nonce这两个关键信息进行哈希所得。然而,这种仅仅依赖于智能合约内容代码进行哈希从而生成智能合约地址的生成方式,生成的智能合约地址具有较大的随机性,从而无法从生成的智能合约地址中直接判断出智能合约发布者的账号地址,当区块链上其他用户需要确认智能合约发布者的身份时,必须通过系统查询该智能合约发布过程,才能判断出智能合约发布者的账户地址信息。
可见现有技术中,区块链上的用户无法直接从智能合约地址判断出该智能合约发布者的账户地址。另外,智能合约发布者也无法对其发布的智能合约进行管理。
发明内容
本发明实施例提供一种智能合约地址的生成方法,区块链上的用户能够通过该生成方法所得到的智能合约地址直接判断出该智能合约发布者的账户地址,无需通过系统查询。此外,针对同一用户发布的不同智能合约,依赖该生成方法得到的智能合约地址与该用户的账户地址相关,便于该用户对其发布的智能合约进行管理。
本发明实施例提供一种智能合约地址的生成方法,所述方法包括以下步骤:
根据智能合约发布者的账户地址生成账户地址哈希值;
根据智能合约内容代码生成智能合约哈希值;
根据所述账户地址哈希值和智能合约哈希值生成地址校检值;
根据所述账户地址哈希值的计算方法、所述智能合约哈希值的计算方法及所述地址校验值的计算方法,生成地址类型标识字符串;
将所述地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值进行组合生成智能合约地址。
本发明实施例还提供一种智能合约的生成装置,包括:
账户地址哈希单元,用于根据智能合约发布者的账户地址生成账户地址哈希值;
智能合约哈希单元,用于根据智能合约内容代码生成智能合约哈希值;
地址校验值单元,用于根据所述账户地址哈希值和智能合约哈希值生成地址校检值;
地址类型确定单元,用于根据所述账户地址哈希值的计算方法、所述智能合约哈希值的计算方法及所述地址校验值的计算方法,生成地址类型标识字符串;
组合生成单元,用于将所述地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值进行组合生成智能合约地址。
本发明实施例还提供一种计算机装置,所述计算机装置包括处理器,所述处理器用于执行存储器中存储的计算机程序时实现如上述所述智能合约地址生成方法的步骤。
本发明实施例还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时,使得所述处理器执行上述所述智能合约地址生成方法的步骤。
本发明实施例提供的智能合约地址的生成方法,通过在智能合约地址中加入地址类型标识字符串,其中标识字符串含有该地址的相应信息,便于判断区别该地址的类型,还将智能合约发布者的账户地址的哈希值与智能合约内容代 码哈希值进行组合,而账户地址的哈希值能够对应着唯一的账户地址从而可以作为该账户地址的标识信息,(事实上,唯一并不精确,但是现有的哈希算法使得同一个账户地址哈希值对应多个账户地址的概率远远低于几千万亿分之一,无限接近于0,因此,一般默认账户地址的哈希值能够对应着唯一的账户地址),从而能够从生成的智能合约地址中含有智能合约发布者的账户地址的标识信息,便于直接确认智能合约发布者的账户地址以及身份信息。可以理解,当用户在获取到地址类型标识字符串以及账户地址的哈希值时,就能判断出账户地址信息,进一步确认合约发布者的身份;当两个智能合约地址中,地址类型标识字符串以及账户地址的哈希值相同时,说明所述两个智能合约拥有相同的发布者的账户地址,即两个智能合约的发布者相同。因此,智能合约发布者只需要管理地址类型标识字符串以及账户地址哈希值相同的智能合约地址,相比于管理几个地址信息完全不同的智能合约地址,具有很强的实用性。而加入地址校验值,便于确认智能合约地址的有效性,由于校验位是根据账户地址的哈希值以及智能合约内容代码的哈希值计算得到,当账户地址的哈希值以及智能合约内容代码的哈希值有某一数值发生改变时,得到的地址校验值完全不同,因此可以用于判断在输入的过程中是否出现了错误。
附图说明
图1为本发明实施例提供的一种智能合约地址生成方法的整体流程图;
图2为本发明实施提供给的一种根据智能合约发布者的账户地址生成账户地址哈希值的计算过程流程图;
图3为本发明实施例提供的一种根据智能合约内容代码生成智能合约哈希值的计算过程流程图;
图4为本发明实施例提供的一种根据账户地址哈希值和智能合约哈希值生成地址校检值的计算过程流程图;
图5为本发明实施例提供的一种根据账户地址哈希值计算方法、智能合约哈希值计算方法及地址校验值的计算方法,生成地址类型标识字符串的流程图;
图6为本发明实施例提供的一种将地址类型标识字符串、账户地址哈希值、 智能合约哈希值与地址校验值进行组合生成智能合约地址的流程图。
图7为本发明实施例提供的一种智能合约地址生成装置的结构示意图。
图8为本发明实施例提供的一种智能合约地址生成装置中地址类型确定单元的结构示意图。
图9为本发明实施例提供给一种智能合约地址生成装置中组合生成单元的结构示意图。
具体实施方式
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
在本发明实施例中,智能合约地址的生成方法可以应用于终端中;计算机设备,计算机设备可以是独立的物理服务器或终端,也可以是多个物理服务器构成的服务器集群,可以是提供云服务器、云数据库、云存储和CDN等基础云计算服务的云服务器。终端可以是智能手机、平板电脑、笔记本电脑、台式计算机、智能音箱、智能手表等,但并不局限于此。
图1示出了本发明实施例提供的一种智能合约地址的生成方法的整体流程图,详述如下。
步骤S101,根据智能合约发布者的账户地址生成账户地址哈希值。
本发明实施例中,当智能合约发布者发布智能合约时,根据该智能合约发布者的账户地址生成账户地址哈希值。
作为本发明的一个实施例,所述根据智能合约发布者的账户地址生成账户地址哈希值的计算方法包括:使用sha256(Secure Hash Algorithm,安全散列算法,一种哈希算法)、RIPEMD160(RACE Integrity Primitives Evaluation Message Digest,RACE原始完整性校验消息摘要,一种哈希算法)等哈希算法中的一种或多种组合以及一次或多次重复进行哈希计算。
步骤S102,根据智能合约内容代码生成智能合约哈希值。
在本发明实施例中,当智能合约发布者发布智能合约时,根据该智能合约内容代码生成智能合约哈希值。
作为本发明的一个实施例,所述根据智能合约内容代码生成智能合约哈希值的计算方法包括:使用sha256(Secure Hash Algorithm,安全散列算法,一种哈希算法)、RIPEMD160(RACE Integrity Primitives Evaluation Message Digest,RACE原始完整性校验消息摘要,一种哈希算法)等哈希算法中的一种或多种组合以及一次或多次重复进行哈希计算。
步骤S103,根据所述账户地址哈希值和智能合约哈希值生成地址校检值。
在本发明实施例中,当智能合约发布者发布智能合约时,根据所述账号地址哈希值以及智能合约哈希值生成地址校检值。
所述根据账号地址哈希值以及智能合约哈希值生成地址校检值的步骤具体包括:
将所述账号地址哈希值以及智能合约哈希值进行组合。
根据所述账号地址哈希值以及智能合约哈希值组合后的序列生成账号地址与智能合约组合哈希值。
将上述账号地址与智能合约组合哈希值取前八位数值记为地址校检值。
所述根据所述账号地址哈希值以及智能合约哈希值组合后的序列生成账号地址与智能合约组合哈希值的计算方法包括:使用sha256(Secure Hash Algorithm,安全散列算法,一种哈希算法)、RIPEMD160(RACE Integrity Primitives Evaluation Message Digest,RACE原始完整性校验消息摘要,一种哈希算法)等哈希算法中的一种或多种组合以及一次或多次重复进行哈希计算。
步骤S104,根据所述账户地址哈希值的计算方法、所述智能合约哈希值的计算方法及所述地址校验值的计算方法,生成地址类型标识字符串。
在本发明实施例中,所述账户地址哈希值的计算方法、所述智能合约哈希值的计算方法及所述地址校验值的计算方法均预设有对应的字符串,不同的计算方法对应着不同的字符串。
作为本发明的一个实施例,所述根据所述账户地址哈希值的计算方法、所述智能合约哈希值的计算方法及所述地址校验值的计算方法,生成地址类型标 识字符串的步骤,具体包括:
根据所述账户地址哈希值的计算方法以及预设的账户地址哈希值的计算方法与字符串的对应关系,确定与所述账户地址哈希值的计算方法对应的字符串。
根据所述智能合约哈希值的计算方法以及预设的智能合约哈希值的计算方法与字符串的对应关系,确定与所述智能合约哈希值的计算方法对应的字符串。
根据所述地址校验值的计算方法以及预设的地址校验值的计算方法与字符串的对应关系,确定与所述地址校验值的计算方法对应的字符串。
将所述账户地址哈希值的计算方法所对应的字符串、与所述智能合约哈希值的计算方法所对应的字符串以及与所述地址校验值的计算方法所对应的字符串依次排序进行组合,生成地址类型标识字符串。
步骤S105,将所述地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值进行组合生成智能合约地址。
本发明实施例中,在对地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值进行组合的过程中,可以不按照地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值的顺序对各字符串进行组合,但是,若如此操作,需要记住地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值在最后生成的字符串中所处的位置。因此,优选方案为,按照地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值的顺序进行组合。
作为本发明的一个实施例,所述将所述地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值进行组合生成智能合约地址的步骤,具体包括:
将所述地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值进行组合。
对组合后的地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值序列进行可逆编码生成智能合约地址。
本发明实施例提供的智能合约地址的生成方法,通过在智能合约地址中加入地址类型标识字符串,其中标识字符串含有该地址的相应信息,便于判断区 别该地址的类型,还将智能合约发布者的账户地址的哈希值与智能合约内容代码哈希值进行组合,而账户地址的哈希值能够对应着唯一的账户地址从而可以作为该账户地址的标识信息,(事实上,唯一并不精确,但是现有的哈希算法使得同一个账户地址哈希值对应多个账户地址的概率远远低于几千万亿分之一,无限接近于0,因此,一般默认账户地址的哈希值能够对应着唯一的账户地址),从而能够从生成的智能合约地址中含有智能合约发布者的账户地址的标识信息,便于直接确认智能合约发布者的账户地址以及身份信息。可以理解,当用户在获取到地址类型标识字符串以及账户地址的哈希值时,就能判断出账户地址信息,进一步确认合约发布者的身份;当两个智能合约地址中,地址类型标识字符串以及账户地址的哈希值相同时,说明所述两个智能合约拥有相同的发布者的账户地址,即两个智能合约的发布者相同。因此,智能合约发布者只需要管理地址类型标识字符串以及账户地址哈希值相同的智能合约地址,相比于管理几个地址信息完全不同的智能合约地址,具有很强的实用性。而加入地址校验值,便于确认智能合约地址的有效性,由于校验位是根据账户地址的哈希值以及智能合约内容代码的哈希值计算得到,当账户地址的哈希值以及智能合约内容代码的哈希值有某一数值发生改变时,得到的地址校验值完全不同,因此可以用于判断在输入的过程中是否出现了错误。
图2示出了本发明实施提供给的一种根据智能合约发布者的账户地址生成账户地址哈希值的计算过程流程图,详述如下。
步骤S201,获取所述智能合约发布者的账户地址信息。
步骤S202,对所述智能合约发布者的账户地址信息使用sha256算法进行一次哈希计算,生成64位十六进制数。
步骤S203,对所述64位十六进制数使用RIPEMD160算法进行一次哈希计算,生成40位十六进制数。
所述生成的40位十六进制数即为账户地址哈希值。
图3示出了本发明实施例提供的一种根据智能合约内容代码生成智能合约哈希值的计算过程流程图,详述如下。
步骤S301,获取所述智能合约内容代码信息。
步骤S302,对所述智能合约内容代码信息使用sha256算法进行一次哈希计算,生成64位十六进制数。
步骤S303,对所述64位十六进制数使用RIPEMD160算法进行一次哈希计算,生成40位十六进制数。
所述生成的40位十六进制数即为智能合约哈希值。
图4示出了本发明实施例提供的一种根据账户地址哈希值和智能合约哈希值生成地址校检值的计算过程流程图,详述如下。
步骤S401,获取前述步骤S203,S303生成的账户地址哈希值以及智能合约哈希值。
步骤S402,将所述账户地址哈希值以及智能合约哈希值进行组合。
步骤S403,对账号地址哈希值以及智能合约哈希值组合后得到的序列使用sha256算法进行一次哈希计算,生成64位十六进制数。
步骤S404,对所述64位十六进制数使用sha256算法进行一次哈希计算,生成64位十六进制数。
步骤S405,取生成的64位十六进制数的前8位作为地址校验位。
图5示出了本发明实施例提供的一种根据账户地址哈希值的计算方法、智能合约的哈希值计算方法及地址校验值的计算方法,生成地址类型标识字符串的流程图,详述如下。
步骤S501,根据所述账户地址哈希值的计算方法以及预设的账户地址哈希值的计算方法与字符串的对应关系,确定与所述账户地址哈希值的计算方法对应的字符串。
以上述图2示出的一种根据智能合约发布者的账户地址生成账户地址哈希值的计算过程流程图为例。
假如预设的按照步骤S202,步骤S203所述的账户地址哈希值的计算方法所对应的字符串为001,则所述账户地址哈希值的计算方法所对应的字符串即为001。
步骤S502,根据所述智能合约哈希值的计算方法以及预设的智能合约哈希值的计算方法与字符串的对应关系,确定与所述智能合约哈希值的计算方法对 应的字符串。
以上述图3示出的一种根据智能合约内容代码生成智能合约哈希值的计算过程流程图为例。
假如预设的按照步骤S302,步骤S303所述的智能合约哈希值的计算方法所对应的字符串为101,则所述智能合约哈希值的计算方法所对应的字符串即为101。
步骤S503,根据所述地址校验值的计算方法以及预设的地址校验值的计算方法与字符串的对应关系,确定与所述地址校验值的计算方法对应的字符串。
以上述图4示出的一种根据账户地址哈希值和智能合约哈希值生成地址校检值的计算过程流程图为例。
假如预设的按照步骤S403,步骤S404,步骤S405所述的地址校验值的计算法方法所对应的字符串为201,则所述地址校验值的计算方法所对应字符串即为201。
步骤S504,将所述账户地址哈希值的计算方法所对应的字符串、与所述智能合约哈希值的计算方法所对应的字符串以及与所述地址校验值的计算方法所对应的字符串依次排序进行组合,生成地址类型标识字符串。
以前述图2、图3、图4所示出的各流程图为例,则所述生成的地址类型标识字符串为001101201。
图6示出了本发明实施例提供的一种将地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值进行组合生成智能合约地址的流程图,详述如下。
本发明实施例中,所述将所述地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值进行组合生成智能合约地址的步骤,具体包括:
步骤601,将所述地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值进行组合。
步骤602,对组合后的地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值序列进行可逆编码生成智能合约地址。
所述进行可逆编码生成智能合约地址是指经过可逆编码生成的智能合约地 址能够通过解码生成编码前的进行过组合后的地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值序列。
所述可逆编码包括basic58,basic64等可逆编码方法。
图7为本发明实施例提供的一种智能合约地址生成装置的结构示意图,为了便于说明,仅示出了于本发明实施例相关的部分,
所述智能合约地址生成装置包括:
账户地址哈希单元701,用于根据智能合约发布者的账户地址生成账户地址哈希值。
智能合约哈希单元702,用于根据智能合约内容代码生成智能合约哈希值。
地址校验值单元703,用于根据所述账户地址哈希值和智能合约哈希值生成地址校检值。
地址类型确定单元704,用于根据所述账户地址哈希值的计算方法、所述智能合约哈希值的计算方法及所述地址校验值的计算方法,生成地址类型标识字符串。
组合生成单元705,用于将所述地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值进行组合生成智能合约地址。
图8为本发明实施例提供的一种智能合约地址生成装置中地址类型确定单元的结构示意图,为了便于说明,仅示出了于本发明实施例相关的部分,
所述智能合约生成装置中地址类型确定单元包括:
账户地址哈希值字符串获取模块801,用于根据所述账户地址哈希值的计算方法以及预设的账户地址哈希值的计算方法与字符串的对应关系,确定与所述账户地址哈希值的计算方法对应的字符串。
智能合约哈希值字符串获取模块802,用于根据所述智能合约哈希值的计算方法以及预设的智能合约哈希值的计算方法与字符串的对应关系,确定与所述智能合约哈希值的计算方法对应的字符串。
地址校验值字符串获取模块803,用于根据所述地址校验值的计算方法以及预设的地址校验值的计算方法与字符串的对应关系,确定与所述地址校验值的计算方法对应的字符串。
组合生成模块,用于将所述账户地址哈希值的计算方法所对应的字符串、与所述智能合约哈希值的计算方法所对应的字符串以及与所述地址校验值的计算方法所对应的字符串依次排序进行组合,生成地址类型标识字符串。
图9为本发明实施例提供的一种智能合约生成装置中组合生成单元的结构示意图,为了便于说明,仅示出了于本发明实施例相关的部分,
所述智能合约生成装置中组合生成单元包括:
组合模块901,用于将所述地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值进行组合。
编码模块902,用于对组合后的地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值序列进行可逆编码生成智能合约地址。
本发明实施例提供的智能合约地址的生成方法,通过在智能合约地址中加入地址类型标识字符串,其中标识字符串含有该地址的相应信息,便于判断区别该地址的类型,还将智能合约发布者的账户地址的哈希值与智能合约内容代码哈希值进行组合,而账户地址的哈希值能够对应着唯一的账户地址从而可以作为该账户地址的标识信息,(事实上,唯一并不精确,但是现有的哈希算法使得同一个账户地址哈希值对应多个账户地址的概率远远低于几千万亿分之一,无限接近于0,因此,一般默认账户地址的哈希值能够对应着唯一的账户地址),从而能够从生成的智能合约地址中含有智能合约发布者的账户地址的标识信息,便于直接确认智能合约发布者的账户地址以及身份信息。可以理解,当用户在获取到地址类型标识字符串以及账户地址的哈希值时,就能判断出账户地址信息,进一步确认合约发布者的身份;当两个智能合约地址中,地址类型标识字符串以及账户地址的哈希值相同时,说明所述两个智能合约拥有相同的发布者的账户地址,即两个智能合约的发布者相同。因此,智能合约发布者只需要管理地址类型标识字符串以及账户地址哈希值相同的智能合约地址,相比于管理几个地址信息完全不同的智能合约地址,具有很强的实用性。而加入地址校验值,便于确认智能合约地址的有效性,由于校验位是根据账户地址的哈希值以及智能合约内容代码的哈希值计算得到,当账户地址的哈希值以及智能合约内容代码的哈希值有某一数值发生改变时,得到的地址校验值完全不同, 因此可以用于判断在输入的过程中是否出现了错误。
本发明实施例提供一种计算机装置,该计算机装置包括处理器,所述处理器用于执行存储器中存储的计算机程序时实现上述图1至图6所示出的实施例所提供的智能合约地址生成方法的步骤。
示例性的,计算机程序可以被分割成一个或多个模块,一个或者多个模块被存储在存储器中,并由处理器执行,以完成本发明。一个或多个模块可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述计算机程序在计算机装置中的执行过程。例如,计算机程序可以被分割成上述各个方法实施例提供的智能合约地址生成方法的步骤。
本领域技术人员可以理解,上述计算机装置的描述仅仅是示例,并不构成对计算机装置的限定,可以包括比上述描述更多或更少的部件,或者组合某些部件,或者不同的部件,例如可以包括输入输出设备、网络接入设备、总线等。
所称处理器可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等,所述处理器是所述计算机装置的控制中心,利用各种接口和线路连接整个计算机装置的各个部分。
所述存储器可用于存储所述计算机程序和/或模块,所述处理器通过运行或执行存储在所述存储器内的计算机程序和/或模块,以及调用存储在存储器内的数据,实现所述计算机装置的各种功能。所述存储器可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器可以包括高速随机存取存储器,还可以包括非易失性存储器,例如硬盘、内存、插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)、至少一个磁盘存储器件、闪存器件、或其他易失 性固态存储器件。
所述计算机装置集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信号以及软件分发介质等。
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。

Claims (9)

  1. 一种智能合约地址的生成方法,其特征在于,所述方法包括以下步骤:
    根据智能合约发布者的账户地址生成账户地址哈希值;
    根据智能合约内容代码生成智能合约哈希值;
    根据所述账户地址哈希值和智能合约哈希值生成地址校检值;
    根据所述账户地址哈希值的计算方法、所述智能合约哈希值的计算方法及所述地址校验值的计算方法,生成地址类型标识字符串;
    将所述地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值进行组合生成智能合约地址。
  2. 根据权利要求1所述的方法,其特征在于,所述账户地址哈希值唯一对应账户地址。
  3. 根据权利要求1所述的方法,其特征在于,所述根据所述账户地址哈希值的计算方法、智能合约哈希值的计算方法及地址校验值的计算方法,生成地址类型标识字符串的步骤,具体包括:
    根据所述账户地址哈希值的计算方法以及预设的账户地址哈希值的计算方法与字符串的对应关系,确定与所述账户地址哈希值的计算方法对应的字符串;
    根据所述智能合约哈希值的计算方法以及预设的智能合约哈希值的计算方法与字符串的对应关系,确定与所述智能合约哈希值的计算方法对应的字符串;
    根据所述地址校验值的计算方法以及预设的地址校验值的计算方法与字符串的对应关系,确定与所述地址校验值的计算方法对应的字符串;
    将所述账户地址哈希值的计算方法所对应的字符串、与所述智能合约哈希值的计算方法所对应的字符串以及与所述地址校验值的计算方法所对应的字符串依次排序进行组合,生成地址类型标识字符串。
  4. 根据权利要求1所述的方法,其特征在于,所述将所述地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值进行组合生成智能合约地址的步骤,具体包括:
    将所述地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值进行组合;
    对组合后的地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值序列进行可逆编码生成智能合约地址。
  5. 一种智能合约地址生成装置,其特征在于,包括:
    账户地址哈希单元,用于根据智能合约发布者的账户地址生成账户地址哈希值;
    智能合约哈希单元,用于根据智能合约内容代码生成智能合约哈希值;
    地址校验值单元,用于根据所述账户地址哈希值和智能合约哈希值生成地址校检值;
    地址类型确定单元,根据所述账户地址哈希值的计算方法、所述智能合约哈希值的计算方法及所述地址校验值的计算方法,生成地址类型标识字符串;
    组合生成单元,用于将所述地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值进行组合生成智能合约地址。
  6. 根据权利要求5所述的装置,其特征在于,所述地址类型确定单元包括:
    账户地址哈希值字符串获取模块,用于根据所述账户地址哈希值的计算方法以及预设的账户地址哈希值的计算方法与字符串的对应关系,确定与所述账户地址哈希值的计算方法对应的字符串;
    智能合约哈希值字符串获取模块,用于根据所述智能合约哈希值的计算方法以及预设的智能合约哈希值的计算方法与字符串的对应关系,确定与所述智能合约哈希值的计算方法对应的字符串;
    地址校验值字符串获取模块,用于根据所述地址校验值的计算方法以及预设的地址校验值的计算方法与字符串的对应关系,确定与所述地址校验值的计算方法对应的字符串;
    组合生成模块,用于将所述账户地址哈希值的计算方法所对应的字符串、与所述智能合约哈希值的计算方法所对应的字符串以及与所述地址校验值的计算方法所对应的字符串依次排序进行组合,生成地址类型标识字符串。
  7. 根据权利要求5所述的装置,其特征在于,所述组合生成单元包括:
    组合模块,用于将所述地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值进行组合;
    编码模块,用于对组合后的地址类型标识字符串、账户地址哈希值、智能合约哈希值与地址校验值序列进行可逆编码生成智能合约地址。
  8. 一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行权利要求1至4中任一项权利要求所述智能合约地址的生成方法的步骤。
  9. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时,使得所述处理器执行权利要求1至4中任一项权利要求所述智能合约地址的生成方法的步骤。
PCT/CN2019/077933 2018-08-27 2019-03-13 智能合约地址生成方法、装置、计算机设备及可读存储介质 WO2020042586A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810978758.0 2018-08-27
CN201810978758.0A CN109040341B (zh) 2018-08-27 2018-08-27 智能合约地址的生成方法、装置、计算机设备及可读存储介质

Publications (1)

Publication Number Publication Date
WO2020042586A1 true WO2020042586A1 (zh) 2020-03-05

Family

ID=64624512

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/077933 WO2020042586A1 (zh) 2018-08-27 2019-03-13 智能合约地址生成方法、装置、计算机设备及可读存储介质

Country Status (2)

Country Link
CN (1) CN109040341B (zh)
WO (1) WO2020042586A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111597264A (zh) * 2020-05-15 2020-08-28 中国联合网络通信集团有限公司 一种区块链记账方法及装置
CN112364311A (zh) * 2020-11-10 2021-02-12 上海保险交易所股份有限公司 区块链上身份管理方法和装置
CN117390014A (zh) * 2023-09-27 2024-01-12 希维科技(广州)有限公司 电池护照标识的生成方法、设备及存储介质

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109040341B (zh) * 2018-08-27 2021-05-04 深圳前海益链网络科技有限公司 智能合约地址的生成方法、装置、计算机设备及可读存储介质
CN111507787A (zh) * 2019-01-30 2020-08-07 深圳富桂精密工业有限公司 商品交易方法、系统、计算机装置及可读存储介质
CA3057385C (en) * 2019-03-01 2023-02-14 Alibaba Group Holding Limited Methods and devices for protecting sensitive data of transaction activity based on smart contract in blockchain
CN111095236A (zh) 2019-06-28 2020-05-01 阿里巴巴集团控股有限公司 用于区块链地址映射的系统和方法
SG11202005059PA (en) 2019-06-28 2020-06-29 Alibaba Group Holding Ltd System and method for updating data in blockchain
CN110519277B (zh) * 2019-08-29 2020-08-21 上海威尔立杰网络科技发展有限公司 一种基于单点执行合约实现控制其它系统的方法
CN111475828B (zh) * 2020-05-14 2022-05-13 杭州烽顺科技信息服务有限公司 区块链账本数据的加密方法及装置、解密方法及装置
CN111835884B (zh) * 2020-07-13 2022-11-04 北京好扑信息科技有限公司 用于区块链的虚拟地址生成方法
CN111866134B (zh) * 2020-07-20 2023-01-13 联通灵境视讯(江西)科技有限公司 区块链交易哈希值和地址的生成方法、系统及存储介质
CN111986028A (zh) * 2020-08-21 2020-11-24 深圳前海益链网络科技有限公司 实名制合约地址生成方法、装置及计算机设备
CN112330311A (zh) * 2020-11-16 2021-02-05 深圳壹账通智能科技有限公司 基于区块链的众筹联合账户创建方法、设备及存储介质
CN112749152A (zh) * 2021-01-19 2021-05-04 矩阵元技术(深圳)有限公司 智能合约的数据迁移方法、装置及存储介质
CN113110843B (zh) * 2021-03-05 2023-04-11 卓尔智联(武汉)研究院有限公司 合约生成模型训练方法、合约生成方法及电子设备
CN114362960A (zh) * 2021-12-31 2022-04-15 杭州趣链科技有限公司 资源账户的数据监管方法、装置、计算机设备及介质
CN115914249B (zh) * 2022-12-05 2023-09-29 淮阴工学院 基于区块链块分类的冷链数据存储与查询方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107832275A (zh) * 2017-11-29 2018-03-23 北京欧链科技有限公司 区块链中智能合约标识的生成方法、装置及系统
CN107945021A (zh) * 2017-12-07 2018-04-20 杭州趣链科技有限公司 一种基于区块链智能合约的数字资产管理方法
CN108170740A (zh) * 2017-12-18 2018-06-15 深圳前海微众银行股份有限公司 数据迁移方法、系统和计算机可读存储介质
US20180225194A1 (en) * 2016-05-16 2018-08-09 Jpmorgan Chase Bank, N.A. Method and system for implementing an automation software testing and packaging framework with entitlements
CN109040341A (zh) * 2018-08-27 2018-12-18 深圳前海益链网络科技有限公司 智能合约地址生成方法、装置、计算机设备及可读存储介质

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170344988A1 (en) * 2016-05-24 2017-11-30 Ubs Ag System and method for facilitating blockchain-based validation
CN106407430B (zh) * 2016-09-27 2019-09-03 北京天德科技有限公司 一种基于阶段桶的复杂智能合约状态同步方法
CN106779704A (zh) * 2016-12-06 2017-05-31 杭州趣链科技有限公司 一种基于环签名的区块链匿名交易方法
CN106779708B (zh) * 2016-12-23 2021-02-02 中钞信用卡产业发展有限公司杭州区块链技术研究院 基于智能合约的区块链上参与方身份管理方法及系统
CN106878022B (zh) * 2017-02-15 2019-12-24 中钞信用卡产业发展有限公司杭州区块链技术研究院 在区块链上签名、验证的方法及装置
CN108270571B (zh) * 2017-12-08 2019-10-11 西安电子科技大学 基于区块链的物联网身份认证系统及其方法
CN108322558B (zh) * 2017-12-28 2021-01-01 北京欧链科技有限公司 关联地址信息的方法、装置及系统
CN108235805B (zh) * 2017-12-29 2021-07-30 达闼机器人有限公司 账户统一方法、装置及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180225194A1 (en) * 2016-05-16 2018-08-09 Jpmorgan Chase Bank, N.A. Method and system for implementing an automation software testing and packaging framework with entitlements
CN107832275A (zh) * 2017-11-29 2018-03-23 北京欧链科技有限公司 区块链中智能合约标识的生成方法、装置及系统
CN107945021A (zh) * 2017-12-07 2018-04-20 杭州趣链科技有限公司 一种基于区块链智能合约的数字资产管理方法
CN108170740A (zh) * 2017-12-18 2018-06-15 深圳前海微众银行股份有限公司 数据迁移方法、系统和计算机可读存储介质
CN109040341A (zh) * 2018-08-27 2018-12-18 深圳前海益链网络科技有限公司 智能合约地址生成方法、装置、计算机设备及可读存储介质

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111597264A (zh) * 2020-05-15 2020-08-28 中国联合网络通信集团有限公司 一种区块链记账方法及装置
CN111597264B (zh) * 2020-05-15 2023-06-23 中国联合网络通信集团有限公司 一种区块链记账方法及装置
CN112364311A (zh) * 2020-11-10 2021-02-12 上海保险交易所股份有限公司 区块链上身份管理方法和装置
CN112364311B (zh) * 2020-11-10 2024-01-26 上海保险交易所股份有限公司 区块链上身份管理方法和装置
CN117390014A (zh) * 2023-09-27 2024-01-12 希维科技(广州)有限公司 电池护照标识的生成方法、设备及存储介质

Also Published As

Publication number Publication date
CN109040341A (zh) 2018-12-18
CN109040341B (zh) 2021-05-04

Similar Documents

Publication Publication Date Title
WO2020042586A1 (zh) 智能合约地址生成方法、装置、计算机设备及可读存储介质
US11303603B2 (en) System and method for identity resolution across disparate distributed immutable ledger networks
US11501533B2 (en) Media authentication using distributed ledger
US11474971B2 (en) System and method for creating a mutual reference between a blockchain and a private repository
US11074245B2 (en) Method and device for writing service data in block chain system
US11823178B2 (en) Optimization of high volume transaction performance on a blockchain
US10361869B2 (en) Event ledger
US11303626B2 (en) Secure token passing via hash chains
JP2020519983A (ja) 並列処理ブロックチェーントランザクションのためのシステムおよび方法
CN109493054B (zh) 多链信息管理方法、装置、存储介质和区块链身份解析器
JP2017526253A (ja) 端末識別子を促進する方法及びシステム
US11917088B2 (en) Integrating device identity into a permissioning framework of a blockchain
JP2022541323A (ja) ブロックチェーントランザクションを利用したデジタル契約
US11290256B2 (en) Blockchain-based advertisement monitoring method and apparatus, and electronic device
CN108564461B (zh) 一种资源配置方法、计算机可读存储介质及终端设备
WO2022116761A1 (en) Self auditing blockchain
US11044104B2 (en) Data certification as a service powered by permissioned blockchain network
US20200213100A1 (en) Multi-chain information management method, storage medium and blockchain identity parser
CN111291084A (zh) 样本id对齐方法、装置、设备及存储介质
US11563585B1 (en) Systems and methods for smart contracts including arbitration attributes
WO2019214067A1 (zh) 区块链上用户通信方法、装置、终端设备及存储介质
CN110209666B (zh) 一种数据存储方法及终端设备
TWI748590B (zh) 軟體程式驗證方法、電子裝置及存儲介質
CN117668098A (zh) 区块链地址保护方法、装置以及系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19853650

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 09.06.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19853650

Country of ref document: EP

Kind code of ref document: A1