WO2024032209A1 - 区块链交易验证方法、装置、存储介质及电子设备 - Google Patents

区块链交易验证方法、装置、存储介质及电子设备 Download PDF

Info

Publication number
WO2024032209A1
WO2024032209A1 PCT/CN2023/103603 CN2023103603W WO2024032209A1 WO 2024032209 A1 WO2024032209 A1 WO 2024032209A1 CN 2023103603 W CN2023103603 W CN 2023103603W WO 2024032209 A1 WO2024032209 A1 WO 2024032209A1
Authority
WO
WIPO (PCT)
Prior art keywords
verification
file
transaction
signature information
logic file
Prior art date
Application number
PCT/CN2023/103603
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 WO2024032209A1 publication Critical patent/WO2024032209A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3825Use of electronic signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/52Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow
    • G06F21/53Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow by executing in a restricted environment, e.g. sandbox or secure virtual machine
    • 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

  • This application relates to the field of blockchain technology, and in particular to a blockchain transaction verification method, device, storage medium and electronic equipment.
  • Blockchain is a new application model of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Because blockchain has the characteristics of decentralization, non-tampering, full traceability, traceability, collective maintenance, openness and transparency, etc. These characteristics ensure the “honesty” and “transparency” of the blockchain. Therefore, transactions based on the blockchain can solve the problem of information asymmetry and achieve collaborative trust and consistent action among multiple subjects.
  • the signature verification of transaction files requires calling some interfaces on the server side for verification.
  • the verification algorithm is defined internally on the server side.
  • the inventor realized that this black box It is difficult to troubleshoot when a pattern causes errors, and there is no way to know whether the algorithm is correct.
  • the front-end page needs to request services through the http protocol, the status of the server will affect the return of results. If the server is down, the request will be invalid, so the service of this method is not stable enough; in addition, because it takes time to establish an http request and increases data Overhead and power consumption, thus leading to low verification efficiency; moreover, the communication established between the front-end and the server may be attacked by a man-in-the-middle and has low security.
  • this application provides a blockchain transaction verification method, device, medium and equipment, which completes the signature verification of the blockchain transaction file on the client, and solves the problem caused by calling the server interface to verify the signature in the existing method. The problem.
  • a blockchain transaction verification method is provided, which is applied to the client in the blockchain transaction system.
  • the method includes:
  • the verification logic file is called, and the verification logic file is used to verify the signature information, and a verification result corresponding to the signature information is obtained.
  • a blockchain transaction verification device which is applied to clients in a blockchain transaction system.
  • the device includes:
  • An acquisition module configured to respond to a blockchain-based transaction verification request from a user and obtain the transaction file corresponding to the request;
  • a parsing module used by the client to parse the transaction file and obtain the signature information in the transaction file
  • a verification module is used to call a verification logic file, and use the verification logic file to verify the signature information, and obtain a verification result corresponding to the signature information.
  • a storage medium on which a computer program is stored.
  • the computer program is executed by a processor, the following steps are implemented:
  • the verification logic file is called, and the verification logic file is used to verify the signature information, and a verification result corresponding to the signature information is obtained.
  • an electronic device including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor.
  • the processor executes the computer program, the following steps are implemented: :
  • the verification logic file is called, and the verification logic file is used to verify the signature information, and a verification result corresponding to the signature information is obtained.
  • the client of this application completes the verification of the signature information through the verification logic file and obtains the verification result.
  • the verification logic for the signature information is written in the verification logic file.
  • this white box model can be used according to the verification logic file. Verify logical files for troubleshooting, making troubleshooting more efficient.
  • this embodiment does not need to call the server, does not need to deploy additional server code, and will not affect the stability of the verification process due to server downtime.
  • this embodiment does not establish an http request with the server, but performs the verification process at a local running speed to avoid wasting time on communication. It also avoids the established communication being attacked by a man-in-the-middle, improving verification efficiency and security.
  • Figure 1 shows a schematic flow chart of a blockchain transaction verification method provided by an embodiment of the present application
  • Figure 2 shows a schematic flow chart of target statement preprocessing of another blockchain transaction verification method provided by the embodiment of the present application
  • Figure 3 shows a schematic flow chart of determining the target standard disease name for another blockchain transaction verification method provided by the embodiment of the present application
  • Figure 4 shows a structural block diagram of a blockchain transaction verification device provided by an embodiment of the present application.
  • a blockchain transaction verification method is provided, which is applied to the client in the blockchain transaction system. As shown in Figure 1, the method includes:
  • Step 101 In response to the blockchain-based transaction verification request from the user, obtain the transaction file corresponding to the request;
  • the blockchain transaction verification method provided by the embodiment of this application is suitable for verifying whether the blockchain transaction is valid.
  • the user sends a transaction verification request to the client.
  • the client verifies whether the transaction file is authentic and trustworthy by verifying the signature information. Therefore, first obtain the transaction file corresponding to the request, and then analyze the transaction file to obtain the verification result.
  • the user can issue a transaction verification request by clicking a button or inputting a voice command, or by directly loading the transaction file into the client.
  • the transaction file can be loaded by dragging the transaction file to the transaction verification page of the client.
  • Step 102 parse the transaction file and obtain the signature information in the transaction file
  • the transaction file includes signature information.
  • the signature information is a digital string that can only be generated by the sender of the information and cannot be forged by others. This digital string is also a digital string sent to the sender of the information. An effective proof of the authenticity of the information. Based on the signature information, the authenticity and integrity of the transaction document can be verified.
  • Step 103 Use the verification logic file to verify the signature information and obtain the verification result corresponding to the signature information.
  • this embodiment does not interact with the server or call the http interface, but uses the client to perform the entire verification operation.
  • the client can be a browser.
  • the client since the blockchain is usually developed using Go language or Java language, etc., and the client is usually developed using JavaScript language, the client cannot directly parse the Go language or Java language, etc., that is, it cannot directly analyze the blockchain.
  • the signature information of the transaction file is verified. Based on this, this embodiment designs a verification logic file for verifying signature information, so that the client can verify the signature information through the verification logic file and obtain a corresponding verification result.
  • the transaction document can be considered authentic and valid, otherwise the transaction document is considered invalid.
  • the client completes the verification of the signature information through the verification logic file and obtains the verification result.
  • the verification logic for the signature information is written in the verification logic file.
  • this white box mode can Conduct troubleshooting based on the verification logic file to make troubleshooting more efficient.
  • this embodiment does not need to call the server, does not need to deploy additional server code, and will not affect the stability of the verification process due to server downtime.
  • this embodiment does not establish an http request with the server, but performs the verification process at a local running speed to avoid wasting time on communication. It also avoids the established communication being attacked by a man-in-the-middle, improving verification efficiency and security.
  • Step 201 use JavaScript to call the verification interface in the verification logic file, and use the verification method corresponding to the verification interface to verify the hash value of the signature information;
  • Step 202 If the hash value is true, the verification result is that the verification is passed, otherwise the verification result is that the verification is not passed.
  • the client obtains the signature information from the transaction file, and then verifies the signature. Among them, the client determines whether it passes the verification based on the hash value of the signature information.
  • the hash value is a value obtained through logical operations based on the data in the file content. The hash values obtained by different files (even with the same file name) are different. therefore. If two files If the hash values are different, the two files can be considered to be different files. Based on this principle, it can be considered that if the signature information is tampered with, its corresponding hash value will also change. Therefore, this embodiment uses the hash value to verify the signature information. If the hash value is true and valid, it is considered The signature information is also true and valid, so the verification result is passed; otherwise, the verification result is failed.
  • the client uses JavaScript language to call the verification interface in the verification logic file, where the verification logic file includes a verification method corresponding to the verification interface.
  • the client passes the signature information to the verification method through the verification interface.
  • the verification method determines whether the signature information is authentic and valid based on the hash value of the signature information, obtains the verification result, and returns the verification result to the client through the verification interface.
  • the verification logic file of this embodiment provides a verification interface, and can call the verification method through the verification interface, and use the verification method to implement the verification process, which effectively solves the problem in existing verification methods that the client cannot directly parse commonly used blockchain parameters.
  • the problem caused by go language or java language is that only the server interface can be called to use the server for verification.
  • the characteristics of the hash value are used to determine whether the signature information is authentic and valid, ensuring the accuracy of the verification results.
  • Step 301 Use go language to generate an initial file corresponding to the verification logic file
  • Step 302 Use WebAssembly commands to convert the initial file into a verification logic file, where the verification logic file includes a verification interface and a verification method, and the verification method is used to verify the signature information.
  • steps 301-302 first use the go language to write an initial file.
  • the initial file can implement the verification logic of the signature information of the blockchain transaction file. Since JavaScript cannot parse the Go language, after the initial file is compiled, the WebAssembly command is used to perform the file conversion operation and compile the initial file into a verification logic file, so that the client can use JavaScript to call the interface in the verification logic file.
  • the verification logic file includes a verification interface and a verification method corresponding to the verification interface.
  • the verification method can verify the authenticity of the signature information.
  • the verification interface provides an interaction channel for the verification method and JavaScript, so that the JavaScript method can call the verification interface to Use the verification interface to call the verification method, and then execute the steps in the verification method to verify the signature information.
  • This embodiment uses WebAssembly commands to convert the initial file into a verification logic file.
  • the verification logic file is used as a bridge between the go language used for blockchain development and the JavaScript language used by the client, which solves the problem that the client cannot directly verify the area.
  • Blockchain transaction files can only call the server interface for verification.
  • the verification logic file is a binary file in wasm format.
  • the verification logic file is a binary file in wasm format. It can be understood that wasm is a low-level, portable bytecode format for front-end scripts, and is a new type of bytecode format that runs in modern web browsers. code. As a layer of intermediate language, wasm connects Java, Python, Rust, and Cpp to the upper layer, so that these languages can be compiled into a unified format for running on the client, effectively solving the problem of the client being unable to run the Go language.
  • wasm's bytecode can use fewer bytes to represent the same instructions, and can be compiled while the WebAssembly module is still being downloaded. Therefore, the wasm format binary Files are more efficient. Furthermore, files in the wasm format are readable and debuggable, making it easy to debug and find bugs when an error occurs during operation.
  • Step 401 Build a sandbox environment, where the sandbox environment is used to run the verification logic file.
  • the wasm format file needs to be run in a sandbox. Therefore, before calling the verification interface of the verification logic file, a sandbox environment for running the verification logic file is set up in the client.
  • QuickJS can be used to build a sandbox environment, or other sandbox environments can be selected, which are not limited here.
  • the method also includes:
  • Step 501 Build a client based on the Vue framework, where the client is written in JavaScript.
  • JavaScript is used to write the front-end page of the browser and is built based on the Vue framework.
  • Vue is a progressive front-end framework for building user interfaces, which can be used to dynamically build front-end interfaces.
  • clients built based on the Vue framework have the characteristics of simple coding, smaller size, and high operating efficiency.
  • the client can also be built based on the Angular framework or the React framework.
  • Step 601 Parse the transaction file and obtain the transaction information in the transaction file
  • Step 602 Display transaction information and verification results on the client.
  • the verification result is displayed on the client, and the verification result is either passed verification or failed verification.
  • the transaction information in the transaction file can be displayed together with the verification results, so that users can intuitively know which transaction file has passed or failed verification.
  • the transaction information includes the identities of both parties to the transaction, detailed information of the transaction items, etc.
  • the blockchain transaction verification device includes: an acquisition module and an analysis module. and verification module.
  • the acquisition module is used to respond to a blockchain-based transaction verification request from a user and obtain the transaction file corresponding to the request;
  • Parsing module used to parse transaction files and obtain signature information in transaction files
  • the verification module is used to call the verification logic file, and use the verification logic file to verify the signature information, and obtain verification results corresponding to the signature information.
  • the verification module is specifically used for:
  • the device also includes an initialization module, specifically used for:
  • the verification logic file includes a verification interface and a verification method.
  • the verification method is used to verify signature information.
  • the verification logic file is a binary file in wasm format.
  • the device also includes an environment building module, which is specifically used for:
  • the initialization module is also used to:
  • the parsing module is also used to:
  • the device also includes display modules specifically for:
  • a storage medium on which a computer program is stored.
  • the program or instructions are executed by a processor, the above-mentioned blockchain transaction verification method is implemented.
  • an electronic device including a storage medium, a processor, and a computer program stored on the storage medium and capable of running on the processor.
  • the processor executes the program, the above-mentioned blockchain transaction verification method is implemented. .
  • embodiments of the present application also provide a storage medium on which a computer program is stored.
  • the program is executed by a processor, the above described Figures 1 to 3 are implemented.
  • the technical solution of the present application can be embodied in the form of a software product.
  • the software product can be stored in a computer-readable storage medium.
  • the computer-readable storage medium can be a non-volatile storage medium (can be a CD). -ROM, U disk, mobile hard disk, etc.), or it can be a volatile storage medium.
  • the computer-readable storage medium includes a number of instructions to make an electronic device (can be a personal computer, server, or network device, etc.) Execute the methods described in each implementation scenario of this application.
  • embodiments of the present application also provide an electronic device, which can be a personal computer. , servers, network equipment, etc., the electronic equipment includes a storage medium and a processor; the storage medium is used to store computer programs; the processor is used to execute the computer program to implement the above-mentioned blockchain transactions as shown in Figures 1 to 9 Authentication method.
  • the electronic equipment includes a storage medium and a processor; the storage medium is used to store computer programs; the processor is used to execute the computer program to implement the above-mentioned blockchain transactions as shown in Figures 1 to 9 Authentication method.
  • the electronic device may also include a user interface, a network interface, a camera, a radio frequency (Radio Frequency, RF) circuit, a sensor, an audio circuit, a WI-FI module, etc.
  • the user interface may include a display screen (Display), an input unit such as a keyboard (Keyboard), etc.
  • the optional user interface may also include a USB interface, a card reader interface, etc.
  • Optional network interfaces may include standard wired interfaces, wireless interfaces (such as Bluetooth interfaces, WI-FI interfaces), etc.
  • an electronic device does not constitute a limitation on the electronic device, and may include more or fewer components, or combine certain components, or arrange different components.
  • the storage medium may also include an operating device and a network communication module.
  • the operating device is a program that manages and saves the hardware and software resources of electronic equipment and supports information processing programs and other software and/or programs. sequence operation.
  • the network communication module is used to implement communication between controls within the storage medium, as well as communication with other hardware and software in the physical device.
  • the accompanying drawing is only a schematic diagram of a preferred implementation scenario, and the units or processes in the accompanying drawing are not necessarily necessary for implementing the present application.
  • the units in the devices in the implementation scenario can be distributed in the devices in the implementation scenario according to the description of the implementation scenario, or can be correspondingly changed and located in one or more devices different from the implementation scenario.
  • the units of the above implementation scenarios can be combined into one unit or further split into multiple sub-units.

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Accounting & Taxation (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Storage Device Security (AREA)

Abstract

本申请涉及区块链技术领域,公开了一种区块链交易验证方法及装置、存储介质和电子设备,应用于区块链交易系统中的客户端,方法包括:响应于来自用户的基于区块链的交易验证请求,获取与请求对应的交易文件;解析交易文件,得到交易文件中的签名信息;调用逻辑验证文件,并利用验证逻辑文件验证签名信息,得到与签名信息对应的验证结果。本申请的方法在客户端完成区块链交易文件的签名验证,解决了现有方法中调用服务端接口验证签名所导致的出错难以排查、服务稳定性低、验证效率低以及安全性低等问题。

Description

区块链交易验证方法、装置、存储介质及电子设备
本申请要求于2022年08月11日提交中国专利局、申请号为202210961126.X、申请名称为“区块链交易验证方法、装置、存储介质及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在申请中。
技术领域
本申请涉及区块链技术领域,尤其是涉及到一种区块链交易验证方法、装置、存储介质及电子设备。
背景技术
区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。由于区块链具有去中心化、不可篡改、全程留痕、可以追溯、集体维护、公开透明等特点。这些特点保证了区块链的“诚实”与“透明”,因此,基于区块链的交易能够解决信息不对称问题,实现多个主体之间的协作信任与一致行动。
现有的区块链交易过程中,交易文件的签名验证都是需要去调用服务端的一些接口去验证的,其中,验证算法是在服务端内部定义的,发明人意识到,这种黑盒的模式导致出错时不好排查,也无从得知算法是否正确。并且由于前端页面需要通过http协议去请求服务,服务器的状态会影响结果的返回,若是服务器宕机,则请求无效,因此这种方法服务不够稳定;此外,由于建立http请求需要花费时间并且增加数据开销和功耗,因此导致验证效率低;并且,前端与服务端建立的通信有可能被中间人攻击,安全性较低。
发明内容
有鉴于此,本申请提供了一种区块链交易验证方法、装置、介质及设备,在客户端完成区块链交易文件的签名验证,解决了现有方法中调用服务端接口验证签名所导致的问题。
根据本申请的一个方面,提供了一种区块链交易验证方法,应用于区块链交易系统中的客户端,方法包括:
响应于来自用户的基于区块链的交易验证请求,获取与所述请求对应的交易文件;
解析所述交易文件,得到所述交易文件中的签名信息;
调用验证逻辑文件,并利用所述验证逻辑文件验证所述签名信息,得到与所述签名信息对应的验证结果。
根据本申请的另一方面,提供了一种区块链交易验证装置,应用于区块链交易系统中的客户端,所述装置包括:
获取模块,用于响应于来着用户的基于区块链的交易验证请求,获取与所述请求对应的交易文件;
解析模块,用于客户端解析所述交易文件,得到所述交易文件中的签名信息;
验证模块,用于调用验证逻辑文件,并利用所述验证逻辑文件验证所述签名信息,得到与所述签名信息对应的验证结果。
根据本申请又一个方面,提供了一种存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:
响应于来自用户的基于区块链的交易验证请求,获取与所述请求对应的交易文件;
解析所述交易文件,得到所述交易文件中的签名信息;
调用验证逻辑文件,并利用所述验证逻辑文件验证所述签名信息,得到与所述签名信息对应的验证结果。
根据本申请再一个方面,提供了一种电子设备,包括存储介质、处理器及存储在存储介质上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现以下步骤:
响应于来自用户的基于区块链的交易验证请求,获取与所述请求对应的交易文件;
解析所述交易文件,得到所述交易文件中的签名信息;
调用验证逻辑文件,并利用所述验证逻辑文件验证所述签名信息,得到与所述签名信息对应的验证结果。
借由上述技术方案,本申请客户端通过验证逻辑文件完成签名信息的验证,得到验证结果,针对签名信息的验证逻辑写在验证逻辑文件内,在出现错误时,这种白盒的模式可根据验证逻辑文件进行排查,排错效率更高。此外,本实施例无需调用服务端,不需要额外部署服务端代码,也不会因服务端宕机等影响验证过程的稳定性。进一步地,本实施例不与服务器建立http请求,而是本地运行的速度去执行验证过程,避免在通信上耗费时间,同时也避免建立的通信被中间人攻击,提高了验证效率以及安全性。
上述说明仅是本申请技术方案的概述,为了能够更清楚了解本申请的技术手段,而可依照说明书的内容予以实施,并且为了让本申请的上述和其它目的、特征和优点能够更明显易懂,以下特举本申请的具体实施方式。
附图说明
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1示出了本申请实施例提供的一种区块链交易验证方法的流程示意图;
图2示出了本申请实施例提供的另一种区块链交易验证方法的确定目标语句预处理的流程示意图;
图3示出了本申请实施例提供的另一种区块链交易验证方法的确定目标标准疾病名称的流程示意图;
图4示出了本申请实施例提供的一种区块链交易验证装置的结构框图。
具体实施方式
在本实施例中提供了一种区块链交易验证方法,应用于区块链交易系统中的客户端,如图1所示,该方法包括:
步骤101,响应于来自用户的基于区块链的交易验证请求,获取与请求对应的交易文件;
本申请实施例提供的区块链交易验证方法,适用于验证区块链交易是否有效。
在该步骤中,用户向客户端发出交易验证请求,客户端接收到交易验证请求后,通过验证签名信息的方式来验证交易文件是否真实可信。因此,首先获取与请求对应的交易文件,进而对交易文件中进行分析,得到验证结果。
进一步地,用户可通过点击按钮或语音输入指令等方式发出交易验证请求,也可采用直接将交易文件加载至客户端等方式发出交易请求。其中,可通过拖拽交易文件至客户端的交易验证页面内实现交易文件的加载。
步骤102,解析交易文件,得到交易文件中的签名信息;
具体地,交易文件包括签名信息,签名信息是只有信息的发送者才能产生的别人无法伪造的一段数字串,这段数字串同时也是对信息的发送者发送 信息真实性的一个有效证明。根据签名信息,可以验证交易文件的真实性以及完整性。
步骤103,利用验证逻辑文件,验证签名信息,得到与签名信息对应的验证结果。
在该步骤中,有别于现有技术中请求调用服务端的接口验证签名信息的方法,本实施例不与服务端进行交互,也不调用http接口,而是利用客户端进行整个验证操作。其中,客户端可为浏览器。
具体地,由于区块链通常采用go语言或java语言等进行开发,而客户端通常采用JavaScript语言进行开发,因此,客户端无法直接解析go语言或java语言等,也即无法直接对区块链交易文件的签名信息进行验证。基于此,本实施例设计了用于验证签名信息的验证逻辑文件,使得客户端可通过验证逻辑文件来验证签名信息,得到与之对应的验证结果。
其中,若验证结果为通过验证,则可认为交易文件真实有效,反之则认为交易文件无效。
通过应用本实施例的技术方案,客户端通过验证逻辑文件完成签名信息的验证,得到验证结果,针对签名信息的验证逻辑写在验证逻辑文件内,在出现错误时,这种白盒的模式可根据验证逻辑文件进行排查,排错效率更高。此外,本实施例无需调用服务端,不需要额外部署服务端代码,也不会因服务端宕机等影响验证过程的稳定性。进一步地,本实施例不与服务器建立http请求,而是本地运行的速度去执行验证过程,避免在通信上耗费时间,同时也避免建立的通信被中间人攻击,提高了验证效率以及安全性。
进一步地,作为上述实施例具体实施方式的细化和扩展,为了完整说明本实施例的具体实施过程,提供了另一种区块链交易验证方法,如图2所示,调用验证逻辑文件,并利用验证逻辑文件验证签名信息,具体包括:
步骤201,利用JavaScript调用验证逻辑文件中的验证接口,利用与验证接口对应的验证方法验证签名信息的哈希值;
步骤202,若哈希值为真,则验证结果为通过验证,否则验证结果为未通过验证。
在步骤201-202中,客户端从交易文件中获取签名信息,然后针对签名进行校验。其中,客户端根据签名信息的哈希值判断是否通过验证。可以理解的是,哈希(hash)值是是根据文件内容的数据,通过逻辑运算得到的数值,不同的文件(即使是相同的文件名)得到的哈希值是不同的。因此。若两个文件的 哈希值不同,可认为这两个文件是不同的文件。基于这样的原理,可认为若签名信息有任何篡改,其对应的哈希值也会发生变化,因此,本实施例利用哈希值来验证签名信息,若哈希值是真实有效的,则认为签名信息也是真实有效的,因此验证结果为通过验证;反之验证结果为未通过验证。
在具体验证过程中,客户端利用JavaScript语言来调用验证逻辑文件中的验证接口,其中,在验证逻辑文件中包括与验证接口对应的验证方法。客户端通过验证接口将签名信息传递至验证方法,验证方法根据签名信息的哈希值判断签名信息是否真实有效,得到验证结果,并通过验证接口将验证结果返回至客户端。
该实施例的验证逻辑文件提供了验证接口,并可通过验证接口调用验证方法,利用验证方法来实现验证过程,有效解决了现有的验证方法中,由于客户端无法直接解析区块链常用的go语言或java语言所导致的只能调用服务端接口,以利用服务端进行验证的问题。此外,利用哈希值的特征判断签名信息是否真实有效,保证了验证结果的准确性。
进一步地,在另一种区块链交易验证方法中,如图3所示,调用验证逻辑文件之前,还包括:
步骤301,利用go语言生成与验证逻辑文件对应的初始文件;
步骤302,利用WebAssembly命令,将初始文件转换成为验证逻辑文件,其中,验证逻辑文件包括验证接口以及验证方法,验证方法用于验证签名信息。
在步骤301-302中,首先利用go语言编写初始文件,初始文件可实现对区块链交易文件的签名信息的验证逻辑。由于JavaScript无法解析go语言,因此在初始文件编制完成后,利用WebAssembly命令执行文件转换操作,将初始文件编译成为验证逻辑文件,从而使得客户端可利用JavaScript调用验证逻辑文件中的接口。
其中,验证逻辑文件包括验证接口和与验证接口对应的验证方法,验证方法可验证签名信息的真伪,验证接口则为验证方法与JavaScript提供了交互通道,使得JavaScript的方法可调用验证接口,以利用验证接口调用验证方法,进而执行验证方法中的步骤,实现签名信息的验证。
该实施例利用WebAssembly命令将初始文件转换成为验证逻辑文件,利用验证逻辑文件作为区块链开发所使用的go语言以及客户端所使用的JavaScript语言之间的桥梁,解决了客户端无法直接验证区块链交易文件,只能调用服务端接口验证的问题。
进一步地,在另一种区块链交易验证方法中,验证逻辑文件是wasm格式的二进制文件。
在该实施例中,验证逻辑文件是wasm格式的二进制文件,可以理解的是,wasm是用于前端脚本的低级、可移植的字节码格式,是一种运行在现代网络浏览器中的新型代码。wasm作为一层中间语言,上层对接Java、Python、Rust、Cpp,让这些语言都能编译成统一的格式,用于在客户端中运行,有效解决了客户端无法运行go语言的问题。
此外,相较于客户端中运行的JavaScript等语言,wasm的字节码可以用更少的字节表示相同的指令,并且在WebAssembly模块依然处于下载期间就可以被编译,因此,wasm格式的二进制文件的效率更高。进一步地,wasm格式的文件具有可读可调试的特点,在运行出现错误时,便于调试查找bug。
进一步地,在另一种区块链交易验证方法中,利用JavaScript调用验证逻辑文件中的验证接口之前,还包括:
步骤401,搭建沙盒环境,其中,沙盒环境用于运行验证逻辑文件。
在该实施例中,wasm格式的文件需要在沙盒中运行,因此,在调用验证逻辑文件的验证接口之前,在客户端中搭建用于运行验证逻辑文件的沙盒环境。
其中,可利用QuickJS来搭建沙盒环境,也可选择其他的沙盒环境,在此不做限定。
在沙盒中,除了初始化时程序主动提供的内容,无法访问其他主机的内存和函数。并且运行时产生的变化可以随后删除,不会对系统产生永久性影响。这意味着,WebAssembly不会损坏主机进程内存,也无法随意访问文件系统或与其他设备通信,进一步提高了整个验证过程中的安全性。
进一步地,在另一种区块链交易验证方法中,方法还包括:
步骤501,基于Vue框架,搭建客户端,其中,客户端利用JavaScript编写。
在该实施例中,利用JavaScript编写浏览器的前端页面,并基于Vue框架搭建。其中,Vue是一套构建用户界面的渐进式前端框架,可用于动态构建前端界面。相较于传统的客户端,基于Vue框架搭建的客户端具有编码简洁、体积较小、运行效率高等特点。
进一步地,客户端还可基于Angular框架或React框架搭建。
进一步地,在另一种区块链交易验证方法中,得到与签名信息对应的验证结果之后,还包括:
步骤601,解析交易文件,得到交易文件中的交易信息;
步骤602,在客户端展示交易信息以及验证结果。
在该实施例中,在验证签名信息,得到与签名信息对应的验证结果之后,在客户端中展示验证结果,验证结果为通过验证或未通过验证。
此外,还可将交易文件中的交易信息与验证结果一并展示出来,使得用户可直观地获知是哪个交易文件通过验证或未通过验证。其中,交易信息中包括交易双方身份、交易项目详细信息等。
进一步地,作为上述区块链交易验证方法的具体实现,本申请实施例提供了一种区块链交易验证装置,如图4所示,该区块链交易验证装置包括:获取模块、解析模块以及验证模块。
获取模块,用于响应于来自用户的基于区块链的交易验证请求,获取与请求对应的交易文件;
解析模块,用于解析交易文件,得到交易文件中的签名信息
验证模块,用于调用验证逻辑文件,并利用验证逻辑文件验证签名信息,得到与签名信息对应的验证结果。
在具体的应用场景中,可选地,验证模块,具体用于:
利用JavaScript调用验证逻辑文件中的验证接口,利用与验证接口对应的验证方法验证签名信息的哈希值;
若哈希值为真,则验证结果为通过验证,否则验证结果为未通过验证。
在具体的应用场景中,可选地,装置还包括初始化模块,具体用于:
利用go语言生成与验证逻辑文件对应的初始文件;
利用WebAssembly命令,将初始文件转换成为验证逻辑文件,其中,验证逻辑文件包括验证接口以及验证方法,验证方法用于验证签名信息。
在具体的应用场景中,可选地,验证逻辑文件是wasm格式的二进制文件。
在具体的应用场景中,可选地,装置还包括环境搭建模块,具体用于:
搭建沙盒环境,其中,沙盒环境用于运行验证逻辑文件。
在具体的应用场景中,可选地,初始化模块还用于:
基于Vue框架,搭建客户端,其中,客户端利用JavaScript编写。
在具体的应用场景中,可选地,解析模块还用于:
解析交易文件,得到交易文件中的交易信息
装置还包括展示模块,具体用于:
在客户端展示交易信息以及验证结果。
根据本申请又一个方面,提供了一种存储介质,其上存储有计算机程序,程序或指令被处理器执行时实现上述区块链交易验证方法。
根据本申请再一个方面,提供了一种电子设备,包括存储介质、处理器及存储在存储介质上并可在处理器上运行的计算机程序,处理器执行程序时实现上述区块链交易验证方法。
需要说明的是,本申请实施例提供的一种区块链交易验证装置所涉及各功能模块的其他相应描述,可以参考图1至图3中的对应描述,在此不再赘述。
基于上述如图1至图3所示方法,相应的,本申请实施例还提供了一种存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述如图1至图3所示的区块链交易验证方法。
基于这样的理解,本申请的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个计算机可读存储介质中,该计算机可读存储介质可以是非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等),也可以是易失性存储介质,该计算机可读存储介质中包括若干指令用以使得一台电子设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施场景所述的方法。
基于上述如图1至图3所示的方法,以及图4所示的区块链交易验证装置实施例,为了实现上述目的,本申请实施例还提供了一种电子设备,具体可以为个人计算机、服务器、网络设备等,该电子设备包括存储介质和处理器;存储介质,用于存储计算机程序;处理器,用于执行计算机程序以实现上述如图1至图9所示的区块链交易验证方法。
可选地,该电子设备还可以包括用户接口、网络接口、摄像头、射频(Radio Frequency,RF)电路,传感器、音频电路、WI-FI模块等等。用户接口可以包括显示屏(Display)、输入单元比如键盘(Keyboard)等,可选用户接口还可以包括USB接口、读卡器接口等。网络接口可选的可以包括标准的有线接口、无线接口(如蓝牙接口、WI-FI接口)等。
本领域技术人员可以理解,本实施例提供的一种电子设备结构并不构成对该电子设备的限定,可以包括更多或更少的部件,或者组合某些部件,或者不同的部件布置。
存储介质中还可以包括操作装置、网络通信模块。操作装置是管理和保存电子设备硬件和软件资源的程序,支持信息处理程序以及其它软件和/或程 序的运行。网络通信模块用于实现存储介质内部各控件之间的通信,以及与该实体设备中其它硬件和软件之间通信。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到本申请可以借助软件加必要的通用硬件平台的方式来实现,也可以通过硬件实现。
本领域技术人员可以理解附图只是一个优选实施场景的示意图,附图中的单元或流程并不一定是实施本申请所必须的。本领域技术人员可以理解实施场景中的装置中的单元可以按照实施场景描述进行分布于实施场景的装置中,也可以进行相应变化位于不同于本实施场景的一个或多个装置中。上述实施场景的单元可以合并为一个单元,也可以进一步拆分成多个子单元。
上述本申请序号仅仅为了描述,不代表实施场景的优劣。以上公开的仅为本申请的几个具体实施场景,但是,本申请并非局限于此,任何本领域的技术人员能思之的变化都应落入本申请的保护范围。

Claims (20)

  1. 一种区块链交易验证方法,应用于区块链交易系统中的客户端,其中,所述方法包括:
    响应于来自用户的基于区块链的交易验证请求,获取与所述请求对应的交易文件;
    解析所述交易文件,得到所述交易文件中的签名信息;
    调用验证逻辑文件,并利用所述验证逻辑文件验证所述签名信息,得到与所述签名信息对应的验证结果。
  2. 根据权利要求1所述的方法,其中,所述调用验证逻辑文件,并利用验证逻辑文件验证所述签名信息,包括:
    利用JavaScript调用所述验证逻辑文件中的验证接口,利用与所述验证接口对应的验证方法验证所述签名信息的哈希值;
    若所述哈希值为真,则所述验证结果为通过验证,否则所述验证结果为未通过验证。
  3. 根据权利要求2所述的方法,其中,所述调用验证逻辑文件之前,还包括:
    利用go语言生成与所述验证逻辑文件对应的初始文件;
    利用WebAssembly命令,将所述初始文件转换成为所述验证逻辑文件,其中,所述验证逻辑文件包括所述验证接口以及所述验证方法,所述验证方法用于验证所述签名信息。
  4. 根据权利要求3所述的方法,其中,所述验证逻辑文件是wasm格式的二进制文件。
  5. 根据权利要求3所述的方法,其中,所述利用JavaScript调用所述验证逻辑文件中的验证接口之前,还包括:
    搭建沙盒环境,其中,所述沙盒环境用于运行所述验证逻辑文件。
  6. 根据权利要求1所述的方法,其中,所述方法还包括:
    基于Vue框架,搭建所述客户端,其中,所述客户端利用JavaScript编写。
  7. 根据权利要求1所述的方法,其中,所述得到与所述签名信息对应的验证结果之后,还包括:
    解析所述交易文件,得到所述交易文件中的交易信息;
    展示所述交易信息以及所述验证结果。
  8. 一种区块链交易验证装置,应用于区块链交易系统中的客户端,其中,所述装置包括:
    获取模块,用于响应于来自用户的基于区块链的交易验证请求,获取与所述请求对应的交易文件;
    解析模块,用于解析所述交易文件,得到所述交易文件中的签名信息;
    验证模块,用于调用验证逻辑文件,并利用所述验证逻辑文件验证所述签名信息,得到与所述签名信息对应的验证结果。
  9. 一种存储介质,其上存储有程序或指令,其中,所述程序或指令被处理器执行时实现以下步骤:
    响应于来自用户的基于区块链的交易验证请求,获取与所述请求对应的交易文件;
    解析所述交易文件,得到所述交易文件中的签名信息;
    调用验证逻辑文件,并利用所述验证逻辑文件验证所述签名信息,得到与所述签名信息对应的验证结果。
  10. 根据权利要求9所述的存储介质,其中,所述调用验证逻辑文件,并利用验证逻辑文件验证所述签名信息,包括:
    利用JavaScript调用所述验证逻辑文件中的验证接口,利用与所述验证接口对应的验证方法验证所述签名信息的哈希值;
    若所述哈希值为真,则所述验证结果为通过验证,否则所述验证结果为未通过验证。
  11. 根据权利要求10所述的存储介质,其中,所述调用验证逻辑文件之前,还包括:
    利用go语言生成与所述验证逻辑文件对应的初始文件;
    利用WebAssembly命令,将所述初始文件转换成为所述验证逻辑文件,其中,所述验证逻辑文件包括所述验证接口以及所述验证方法,所述验证方法用于验证所述签名信息;
    其中,所述验证逻辑文件是wasm格式的二进制文件。
  12. 根据权利要求11所述的存储介质,其中,所述利用JavaScript调用所述验证逻辑文件中的验证接口之前,还包括:
    搭建沙盒环境,其中,所述沙盒环境用于运行所述验证逻辑文件。
  13. 根据权利要求9所述的存储介质,其中,所述方法还包括:
    基于Vue框架,搭建所述客户端,其中,所述客户端利用JavaScript编写。
  14. 根据权利要求9所述的存储介质,其中,所述得到与所述签名信息对应的验证结果之后,还包括:
    解析所述交易文件,得到所述交易文件中的交易信息;
    展示所述交易信息以及所述验证结果。
  15. 一种电子设备,包括存储介质、处理器及存储在存储介质上并可在处理器上运行的计算机程序,其中,所述处理器执行所述程序时实现以下步骤:
    响应于来自用户的基于区块链的交易验证请求,获取与所述请求对应的交易文件;
    解析所述交易文件,得到所述交易文件中的签名信息;
    调用验证逻辑文件,并利用所述验证逻辑文件验证所述签名信息,得到与所述签名信息对应的验证结果。
  16. 根据权利要求15所述的电子设备,其中,所述调用验证逻辑文件,并利用验证逻辑文件验证所述签名信息,包括:
    利用JavaScript调用所述验证逻辑文件中的验证接口,利用与所述验证接口对应的验证方法验证所述签名信息的哈希值;
    若所述哈希值为真,则所述验证结果为通过验证,否则所述验证结果为未通过验证。
  17. 根据权利要求16所述的存储介质,其中,所述调用验证逻辑文件之前,还包括:
    利用go语言生成与所述验证逻辑文件对应的初始文件;
    利用WebAssembly命令,将所述初始文件转换成为所述验证逻辑文件,其中,所述验证逻辑文件包括所述验证接口以及所述验证方法,所述验证方法用于验证所述签名信息;
    其中,所述验证逻辑文件是wasm格式的二进制文件。
  18. 根据权利要求17所述的存储介质,其中,所述利用JavaScript调用所述验证逻辑文件中的验证接口之前,还包括:
    搭建沙盒环境,其中,所述沙盒环境用于运行所述验证逻辑文件。
  19. 根据权利要求15所述的存储介质,其中,所述方法还包括:
    基于Vue框架,搭建所述客户端,其中,所述客户端利用JavaScript编写。
  20. 根据权利要求15所述的存储介质,其中,所述得到与所述签名信息对应的验证结果之后,还包括:
    解析所述交易文件,得到所述交易文件中的交易信息;
    展示所述交易信息以及所述验证结果。
PCT/CN2023/103603 2022-08-11 2023-06-29 区块链交易验证方法、装置、存储介质及电子设备 WO2024032209A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210961126.X 2022-08-11
CN202210961126.XA CN115456623A (zh) 2022-08-11 2022-08-11 区块链交易验证方法、装置、存储介质及电子设备

Publications (1)

Publication Number Publication Date
WO2024032209A1 true WO2024032209A1 (zh) 2024-02-15

Family

ID=84299809

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/103603 WO2024032209A1 (zh) 2022-08-11 2023-06-29 区块链交易验证方法、装置、存储介质及电子设备

Country Status (2)

Country Link
CN (1) CN115456623A (zh)
WO (1) WO2024032209A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115456623A (zh) * 2022-08-11 2022-12-09 深圳前海环融联易信息科技服务有限公司 区块链交易验证方法、装置、存储介质及电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020249572A1 (en) * 2019-06-12 2020-12-17 NEC Laboratories Europe GmbH Method and contract rewriting framework system for supporting smart contracts in a blockchain network
CN114362961A (zh) * 2022-01-04 2022-04-15 北京众享比特科技有限公司 基于区块链的账户恢复方法、装置、设备及存储介质
US20220188815A1 (en) * 2018-11-16 2022-06-16 Christopher Lyndon Higgins Distributed ledger systems, methods and devices
CN115456623A (zh) * 2022-08-11 2022-12-09 深圳前海环融联易信息科技服务有限公司 区块链交易验证方法、装置、存储介质及电子设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220188815A1 (en) * 2018-11-16 2022-06-16 Christopher Lyndon Higgins Distributed ledger systems, methods and devices
WO2020249572A1 (en) * 2019-06-12 2020-12-17 NEC Laboratories Europe GmbH Method and contract rewriting framework system for supporting smart contracts in a blockchain network
CN114362961A (zh) * 2022-01-04 2022-04-15 北京众享比特科技有限公司 基于区块链的账户恢复方法、装置、设备及存储介质
CN115456623A (zh) * 2022-08-11 2022-12-09 深圳前海环融联易信息科技服务有限公司 区块链交易验证方法、装置、存储介质及电子设备

Also Published As

Publication number Publication date
CN115456623A (zh) 2022-12-09

Similar Documents

Publication Publication Date Title
US10902116B2 (en) Systems and methods to detect and neutralize malware infected electronic communications
Jang et al. Establishing browser security guarantees through formal shim verification
CN111831538B (zh) 调试方法、装置以及存储介质
CN109002297B (zh) 共识机制的部署方法、装置、设备和存储介质
US9367415B1 (en) System for testing markup language applications on a device
WO2024032209A1 (zh) 区块链交易验证方法、装置、存储介质及电子设备
US20190377877A1 (en) Web browser script monitoring
WO2021249356A1 (zh) 表单数据校验方法、系统、服务器和用户终端
WO2014132145A1 (en) Web service black box testing
US9432278B2 (en) Simulation of interactions between network endpoints
CN112671605A (zh) 一种测试方法、装置及电子设备
CN106951785B (zh) 一种java虚拟机及其中的信任链延伸方法
CN111488169A (zh) 应用程序热更新的方法及装置、存储介质及电子设备
US20220382669A1 (en) Automated Validation of a REST Application Programming Interface
Mahmood et al. A framework for automated API fuzzing at enterprise scale
Tang et al. Ssldetecter: detecting SSL security vulnerabilities of android applications based on a novel automatic traversal method
US20220141029A1 (en) Using multi-factor and/or inherence-based authentication to selectively enable performance of an operation prior to or during release of code
WO2024087767A1 (zh) 升级安装方法及其装置、系统、电子设备及存储介质
CN113438273A (zh) 一种物联网设备中应用程序的用户级仿真方法及装置
CN117331754B (zh) 异常问题还原方法、系统、电子设备和计算机存储介质
CN116212398B (zh) 一种基于数据中台的游戏管理方法、装置、设备及介质
US11533282B1 (en) Specifying and testing open communication protocols
CN114745216B (zh) 一种动态接入方法及装置
JP7380251B2 (ja) 仮想マシンにおけるデータ改ざんの監視方法及び装置
Gordon Provable implementations of security protocols

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: 23851436

Country of ref document: EP

Kind code of ref document: A1