A blockchain-based cross-border transaction foreign exchange management information declaration method and system

By splitting cross-border transaction data by country and anchoring it across chains, combined with off-chain hash storage and proactive verification by regulatory nodes, the problems of cross-border data compliance and regulatory arbitrage in cross-border transactions are solved, and efficient and reliable cross-border foreign exchange management information reporting is achieved.

CN121903764BActive Publication Date: 2026-06-26JIANGSU JIASHUDU TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JIANGSU JIASHUDU TECH CO LTD
Filing Date
2026-03-20
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing blockchain-based cross-border transaction information reporting technologies mainly focus on on-chain evidence storage and post-event verification within a single country, lacking cross-border data collaborative verification. This poses data compliance risks and regulatory arbitrage issues, and the generation of reporting information relies on passive subscription to verification results, resulting in insufficient regulatory penetration.

Method used

The transaction contract summary is split into exporting and importing country data fragments according to country attributes, and uploaded to the corresponding regulatory blockchain. On-chain anchoring is achieved through transaction hash roots, cross-chain queries generate joint certificates, sensitive plaintext data is stored in an off-chain database, regulatory nodes actively compare hash values ​​to verify authenticity, and automatically generate declaration documents.

Benefits of technology

It enables trusted collaborative verification between cross-border regulatory chains, ensures consistency in transaction status identification, resolves cross-border data compliance risks and regulatory arbitrage issues, and improves the authenticity and reliability of declared information and regulatory efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121903764B_ABST
    Figure CN121903764B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on cross-border transaction foreign exchange management information declaration method and system of blockchain, it is related to blockchain technology field, the present application is by contract abstract is split into export country data fragment and import country data fragment according to national attribute, and is respectively uploaded to corresponding regulatory chain, realize the physical isolation of data sovereignty, satisfy the national data localization regulation requirement on source, avoid the cross-border data compliance risk under traditional single-chain storage mode;Through the joint calculation of storage address based on transaction hash root and backfill anchoring, and cross-chain state comparison generates joint certificate, builds the trusted collaborative verification mechanism between cross-regional regulatory chain, ensures that the state identification of two countries regulatory agencies to the same transaction is completely consistent, solves the regulatory arbitrage and repeated reporting problem caused by lack of cross-country reconciliation means in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of blockchain technology, and in particular to a blockchain-based method and system for reporting foreign exchange management information for cross-border transactions. Background Technology

[0002] With the acceleration of global economic integration and the continuous expansion of cross-border trade, the accurate reporting and efficient supervision of foreign exchange management information for cross-border transactions have become crucial for maintaining the balance of payments and preventing financial risks. The traditional foreign exchange reporting model for cross-border transactions mainly relies on enterprises submitting paper or electronic documents to banks, which then review and submit the documents to the foreign exchange management department. This process suffers from inefficiency, data silos, high verification costs, and regulatory lag. In recent years, blockchain technology, due to its decentralized, tamper-proof, and traceable characteristics, has been gradually applied to the cross-border financial field. By storing key information such as transaction contracts, payment instructions, and tax calculations on the blockchain, a trusted data-sharing environment with multi-party participation is constructed, providing a new technological path to improve the transparency and efficiency of cross-border transaction reporting.

[0003] CN115587889A discloses a blockchain-based three-way verification method and apparatus for cross-border transactions. This method generates verification information, including reconciliation and declaration information, by acquiring historical transaction information from cross-border systems. This verification information is recorded on the blockchain for verification by banks and third-party payment institutions. The method also subscribes to verification results and sends declaration information to regulatory agencies upon successful verification. When verification results are inconsistent, the method records detailed transaction information (including product name, transaction amount, buyer information, and seller information) on the blockchain for secondary verification and locates errors and re-declares based on feedback information. However, this scheme has the following shortcomings: First, the verification process mainly relies on the post-event analysis of historical transaction information, lacking real-time cross-border data collaborative verification at the time of the transaction, making it difficult to prevent the forgery or tampering of transaction documents; Second, although putting verification information and transaction details on the blockchain utilizes the trusted storage of blockchain, it does not consider the requirements for data sovereignty isolation between different countries in cross-border transactions. A regulatory node in one country can directly access complete transaction details data, posing a risk of cross-border data compliance; Third, the generation and transmission of declaration information still rely on the passive subscription of verification results. Regulatory nodes do not participate in the active verification process of transaction verification, and the regulatory penetration needs to be improved.

[0004] CN121481756A discloses a blockchain-based method and intelligent declaration system for compliant tax refunds in cross-border e-commerce. By constructing a benchmark library containing commodity physical attribute parameters and fair density ranges for customs codes, it performs multi-dimensional cross-validation (including physical space logic verification, attribute consistency verification, and joint logic verification of quality conservation and time sequence) on order transaction data, logistics measurement data, and fund time-series data. The comprehensive verification results determine the transaction risk level, and the transaction data that passes the risk assessment is generated into a digital fingerprint and written into a distributed ledger network to generate an export tax refund declaration document with an on-chain notarized index. While this technical solution introduces multi-dimensional physical attribute verification to enhance transaction authenticity, its focus is on judging the logical reasonableness of commodity physical parameters. It is suitable for identifying fraudulent transactions in cross-border e-commerce tax refund scenarios, but it fails to provide effective solutions for issues of concern in cross-border foreign exchange management, such as the authenticity of transaction entity identities, compliance of fund flows, and national regulatory coordination. Furthermore, this technical solution still adopts a single-country on-chain notarization model and does not involve data interaction and joint verification between cross-border regulatory chains, making it difficult to meet the actual needs of multiple regulatory agencies in cross-border scenarios for collaborative supervision of the same transaction. Summary of the Invention

[0005] The purpose of this section is to outline some aspects of the embodiments of the present invention and to briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section, as well as in the abstract and title of the present application, to avoid obscuring the purpose of this section, the abstract and title of the invention. Such simplifications or omissions shall not be used to limit the scope of the present invention.

[0006] In view of the above background technology, existing blockchain-based cross-border transaction information reporting technologies mainly focus on the problem of on-chain evidence storage and post-event verification within a single country, this invention is proposed.

[0007] To address the aforementioned technical problems, this invention provides the following technical solution: a blockchain-based method for reporting foreign exchange management information in cross-border transactions, characterized by the following steps: S1: The transaction initiator splits the contract summary into export country data fragments and import country data fragments, and uploads them to their respective regulatory blockchains. The two fragments are anchored on-chain through a common transaction hash root; S2: The export country smart contract triggers a cross-chain query based on the export country data fragment, requesting verification of the import country data fragment's status from the import country regulatory blockchain. After the two data fragments are compared and found to be consistent, a cross-chain joint certificate is generated; S3: After the cross-chain joint certificate is generated, the sensitive plaintext data involved in the transaction is stored in an off-chain database, while only the hash value of the sensitive plaintext data is stored on-chain. The hash value is associated with the transaction hash root and recorded in a shared ledger; S4: The regulatory node completes the authenticity verification by comparing the sensitive plaintext data provided by the off-chain database with the hash value stored on-chain. After verification, a foreign exchange management information reporting document is automatically generated.

[0008] As a preferred embodiment of the present invention, step S1 includes: the transaction initiator extracting the exporter's name, exporter's digital identity, exporting country's regulatory address, and export customs declaration number from the contract summary, and combining them into an exporting country attribute field group. Extract the importer's name, importer's digital identity, importer's country of origin address, and import customs declaration number, and combine them into an importer's country attribute field group. Extract transaction number The transaction amount and currency are included, and a transaction hash root field is reserved, which are combined into a cross-border shared field group. ;Will and Encapsulated as export country data fragments ,Will and Encapsulated as importer data fragments The two shards are connected via transaction number. Maintain logical connections.

[0009] As a preferred embodiment of the present invention, step S1 further includes: the transaction initiator sharding the exporting country data. Uploaded to the exporting country's regulatory blockchain; the exporting country's regulatory blockchain shards the exporting country's data. Assigning storage addresses to exporting countries And stamped with the exporting country's timestamp. ,Will and The receipt is returned to the transaction initiator; the transaction initiator will then fragment the importing country data. Uploaded to the importing country's regulatory blockchain; the importing country's regulatory blockchain shards the importing country's data. Allocate storage addresses in importing countries And stamped with the importing country's timestamp ,Will and The receipt is returned to the transaction initiator; the transaction initiator then uses the obtained storage address in the exporting country. and the storage address of the importing country Calculate the transaction hash root The transaction initiator constructs two update transactions and sends them to the exporting country's regulatory blockchain and the importing country's regulatory blockchain, respectively, invoking the smart contracts on the corresponding chains based on the transaction numbers. Locate the corresponding data shard and... Reserved bits in the transaction hash root of the corresponding data shard; after both chains have completed the update, the two data shards are updated using a common transaction hash root. Achieve on-chain anchoring; simultaneously, the exporting country's regulatory blockchain will assign transaction numbers. With transaction hash root The mapping relationship is recorded in the shared ledger.

[0010] As a preferred embodiment of the present invention, step S2 includes: a smart contract on the exporting country's regulatory blockchain sharding data from the exporting country. Extract transaction number and transaction hash root ,according to Constructing cross-chain query requests Smart contracts will Send to the cross-chain communication node, the cross-chain communication node will The request is routed to the importing country's regulatory blockchain; the importing country's regulatory blockchain receives cross-chain query requests. ,according to Transaction number in Locate the corresponding importing country data fragment on the importing country's regulatory blockchain. ,from Extracting the fragmented hash root of importing country data and importing country timestamp Importing countries' regulatory blockchain will and In Compare; if and If the two match, then the importing country's regulatory blockchain generates a cross-chain joint certificate. ;in, The digital signature is provided by the importing country's regulatory blockchain; if the comparison is inconsistent, the importing country's regulatory blockchain determines that the cross-chain verification has failed; the importing country's regulatory blockchain will... The data is returned to the exporting country's regulatory blockchain via a cross-chain communication node, and stored on the exporting country's regulatory blockchain. .

[0011] As a preferred embodiment of the present invention, step S3 includes: the transaction initiator treating the full text of the contract, scanned copies of the invoice, and logistics vouchers as sensitive plaintext data. Transmitted to an off-chain database; the off-chain database contains sensitive plaintext data. Allocation of off-chain storage address And use a hash algorithm Calculate the hash value of sensitive data Off-chain databases will and Return; the transaction initiator will Uploaded to the exporting country's regulatory blockchain; smart contracts on the exporting country's regulatory blockchain from cross-chain joint credentials. Extract transaction number ,according to Locate the corresponding transaction hash root in the shared ledger. Smart contracts will , and Related records are recorded in the shared ledger, forming related records. .

[0012] As a preferred embodiment of the present invention, step S4 includes: the supervisory node reading associated records from the shared ledger. ,according to Off-chain storage address Send a data retrieval request to the off-chain database, the request containing the transaction number. Off-chain databases are based on Locating the corresponding sensitive plaintext data and will Return to the monitoring node; the monitoring node processes the received sensitive plaintext data. The same hash algorithm used in S3 is used to calculate the verification hash value. ;Will Hash value of sensitive data stored in the shared ledger Compare the results; if the comparisons are consistent, the sensitive plaintext data is confirmed. The authenticity of the data is verified; if the comparison results are inconsistent, the verification fails.

[0013] In a preferred embodiment of the present invention, step S4 further includes: if the comparison results are consistent, the monitoring node retrieves sensitive plaintext data. Extract the transaction amount, names of both parties, and currency; based on the transaction number... Query export country data shards from the export country's regulatory blockchain. Extract the exporting country's regulatory address and export customs declaration number; query the importing country's data shards from the importing country's regulatory blockchain. The system extracts the importing country's regulatory address and import customs declaration number; the regulatory node then fills the extracted data items into the corresponding fields of the foreign exchange management declaration document template, generating a foreign exchange management information declaration document with a digital signature. and calculate hash value ;Will Upload to the shared ledger transaction hash root Related records.

[0014] On the other hand, the present invention also provides a blockchain-based cross-border transaction foreign exchange management information reporting system, comprising: a sharding and on-chain anchoring module, wherein the transaction initiator splits the contract summary to generate export country data shards and import country data shards, and uploads them to the corresponding regulatory blockchains respectively, and the two shards are anchored on the chain through a common transaction hash root; a cross-chain certificate generation module, wherein the export country smart contract triggers a cross-chain query based on the export country data shard, requests the import country regulatory blockchain to verify the status of the import country data shard, and generates a cross-chain joint certificate after the two data shards are compared and found to be consistent; an off-chain hash storage module, wherein after the cross-chain joint certificate is generated, the sensitive plaintext data involved in the transaction is stored in an off-chain database, and only the hash value of the sensitive plaintext data is stored on the chain, and the hash value is associated with the transaction hash root and recorded in a shared ledger; and a verification and declaration generation module, wherein the regulatory node completes the authenticity verification by comparing the sensitive plaintext data provided by the off-chain database with the hash value stored on the chain, and automatically generates a foreign exchange management information declaration document after the verification is correct.

[0015] The beneficial effects of this invention are as follows: By splitting the contract summary into exporting country data fragments and importing country data fragments according to country attributes and uploading them to the corresponding regulatory chains, this invention achieves physical isolation of data sovereignty, meets the data localization regulations of various countries at the source, and avoids the cross-border data compliance risks of the traditional single-chain evidence storage model. By jointly calculating the transaction hash root based on the storage address and backfilling the anchor, and generating joint certificates through cross-chain state comparison, a trusted collaborative verification mechanism between cross-border regulatory chains is constructed, ensuring that the regulatory agencies of the two countries have completely consistent status recognition of the same transaction, and solving the problems of regulatory arbitrage and duplicate reporting caused by the lack of cross-border reconciliation means in the prior art.

[0016] Furthermore, by storing sensitive plaintext data in an off-chain database and only storing hash values ​​on-chain, and adopting a collaborative mode in which regulatory nodes actively retrieve and compare the data, the verifiability of the data is achieved while protecting commercial privacy. After verification, the declaration document is automatically generated and the document hash is linked on the chain, forming a closed loop of evidence from the original transaction to the declaration result, which significantly improves regulatory efficiency and the authenticity and reliability of the declaration information. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:

[0018] Figure 1 This is a flowchart illustrating a blockchain-based method for reporting foreign exchange management information in cross-border transactions, as shown in this invention.

[0019] Figure 2 This is a flowchart illustrating the cross-border transaction data sharding and cross-chain anchoring process in an embodiment of the present invention.

[0020] Figure 3 This is a flowchart illustrating the off-chain storage and regulatory verification process for sensitive data in an embodiment of the present invention.

[0021] Figure 4 This is a structural diagram of a blockchain-based cross-border transaction foreign exchange management information reporting system, as shown in this invention. Detailed Implementation

[0022] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0023] Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without inventive effort should fall within the scope of protection of this invention.

[0024] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0025] According to an embodiment of the present invention, in combination Figure 1 The flowchart shown illustrates a blockchain-based method for reporting foreign exchange management information in cross-border transactions, including:

[0026] S1: The transaction initiator splits the contract summary into export country data shards and import country data shards, and uploads them to the corresponding regulatory blockchains. The two shards are anchored on the chain through a common transaction hash root.

[0027] It should be noted that the contract summary is a digital summary of the transaction, containing basic information about both parties and key fields required for regulation. The splitting by country of origin is to achieve data sovereignty-based isolated storage: exporting country attribute fields are only relevant to the exporting country's regulations and should not be exposed on the importing country's blockchain, and vice versa. The conventional approach is to package and upload all information, but this method may violate data localization regulations in cross-border scenarios. This invention, through explicit field division, ensures that each regulatory blockchain stores only data within its sovereign jurisdiction. Figure 2 As shown, the specific operation is as follows:

[0028] S1.1: The transaction initiator extracts the exporter's name, exporter's digital identity, exporting country's regulatory address, and export customs declaration number from the contract summary, and combines them into an exporting country attribute field group. Extract the importer's name, importer's digital identity, importer's country of origin address, and import customs declaration number, and combine them into an importer's country attribute field group. .

[0029] In practice, the client of the transaction initiator has a built-in field extraction engine that loads a predefined cross-border trade contract parsing template. After obtaining the contract summary (structured or semi-structured document), the engine traverses the template rules and uses regular expression matching or DOM tree node positioning to extract the following fields: exporter name, exporter digital identity, exporting country regulatory address, export customs declaration number, etc.

[0030] S1.2: Extract transaction number The transaction amount and currency are specified, and a transaction hash root field is reserved (initially empty). These are combined into a cross-border shared field group. .

[0031] The specific extraction process includes: the client calling a globally unique identifier generation service to generate a 64-bit or 128-bit transaction number using the Snowflake algorithm or UUID v4. This ensures conflict-free operation in a distributed environment. The transaction amount field (e.g., total amount: USD 100,000) is parsed from the contract summary, and the numerical portion and currency code (e.g., USD, EUR) are extracted.

[0032] The client will Serialize to a normalized JSON string or Protocol Buffers binary format to ensure consistent deserialization results on both chains.

[0033] It is important to note that reserving the transaction hash root field ensures that data shards remain updatable after their initial on-chain storage, overcoming the characteristic that blockchain data is immutable but can be indirectly updated through contract state.

[0034] S1.3: Will and Encapsulated as export country data fragments ,Will and Encapsulated as importer data fragments The two shards are connected via transaction number. Maintain logical connections.

[0035] in, The content is identical in both shards. During encapsulation, the client calculates... and The Merkle root hash is used as the fragment fingerprint, but not as the basis for subsequent anchoring; it is only used for fragment integrity self-verification.

[0036] Optionally, the encapsulated data fragments can be CBOR encoded to reduce storage space and a version number field can be added to support future format upgrades.

[0037] After the above encapsulation is completed, any fragment parsing program can extract it. Transaction number in Quickly locate related shards and provide a unified search entry point for cross-chain queries.

[0038] S1.4: The transaction initiator will shard the exporting country data. Uploaded to the exporting country's regulatory blockchain; the exporting country's regulatory blockchain shards the exporting country's data. Assigning storage addresses to exporting countries And stamped with the exporting country's timestamp. ,Will and The receipt is returned to the transaction initiator; the transaction initiator will then fragment the importing country data. Uploaded to the importing country's regulatory blockchain; the importing country's regulatory blockchain shards the importing country's data. Allocate storage addresses in importing countries And stamped with the importing country's timestamp ,Will and The receipt is returned to the party who initiated the transaction.

[0039] In this embodiment of the invention, the client initiates a transaction through the RPC interface of the exporting country's regulatory blockchain, calling the Slice function of the smart contract with parameters as follows: The CBOR encoding. The smart contract then performs the following operations:

[0040] (1) Verify the digital signature and account permissions of the transaction initiator;

[0041] (2) Data is written into the contract's state variables, in order to For key;

[0042] (3) At the same time, The storage location is recorded in a content-addressable manner, including computation. The SHA3-256 hash value is used as the IPFS address, or the data is stored in an off-chain distributed file system and the storage path is returned; (4) Generate storage address ;

[0043] (5) Obtain the current block time as the exporting country's timestamp ;

[0044] (6) Triggering the SliceStored event and will and Returned as a log field in the transaction receipt. This is the account address of the user currently calling the smart contract function (i.e., the initiator of the transaction).

[0045] The client listens for events or polls for transaction receipts to obtain... and Subsequently, the client repeats the above process on the importing country's regulatory blockchain, calling the Slice function to obtain... and .

[0046] It's important to note that the upload operations on the two chains are independent and can be executed asynchronously in parallel. However, the client must ensure that both uploads succeed before proceeding to the next step. As can be seen, the independent storage of the two chains ensures that data from one country is not directly accessed by another, aligning with the design goal of data sovereignty isolation.

[0047] S1.5: The transaction initiator stores the data in the exporting country based on the obtained storage address. and the storage address of the importing country Calculate the transaction hash root The transaction initiator constructs two update transactions and sends them to the exporting country's regulatory blockchain and the importing country's regulatory blockchain, respectively, invoking the smart contracts on the corresponding chains based on the transaction numbers. Locate the corresponding data shard and... Write the reserved bits of the transaction hash root for the corresponding data shard.

[0048] Among them, transaction hash root The calculation is as follows: and Concatenate the data lexicographically (or in a fixed order, such as exporting before importing), then use the SHA3-256 algorithm to calculate the hash value, resulting in:

[0049] The hash value is 256 bits long and is represented as a hexadecimal string.

[0050] Furthermore, the client constructs update transactions for the exporting country's blockchain, which are executed within the contract:

[0051] (1) According to Find the corresponding shard record;

[0052] (2) Check whether the reserved transaction hash root field of the corresponding shard is currently null. If it is not null, refuse to update (to prevent double overwriting).

[0053] (3) Verify whether the caller is the original uploader (through stored data). (Comparison)

[0054] (4) Update the reserved transaction hash root field in the sharded record to and transaction number and transaction hash root The transaction log is recorded on the blockchain and can be listened to by cross-chain communication nodes to trigger subsequent cross-chain query processes. Simultaneously, the client constructs an update transaction for the importing country's blockchain, calling the corresponding function in the importing country's contract, which will also... Write the importing country's segment.

[0055] It is important to note that, to ensure that dual-chain updates take effect as simultaneously as possible, the client can use a variation of two-phase commit. For example, the client can first submit update transactions to both chains separately, and then wait for both chains to receive a sufficient number of confirmations (e.g., 12 blocks). If the update on either chain fails (e.g., transaction rollback, timeout), the client should trigger an alert and either manually intervene or automatically retry.

[0056] Finally, after both chains have completed their updates, the two data shards are connected via a common transaction hash root. Achieve on-chain anchoring; simultaneously, the exporting country's regulatory blockchain will assign transaction numbers. With transaction hash root The mapping relationship is recorded in the shared ledger.

[0057] It's important to note that conventional data upload operations typically involve only single-chain storage, with the storage address automatically returned by the blockchain node. However, this approach fails to achieve cross-chain data binding. This invention addresses a dual-chain architecture by designing a hash-anchoring method based on storage addresses. By hashing the storage addresses from both countries together, cross-chain data fingerprint binding is achieved. This means that any unilateral modification of the storage address (e.g., one party attempting to replace shard content) will result in a recalculation of the data fingerprint. Stored on another chain Inconsistencies are detected in subsequent verification steps; moreover, the hash root write operation utilizes the programmable state of the smart contract to achieve an anchoring effect on the immutable blockchain. The entire anchoring process is completely decentralized and does not rely on any third-party cross-chain notary institutions, reducing trust costs and single point of failure risks.

[0058] S2: The exporting country's smart contract triggers a cross-chain query based on the exporting country's data shards, requests verification of the importing country's data shard status from the importing country's regulatory blockchain, and generates a cross-chain joint certificate after the two data shards are compared and found to be consistent.

[0059] S2.1: Smart contracts on the exporting country's regulatory blockchain shard from exporting country data. Extract transaction number and transaction hash root ,according to Constructing cross-chain query requests .

[0060] In practice, smart contracts on the exporting country's regulatory blockchain execute cross-chain query logic after receiving external triggering conditions (such as verification instructions initiated by regulatory nodes or callbacks automatically triggered after hash root updates).

[0061] The contract first locates the exporting country's data shards from its own persistent storage. Specifically, the contract maintains a mapping table internally, where the key is the transaction number. The value is an ExportSlice structure, which contains a group of fields. , and the transaction hash root written subsequently The contract is passed through... As the key, retrieve the corresponding ExportSlice record from the mapping table and extract two key fields: transaction ID slice.common.TxID, which is a 32-byte byte array; and transaction hash root slice.common.HashRoot, which is a 32-byte byte array.

[0062] After the extraction is complete, the contract constructs a cross-chain query request. .ask It adopts a standardized cross-chain message format, including: transaction number, transaction hash root, request initiation time (current block timestamp), and requester identifier.

[0063] After the construction is completed, Prepare to send in ABI encoding or Protocol Buffers serialization format.

[0064] S2.2: Smart contracts will Send to the cross-chain communication node, the cross-chain communication node will Routing to the importing country's regulatory blockchain.

[0065] It should be noted that smart contracts on the exporting country's regulatory blockchain do not inherently possess the ability to directly send messages to external chains. Therefore, this invention uses cross-chain communication nodes as message relays. The smart contract submits the serialized query request Q to the cross-chain communication node by calling a pre-compiled cross-chain export function or triggering a cross-chain event.

[0066] The specific implementation is as follows: the contract triggers a QueryEvent, which contains... Complete data and the target chain identifier (i.e., the chain ID of the blockchain under the supervision of the importing country).

[0067] The cross-chain communication node acts as an external service, monitoring such events on the exporting country's regulatory blockchain in real time. Once a new event is detected, the node performs the following actions:

[0068] (1) Parse the event content and extract and target chain ID;

[0069] (2) Check whether the event sender is an authorized exporting country smart contract address to verify. The legitimacy of its source;

[0070] (3) Encapsulate it into a transaction format acceptable to the importing country's regulatory blockchain, such as constructing a transaction that invokes a specific contract on the importing country's blockchain;

[0071] (4) Use cross-chain communication nodes to sign transactions on the importing country's regulatory blockchain and broadcast the transactions to the node network of the importing country's regulatory blockchain.

[0072] The cross-chain communication nodes can be implemented using various architectures, such as centralized relay clusters or decentralized cross-chain protocol networks. This embodiment uses a highly available relay cluster, where nodes use a consensus mechanism to ensure that messages are not lost or out of order, and have retry and failover capabilities.

[0073] S2.3: Importing country's regulatory blockchain receives cross-chain query requests. ,according to Transaction number in Locate the corresponding importing country data fragment on the importing country's regulatory blockchain. ,from Extracting the fragmented hash root of importing country data (i.e., the transaction hash root stored in this shard) and the importing country timestamp Importing countries' regulatory blockchain will and In Compare (byte-by-byte): If the comparison is inconsistent, the importing country's regulatory blockchain determines that the cross-chain verification has failed;

[0074] like and The two comparisons show consistency, proving that the transaction hash roots stored on both sides of the exporting and importing countries are the same. This further proves that the two shards refer to the same transaction and have not been tampered with. Therefore, the importing country's regulatory blockchain generates a cross-chain joint certificate. ;in, The digital signature for the importing country's regulatory blockchain is generated as follows: the contract uses the private key of the importing country's regulatory blockchain (usually the node consensus private key or a dedicated cross-chain signing key) to... The hash value is used for signing, and the signing algorithm adopts Ed25519 or SECP256K1 to ensure the unforgeability of the signature.

[0075] After signing, the contract will Encapsulated as a cross-chain response message, it can directly call the return interface of the cross-chain communication node. The data is returned to the exporting country's regulatory blockchain via a cross-chain communication node, and stored on the exporting country's regulatory blockchain. If the comparison is inconsistent, the contract verification fails, a failure certificate is generated, and the result is returned to the exporting country's blockchain.

[0076] As can be seen, by directly comparing the hash roots, this invention achieves cryptographic verification of data consistency between the two chains; that is, any tampering with a single-sided shard will cause the comparison to fail. The entire verification process is executed automatically by the smart contract without human intervention, improving the efficiency and accuracy of supervision.

[0077] S3: After the cross-chain joint certificate is generated, the sensitive plaintext data involved in the transaction is stored in the off-chain database, and only the hash value of the sensitive plaintext data is stored on the chain. The hash value is associated with the transaction hash root and recorded in the shared ledger.

[0078] like Figure 3 As shown, firstly, the party initiating the transaction treats the full contract, scanned copies of invoices, and logistics documents as sensitive plaintext data. Transmitted to an off-chain database; the off-chain database contains sensitive plaintext data. Allocation of off-chain storage address And use a hash algorithm Calculate the hash value of sensitive data Off-chain databases will and return.

[0079] In this embodiment of the invention, the transaction initiator client obtains the cross-chain joint certificate. Then, the sensitive data upload process is triggered. First, the client reads three types of files from the local file system: the full text of the contract (PDF format), a scanned copy of the invoice (JPEG or PDF), and logistics documents (such as a bill of lading PDF).

[0080] For ease of unified processing, the client packages these files into a ZIP archive or constructs a Merkle tree. However, for the sake of simplicity in this embodiment, a set of sensitive plaintext data is used. Treat it as a data set The system calculates the overall hash value. In practice, one of two methods can be used: single-file hashing (the client calculates the hash value of each file separately and then stores the list of hash values ​​as metadata) and overall hashing (that is, all files are concatenated in a pre-defined order and then the hash is calculated to reduce the amount of on-chain storage). However, in this embodiment of the invention, overall hashing is used.

[0081] The client sends a storage request to the off-chain database via a secure API interface (such as HTTPS or gRPC), the request containing the binary data of the dataset. Upon receiving the data, the off-chain database performs the following operations:

[0082] First, the database will It is stored in a distributed storage system. If IPFS is used, then... It is segmented and stored in the IPFS node network, and the Content Identifier (CID) is returned as the storage address. If an external database is used, then the database is... Generate a unique UUID and store the file in object storage (such as MinIO).

[0083] Secondly, the database uses a collision-resistant hash algorithm (such as SHA3-256) to... Calculate the summary to obtain:

[0084] To ensure consistency in hash calculations, the database and the client agree on the same hash algorithm, and this can be verified before the result is returned. The integrity of.

[0085] The database will The response is encapsulated as a JSON response and digitally signed (using a database private key) before being returned to the client. The client verifies the signature to ensure the returned result has not been tampered with.

[0086] It is important to note that only authorized transaction initiators and regulatory nodes are allowed to read the data. When regulatory nodes retrieve data via address in S4, the database must verify the caller's identity.

[0087] As can be seen, hash calculation provides a unique digital fingerprint for the file content. Any modification to the file will cause a hash change, which can then be detected by on-chain evidence storage.

[0088] Furthermore, the transaction initiator will Uploaded to the exporting country's regulatory blockchain, the smart contract on the exporting country's regulatory blockchain uses cross-chain joint credentials. Extract transaction number ,according to Locate the corresponding transaction hash root in the shared ledger. Smart contracts will , and Related records are recorded in the shared ledger, forming related records. .

[0089] The smart contract executes the following logic:

[0090] First, the contract checks whether msg.sender is the address of the transaction initiator and whether it matches the address of the uploaded export country fragment (optional verification to prevent impersonation).

[0091] Secondly, the contract is based on internal storage. Retrieve the corresponding cross-chain federated certificate If the voucher does not exist or has not yet been verified, the transaction will be rolled back.

[0092] Ultimately, from the voucher Extract (or directly from the shared ledger) Query ).

[0093] If multiple sensitive files need to be associated subsequently (e.g., uploaded in batches), the contract can be designed to allow appending records, or an array can be used to store multiple hash values. However, this embodiment only considers a single upload, but extensions can support multiple appends.

[0094] S4: The regulatory node verifies the authenticity of the data by comparing the sensitive plaintext data provided by the off-chain database with the hash value of the evidence stored on the chain. Once the verification is successful, the foreign exchange management information declaration document is automatically generated.

[0095] Regulatory nodes (typically servers or blockchain nodes run by regulatory agencies in the exporting country) read relevant records from the shared ledger upon receiving a regulatory task (such as a scheduled scan or event-driven event). ,according to Off-chain storage address Send a data retrieval request to the off-chain database, the request containing the transaction number. Specifically, after retrieving R, the regulatory node extracts the Uniform Resource Identifier (URI) of the off-chain database. Based on the protocol type of the URI, the regulatory node constructs a corresponding data retrieval request. For example, if IPFS is used, the request is sent through an IPFS client or gateway, including the file CID; if a centralized off-chain database is used, an HTTPS GET request is sent, with an authentication token (such as a JWT) appended to the request header to prove its regulatory authority. The request also includes the transaction number. This is provided to the off-chain database for secondary verification. Upon receiving the request, the off-chain database performs the following operations: (1) Verify whether the caller is an authorized regulatory node, which can be verified through a whitelist or digital signature; (2) Based on... Alternatively, a unique identifier in the storage address can be used to locate the corresponding sensitive plaintext data in the internal index. (3) The raw binary data is encapsulated into a response message, and the response content is signed using the database's private key to ensure data integrity during transmission. The response message format can be Protocol Buffers or JSON, containing a data field (Base64 encoded of the file's binary data) and a hash signature of the data. Upon receiving the response, the monitoring node first verifies the validity of the signature to confirm that the data has not been tampered with and originates from a trusted database, and then parses the data... Binary data.

[0096] Furthermore, at the regulatory node, sensitive plaintext data is obtained. Immediately afterwards, the hash comparison process is initiated: During this process, the monitoring node compares the received sensitive plaintext data. The same hash algorithm used in S3 is used to calculate the verification hash value. and will Hash value of sensitive data stored in the shared ledger Perform a byte-by-byte comparison: if the comparison results match, the sensitive plaintext data is confirmed. The authenticity, that is The data is not tampered with or replaced during storage; if the comparison results are inconsistent, the verification fails, the regulatory node records the verification failure event, and triggers an alarm process, such as sending a notification to regulatory personnel or freezing subsequent operations of the transaction. After a successful comparison, the regulatory node can record the verification result (including timestamp and verifier identity) in its local log or upload it to the regulatory chain as audit evidence.

[0097] Furthermore, if the comparison results are consistent, the regulatory node will focus on sensitive plaintext data. The system extracts the transaction amount, names of both parties, and currency. In practice, the regulatory node can incorporate an OCR engine and a structured data extractor.

[0098] According to the transaction number Call the smart contract interface on the exporting country's blockchain to obtain data shards from the exporting country. Extract the exporting country's regulatory address and export customs declaration number. Call the smart contract interface on the importing country's blockchain (via cross-chain communication node or direct RPC) to obtain the importing country's data shards. The query retrieves the importing country's regulatory address and import customs declaration number. The regulatory node must have access to both blockchains, typically authenticated by holding an account on the corresponding blockchain or using the regulatory node's public key certificate. The query request can include the regulatory node's digital signature for on-chain contract verification of permissions.

[0099] Subsequently, the regulatory node will extract sensitive plaintext data. The extracted transaction amount, names of the transacting parties, and transaction currency are compared with data shards from the exporting country. of The transaction amount and currency extracted from Extracted exporter name, data fragments from importing country The names of the importers extracted from the database are compared; at the same time, the names of the importers extracted from the database are compared. Extract the export customs declaration number and import customs declaration number (if...) (included) and from The export customs declaration number extracted and from The extracted import customs declaration number is compared. If all corresponding fields match, the subsequent steps continue; if any field does not match, the data consistency verification is deemed to have failed, the verification failure event is recorded, and an alarm process is triggered (such as sending a notification to regulatory personnel, freezing subsequent operations of the transaction, etc.).

[0100] The regulatory node will populate the extracted data items into the corresponding fields of the foreign exchange management declaration document template, generating a foreign exchange management information declaration document with a digital signature. and calculate hash value and will Upload to the shared ledger transaction hash root Related records.

[0101] As can be seen, generating declaration documents with digital signatures ensures the authenticity and non-repudiation of the documents. Any subsequent tampering can be detected through signature verification. Furthermore, this invention hashes the declaration documents on the blockchain and associates them with the original transaction hash root, forming a complete chain of evidence, facilitating future auditing and traceability. The entire process is automated, requiring no human intervention, significantly improving regulatory efficiency and reducing the risk of human error.

[0102] like Figure 4 As shown, the present invention also includes a blockchain-based cross-border transaction foreign exchange management information reporting system, comprising:

[0103] In the sharding and on-chain anchoring module, the transaction initiator splits the contract summary into export country data shards and import country data shards, and uploads them to the corresponding regulatory blockchains respectively. The two shards are anchored on the chain through a common transaction hash root.

[0104] The cross-chain certificate generation module involves the exporting country's smart contract triggering a cross-chain query based on the exporting country's data shards. It requests verification of the importing country's data shard status from the importing country's regulatory blockchain. Once the two data shards are matched, a cross-chain joint certificate is generated.

[0105] The off-chain hash storage module, after generating the cross-chain joint certificate, stores the sensitive plaintext data involved in the transaction in the off-chain database, and only stores the hash value of the sensitive plaintext data on the chain. The hash value is associated with the transaction hash root and recorded in the shared ledger.

[0106] The verification and declaration generation module allows regulatory nodes to verify authenticity by comparing sensitive plaintext data provided by the off-chain database with the hash value of evidence stored on the chain. Once the verification is successful, the module automatically generates a foreign exchange management information declaration document.

[0107] The system also includes one or more processors and memory.

[0108] The memory is used to store operable instructions that, when executed by the one or more processors, cause the one or more processors to perform operations, including the process of a blockchain-based cross-border transaction foreign exchange management information reporting method according to the foregoing embodiments, particularly... Figure 1 The flowchart of the method is shown.

[0109] Other aspects disclosed in the embodiments of the present invention also propose a computer-readable medium for storing software including instructions executable by one or more computers, which, upon execution, cause the one or more computers to perform operations including the process of a blockchain-based cross-border transaction foreign exchange management information reporting method of the foregoing embodiments, particularly... Figure 1 The flowchart of the method is shown.

[0110] It should be recognized that embodiments of the present invention may be implemented or carried out by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable storage medium.

[0111] The method can be implemented using standard programming techniques, including a non-transitory computer-readable storage medium configured with a computer program in the computer program, wherein the storage medium is configured such that the computer operates in a specific and predefined manner.

[0112] Each program can be implemented in a high-level procedural or object-oriented programming language to communicate with the computer system; however, if required, the program can be implemented in assembly or machine language.

[0113] In any case, the language can be either compiled or interpreted.

[0114] Furthermore, for this purpose, the program can run on a programmed application-specific integrated circuit.

[0115] The processes described herein (or variations and / or combinations thereof) can be executed under the control of one or more computer systems configured with executable instructions, and can be implemented by hardware or a combination thereof as code (e.g., executable instructions, one or more computer programs, or one or more applications) that commonly executes on one or more processors. The computer program includes a plurality of instructions executable by one or more processors.

[0116] Furthermore, the method can be implemented in any suitable computing platform, including but not limited to personal computers, minicomputers, mainframes, workstations, networked or distributed computing environments, standalone or integrated computer platforms, or in communication with charged particle tools or other imaging devices.

[0117] Various aspects of the present invention can be implemented in machine-readable code stored on a non-transitory storage medium or device, whether portable or integrated into a computing platform, such as a hard disk, optical read and / or write storage medium, RAM, ROM, etc., such that it can be read by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the processes described herein.

[0118] Furthermore, machine-readable code, or parts thereof, can be transmitted via wired or wireless networks.

[0119] When such media includes instructions or programs that combine with a microprocessor or other data processor to implement the steps described above, the invention described herein includes these and other different types of non-transitory computer-readable storage media.

[0120] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A blockchain-based method for reporting foreign exchange management information in cross-border transactions, characterized in that: include: S1: The transaction initiator splits the contract summary into export country data shards and import country data shards, and uploads them to the corresponding regulatory blockchains respectively. The two shards are anchored on the chain through a common transaction hash root. S2: The exporting country's smart contract triggers a cross-chain query based on the exporting country's data shards, requests the importing country's regulatory blockchain to verify the status of the importing country's data shards, and generates a cross-chain joint certificate after the two data shards are compared and found to be consistent. S3: After the cross-chain joint certificate is generated, the sensitive plaintext data involved in the transaction is stored in the off-chain database, and only the hash value of the sensitive plaintext data is stored on the chain. The hash value is associated with the transaction hash root and recorded in the shared ledger. S4: The regulatory node verifies the authenticity of the data by comparing the sensitive plaintext data provided by the off-chain database with the hash value of the evidence stored on the chain. Once the verification is successful, the foreign exchange management information declaration document is automatically generated. S1 further includes: the transaction initiator sharding the exporting country data. Uploaded to the exporting country's regulatory blockchain; the exporting country's regulatory blockchain shards the exporting country's data. Assigning storage addresses to exporting countries And stamped with the exporting country's timestamp. ,Will and The receipt is returned to the transaction initiator; the transaction initiator will then fragment the importing country data. Uploaded to the importing country's regulatory blockchain; the importing country's regulatory blockchain shards the importing country's data. Allocate storage addresses in importing countries And stamped with the importing country's timestamp ,Will and The receipt is returned to the transaction initiator; the transaction initiator then uses the obtained storage address in the exporting country. and the storage address of the importing country Calculate the transaction hash root The transaction initiator constructs two update transactions and sends them to the exporting country's regulatory blockchain and the importing country's regulatory blockchain, respectively, invoking the smart contracts on the corresponding chains based on the transaction numbers. Locate the corresponding data shard and... Reserved bits in the transaction hash root of the corresponding data shard; after both chains have completed the update, the two data shards are updated using a common transaction hash root. Achieve on-chain anchoring; simultaneously, the exporting country's regulatory blockchain will assign transaction numbers. With transaction hash root The mapping relationship is recorded in the shared ledger.

2. The blockchain-based method for reporting foreign exchange management information for cross-border transactions as described in claim 1, characterized in that: S1 includes: The transaction initiator extracts the exporter's name, exporter's digital identity, exporting country's regulatory address, and export customs declaration number from the contract summary, and combines them into an exporting country attribute field group. ; Extract the importer's name, importer's digital identity, importer's country of origin regulatory address, and import customs declaration number, and combine them into an importer's country attribute field group. ; Extract transaction number The transaction amount and currency are included, and a transaction hash root field is reserved, which are combined into a cross-border shared field group. ; Will and Encapsulated as export country data fragments ,Will and Encapsulated as importer data fragments The two shards are connected via transaction number. Maintain logical connections.

3. The blockchain-based method for reporting cross-border transaction foreign exchange management information as described in claim 2, characterized in that: S2 includes: Smart contracts on the exporting country's regulatory blockchain shard from exporting country data Extract transaction number and transaction hash root ,according to Constructing cross-chain query requests ; Smart contracts will Send to the cross-chain communication node, the cross-chain communication node will Routing to the importing country's regulatory blockchain; Importing countries regulate blockchain to receive cross-chain query requests ,according to Transaction number in Locate the corresponding importing country data fragment on the importing country's regulatory blockchain. ,from Extracting the fragmented hash root of importing country data and importing country timestamp Importing countries' regulatory blockchain will and In Compare; like and If the two match, then the importing country's regulatory blockchain generates a cross-chain joint certificate. ;in, The digital signature is provided for the importing country's regulatory blockchain; if the comparison is inconsistent, the importing country's regulatory blockchain determines that the cross-chain verification has failed. Importing country regulatory blockchain will The data is returned to the exporting country's regulatory blockchain via a cross-chain communication node, and stored on the exporting country's regulatory blockchain. .

4. The blockchain-based method for reporting cross-border transaction foreign exchange management information as described in claim 3, characterized in that: S3 includes: The party initiating the transaction will treat the full contract, scanned copies of invoices, and logistics documents as sensitive plaintext data. Transmitted to an off-chain database; the off-chain database contains sensitive plaintext data. Allocation of off-chain storage address And use a hash algorithm Calculate the hash value of sensitive data ; Off-chain databases will and return; The transaction initiator will Uploaded to the exporting country's regulatory blockchain; smart contracts on the exporting country's regulatory blockchain from cross-chain joint credentials. Extract transaction number ,according to Locate the corresponding transaction hash root in the shared ledger. Smart contracts will , and Related records are recorded in the shared ledger, forming related records. .

5. The blockchain-based method for reporting cross-border transaction foreign exchange management information as described in claim 4, characterized in that: S4 includes: Regulatory nodes read associated records from the shared ledger ,according to Off-chain storage address Send a data retrieval request to the off-chain database, the request containing the transaction number. ; Off-chain databases based on Locating the corresponding sensitive plaintext data and will Return to the regulatory node; The monitoring node receives sensitive plaintext data. The same hash algorithm used in S3 is used to calculate the verification hash value. ; Will Hash value of sensitive data stored in the shared ledger Compare; If the comparison results match, the sensitive plaintext data is confirmed. The authenticity of the data is verified; if the comparison results are inconsistent, the verification fails.

6. The blockchain-based method for reporting cross-border transaction foreign exchange management information as described in claim 5, characterized in that: S4 further includes: If the comparison results are consistent, the regulatory node will proceed from the sensitive plaintext data. Extract the transaction amount, names of both parties, and currency. According to the transaction number Query export country data shards from the export country's regulatory blockchain. Extract the exporting country's regulatory address and export customs declaration number; Querying import country data shards from the importing country's regulatory blockchain Extract the importing country's regulatory address and import customs declaration number; The regulatory node will populate the extracted data items into the corresponding fields of the foreign exchange management declaration document template, generating a foreign exchange management information declaration document with a digital signature. and calculate hash value ; Will Upload to the shared ledger transaction hash root Related records.

7. A blockchain-based cross-border transaction foreign exchange management information reporting system, based on the blockchain-based cross-border transaction foreign exchange management information reporting method according to any one of claims 1 to 6, characterized in that: Also includes: In the sharding and on-chain anchoring module, the transaction initiator splits the contract summary into export country data shards and import country data shards, and uploads them to the corresponding regulatory blockchains respectively. The two shards are anchored on-chain through a common transaction hash root. The cross-chain certificate generation module involves the exporting country's smart contract triggering a cross-chain query based on the exporting country's data shards. It requests verification of the importing country's data shard status from the importing country's regulatory blockchain. Once the two data shards are matched, a cross-chain joint certificate is generated. The off-chain hash storage module, after generating the cross-chain joint certificate, stores the sensitive plaintext data involved in the transaction in the off-chain database, and only stores the hash value of the sensitive plaintext data on the chain. The hash value is associated with the transaction hash root and recorded in the shared ledger. The verification and declaration generation module allows regulatory nodes to verify the authenticity of data by comparing sensitive plaintext data provided by the off-chain database with the hash value of evidence stored on the blockchain. Once the verification is successful, the module automatically generates a foreign exchange management information declaration document.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the blockchain-based cross-border transaction foreign exchange management information reporting method as described in any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the blockchain-based cross-border transaction foreign exchange management information reporting method as described in any one of claims 1 to 6.