Salary automatic payment system based on smart contract
By combining adaptive anomaly detection based on group statistical features and off-chain privacy computation with zero-knowledge proofs and on-chain smart contract verification, the challenges of privacy protection and result verification in the automatic payroll system are solved, achieving trustworthy payroll distribution that ensures the security of business secrets and transparent and fair payments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GONGWEI (GUANGDONG) COMMERCIAL DEVELOPMENT GROUP CO LTD
- Filing Date
- 2026-02-05
- Publication Date
- 2026-05-29
Smart Images

Figure CN122115133A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer data processing technology, and more specifically, to an automatic payroll system based on smart contracts. Background Technology
[0002] With the widespread application of blockchain technology, using smart contracts to automate payroll disbursements has become a crucial direction for corporate financial digitalization and automation. This decentralized payment method can significantly reduce human resource management costs, eliminate delays in intermediary processes, and ensure the immediacy and immutability of fund transfers. However, actual corporate payroll management is not a simple point-to-point asset transfer; it typically involves complex calculation models containing highly sensitive data such as key performance indicators, sales performance, commissions, and the company's overall profit margin. This data not only concerns the company's core business secrets but also directly involves employees' personal privacy.
[0003] In existing technical solutions, adopting a fully on-chain computation model, directly deploying payroll calculation logic and raw performance data on a public blockchain or transmitting them in plaintext via oracles, inevitably leads to the complete exposure of trade secrets and private data, failing to meet enterprise data security and compliance requirements. Conversely, if the computation process is entirely placed off-chain to protect privacy, only submitting the final payment result to an on-chain smart contract, the on-chain system degenerates into a black box, unable to verify the authenticity of the data source or the correctness of the computation logic, thus losing the core advantages of trustlessness and transparency originally established by blockchain technology. Furthermore, the human resources and performance data that form the basis of payroll calculation must undergo rigorous data cleaning before entering the automated calculation process. Existing data integrity verification and cleaning mechanisms mostly employ static, isolated anomaly detection models based on absolute thresholds. This mechanical verification method completely ignores the crucial group context relationships of employee data within the real organizational structure (such as the overall performance fluctuations of a specific project team over a specific period). This leads to a high rate of false positives or false negatives when processing enterprise-level data with inherent correlations, causing distortion or contamination of input data and ultimately undermining the accuracy and fairness of the automatic payroll system from the source.
[0004] Therefore, an optimized automatic payroll system is desired. Summary of the Invention
[0005] To address the aforementioned technical problems, this application is proposed. Embodiments of this application provide an automatic payroll system based on smart contracts, comprising: The sensitive payroll data aggregation and preprocessing module is used to periodically clean and structure the acquired basic human resources data stream, raw performance data, and company financial data to obtain a payroll calculation dataset containing complete elements within the current payment cycle. The off-chain confidential computation and list generation module is used to perform privacy computation processing on the salary calculation dataset in off-chain computing nodes using a preset confidential bonus model to obtain a plaintext list of salaries to be paid and private witness data containing intermediate calculation values. The zero-knowledge proof generation module is used to generate zero-knowledge proofs based on the confidential bonus model circuit corresponding to the confidential bonus model, using private witness data as private input and the list of unpaid salaries as public input. The payroll verification data on-chain submission module is used to submit the payroll list to be paid along with the zero-knowledge proof to the on-chain payroll verification data in order to obtain a payroll verification transaction. The on-chain smart contract verification module is used to trigger the payroll master smart contract deployed on the blockchain to parse payroll verification transactions, and to perform logical verification of the payroll list to be issued and the zero-knowledge proof to obtain a verification result flag. The automatic payroll asset distribution module is used to automatically distribute payroll assets based on the mapping relationship in the payroll list in response to the verification result flag indicating that the verification has passed.
[0006] Compared to existing technologies, the smart contract-based automatic payroll system provided in this application first introduces an adaptive anomaly detection mechanism based on group statistical characteristics. This mechanism cleanses multi-source heterogeneous data by establishing a dynamic relative benchmark, ensuring the business logic rationality of the input data. Building upon this, complex payroll model calculations are executed in an off-chain secure sandbox, generating a plaintext list and private witnesses. Zero-knowledge proofs generated by circuits are then used to transform the computational correctness into cryptographic evidence. Finally, a lightweight logical verification of this proof is performed via an on-chain smart contract. Without exposing the original performance data and calculation formulas, the integrity of the off-chain calculation is confirmed, and atomic asset distribution is automatically triggered based on the verification results. This establishes a trustworthy payroll system that balances the security of business secrets with transparent and fair payments. Attached Figure Description
[0007] The above and other objects, features, and advantages of this application will become more apparent from the more detailed description of the embodiments of this application in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the embodiments of this application to explain this application and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.
[0008] Figure 1 This is a system block diagram of a smart contract-based automatic payroll system according to an embodiment of this application; Figure 2This is a schematic diagram of the data flow of a smart contract-based automatic payroll system according to an embodiment of this application; Figure 3 This is a block diagram of the sensitive payroll data aggregation and preprocessing module in a smart contract-based automatic payroll system according to an embodiment of this application. Figure 4 This is a block diagram of an integrity verification unit in a smart contract-based automatic payroll system according to an embodiment of this application; Figure 5 This is a block diagram of the off-chain confidential computation and inventory generation module in the smart contract-based automatic payroll system according to an embodiment of this application. Figure 6 This is a block diagram of a zero-knowledge proof generation module in a smart contract-based automatic payroll system according to an embodiment of this application. Figure 7 This is a block diagram of the on-chain smart contract verification module in the smart contract-based automatic payroll system according to an embodiment of this application. Detailed Implementation
[0009] Hereinafter, exemplary embodiments according to this application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments of this application. It should be understood that this application is not limited to the exemplary embodiments described herein.
[0010] As indicated in this application and claims, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" are not specifically singular and may include plural forms. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of explicitly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.
[0011] While this application makes various references to certain modules of the systems according to embodiments of this application, any number of different modules can be used and run on user terminals and / or servers. The modules described are merely illustrative, and different aspects of the systems and methods may use different modules.
[0012] Flowcharts are used in this application to illustrate the operations performed by the system according to embodiments of this application. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, various steps can be processed in reverse order or simultaneously as needed. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.
[0013] Existing blockchain-based payroll systems face the dilemma of balancing privacy protection and result verification. Complete on-chain processing risks leaking trade secrets, while off-chain computation lacks credibility. Furthermore, traditional data cleaning mechanisms often suffer from high false positive rates in complex payroll scenarios due to a lack of group context awareness. Therefore, this application proposes an automated payroll system based on smart contracts. Specifically, the system first introduces an adaptive anomaly detection mechanism based on group statistical characteristics. This mechanism dynamically identifies anomalies by evaluating the relative position of data points within the group distribution, ensuring the accuracy and contextual rationality of input data from the source. Subsequently, the payroll calculation logic involving core trade secrets is encapsulated and executed in an off-chain secure sandbox, outputting only a plaintext list of payable items and encrypted private witness data, thereby generating a zero-knowledge proof. Finally, the on-chain smart contract, without needing to know the original performance data or calculation model, verifies the correctness of the calculation result simply by mathematically validating the zero-knowledge proof. Upon successful verification, asset distribution is automatically triggered, thus achieving trustless verification and precise execution of payroll while completely shielding sensitive information.
[0014] Figure 1 This is a system block diagram of a smart contract-based automatic payroll system according to an embodiment of this application. Figure 2 This is a schematic diagram illustrating the data flow of a smart contract-based automatic payroll system according to an embodiment of this application. Figure 1 and Figure 2As shown, the smart contract-based automatic payroll system 100 according to an embodiment of this application includes: a sensitive payroll data aggregation and preprocessing module 110, used to periodically clean and structure the acquired human resources basic data stream, raw performance data, and company financial data to obtain a payroll calculation dataset containing complete elements within the current payment cycle; an off-chain confidential computation and list generation module 120, used to perform privacy computation processing on the payroll calculation dataset in an off-chain computing node using a preset confidential bonus model to obtain a plaintext payroll list and private witness data containing intermediate calculation values; and a zero-knowledge proof generation module 130, used to generate a confidential bonus corresponding to the confidential bonus model. The gold model circuit uses private witness data as private input and the list of salaries to be paid as public input to perform zero-knowledge proof generation to obtain a computational zero-knowledge proof; the salary proof data on-chain submission module 140 is used to submit the list of salaries to be paid and the computational zero-knowledge proof to the blockchain to obtain a salary verification transaction; the on-chain smart contract verification module 150 is used to trigger the salary main smart contract deployed on the blockchain to parse the salary verification transaction, and perform logical verification on the list of salaries to be paid and the computational zero-knowledge proof to obtain a verification result flag; the salary asset automatic distribution module 160 is used to automatically distribute salary assets according to the mapping relationship in the list of salaries to be paid in response to the verification result flag indicating that the verification has passed.
[0015] In the aforementioned smart contract-based automatic payroll system 100, the sensitive payroll data aggregation and preprocessing module 110 is used to periodically clean and structure the acquired human resources basic data stream, raw performance data, and company financial data to obtain a payroll calculation dataset containing complete elements within the current payment cycle. It should be noted that, given that existing static anomaly detection models often ignore the crucial group context relationships within the enterprise's organizational structure, when processing intrinsically related payroll data, they are prone to misjudging group-wide low performance within a specific business cycle as anomalies, or failing to detect input errors that meet thresholds but significantly deviate from the group distribution due to a lack of relative comparison, thus causing distortion and contamination of the input data. Based on this, the technical solution of this application first periodically cleans and structures the acquired human resources basic data stream, raw performance data, and company financial data. By introducing an adaptive context anomaly detection mechanism based on group statistical characteristics, the statistical mean and standard deviation of each business unit are extracted to construct a dynamic benchmark. Furthermore, a Gaussian kernel function is used to perform context quality scoring and dynamic filtering on data points based on relative position evaluation to obtain a payroll calculation dataset containing complete elements within the current payment cycle. Through the above processing, data verification can be effectively upgraded from absolute threshold judgment to relative statistical position judgment, accurately identifying and eliminating unreasonable dirty data in specific group contexts, ensuring the accuracy and robustness of the automated payroll system from the source, and providing a high-confidence data foundation for subsequent off-chain privacy computation.
[0016] Figure 3 This is a block diagram of the sensitive payroll data aggregation and preprocessing module in a smart contract-based automatic payroll system according to an embodiment of this application. Figure 3 As shown, the sensitive salary data aggregation and preprocessing module 110 includes: a multi-source data cleaning unit 111, used to perform multi-source heterogeneous data cleaning and normalization on human resource basic data streams, raw performance data, and company financial data to obtain normalized basic data packages, normalized performance data packages, and normalized financial parameters; a record association aggregation unit 112, used to perform left join association processing on the normalized basic data packages and normalized performance data packages with the employee's unique identifier as the primary key, and append the normalized financial parameters as global constants to each record to obtain a primary aggregated record set; an integrity verification unit 113, used to perform data integrity verification and anomaly cleaning on the primary aggregated record set to obtain a verified salary record set; and a data encapsulation unit 114, used to perform fixed-point number conversion processing on sensitive fields in the verified salary record set and perform serialization encapsulation to obtain a salary calculation dataset.
[0017] In the aforementioned smart contract-based automatic payroll system 100, the multi-source data cleaning unit 111 and the record association and aggregation unit 112 are used to perform multi-source heterogeneous data cleaning and normalization on the human resources basic data stream, raw performance data, and company financial data to obtain normalized basic data packages, normalized performance data packages, and normalized financial parameters. Then, using the employee's unique identifier as the primary key, a left join is performed on the normalized basic data package and the normalized performance data package, and the normalized financial parameters are appended as global constants to each record to obtain a primary aggregated record set. It should be noted that since the human resources information, business performance indicators, and financial accounting parameters involved in enterprise payroll calculation are often stored in heterogeneous business systems, and the data sources have objective differences in data format, measurement units, and time granularity, directly performing association operations can easily lead to layout misalignment or numerical ambiguity. Furthermore, if global financial parameters are not pre-bound to individual records, it will increase the indexing overhead of subsequent parallel calculations. Based on this, the technical solution of this application first performs multi-source heterogeneous data cleaning and normalization on the human resources basic data stream, raw performance data, and company financial data to obtain normalized basic data packages, normalized performance data packages, and normalized financial parameters. Then, using the employee's unique identifier as the primary key, a left join is performed on the normalized basic data package and the normalized performance data package, and the normalized financial parameters are appended as global constants to each record to obtain a primary aggregated record set. Through the above processing, the format barriers and semantic conflicts of the multi-source data can be effectively eliminated, constructing a wide table structure with a unified structure and containing all computational elements, providing standardized data input for subsequent context-aware anomaly detection and off-chain confidential computation.
[0018] More specifically, in a concrete example of this application, the first step is to perform standardized cleaning of multi-source data. Data streams from three dimensions—human resources, performance, and finance—are accessed separately. A time window is established based on the start and end timestamps of the current payment cycle, filtering out redundant data frames outside the time window. Simultaneously, a unified conversion of units of measurement is performed on numeric fields, standardizing monetary values of different magnitudes to the smallest monetary unit. Text fields undergo unified character encoding processing, generating three independent normalized data packets. Based on this, a primary key-based association aggregation is performed, selecting the employee's unique identifier as the association primary key. The normalized basic data packet is used as the left table, and the normalized performance data packet is used as the right table. A left join operation is performed to ensure that each employee record containing basic salary information attempts to match the corresponding performance data. For performance fields that do not match, zero or default values are filled in. Finally, the global parameters are broadcast appended, the current bonus pool coefficient and company profit margin in the normalized financial parameters are read, copied as immutable global constants and appended to each employee record after the above association, forming a primary aggregated record set containing individual attributes, performance and global financial factors, thereby completing the transformation from discrete heterogeneous data to a structured wide table.
[0019] In the aforementioned smart contract-based automatic payroll system 100, the integrity verification unit 113 is used to perform data integrity verification and anomaly cleaning on the primary aggregated record set to obtain a verified payroll record set. It should be noted that, given that existing static anomaly detection models often ignore the crucial group context relationships within an enterprise's organizational structure, when processing intrinsically related payroll data, they are prone to misjudging collective low performance within a specific business cycle as anomalies, or failing to detect input errors that meet thresholds but significantly deviate from the group distribution due to a lack of relative comparison, thus causing distortion and contamination of the input data. Based on this, the technical solution of this application further performs data integrity verification and anomaly cleaning on the primary aggregated record set to obtain a verified payroll record set. By introducing an adaptive context anomaly detection mechanism based on group statistical characteristics, the primary aggregated record set is grouped according to group identifiers, and the statistical mean and standard deviation of key performance indicators for each group are calculated to construct a dynamic benchmark. Subsequently, each employee record is traversed, and a comprehensive data quality score is calculated by applying a context quality scoring formula in combination with the statistical characteristics of its group. This formula calculates the standardized score of the record's performance value relative to the group mean and maps it to a non-linear score using a Gaussian kernel function. Finally, the context quality score record set is filtered according to a preset dynamic threshold to retain high-quality records. Through the above processing, data verification can be effectively upgraded from absolute threshold judgment to relative statistical position judgment, accurately identifying and eliminating unreasonable dirty data in specific group contexts, ensuring the accuracy and robustness of the automated payroll system from the source, and providing a high-confidence data foundation for subsequent off-chain privacy computation.
[0020] Figure 4 This is a block diagram of an integrity verification unit in a smart contract-based automatic payroll system according to an embodiment of this application. Figure 4 As shown, the integrity verification unit 113 includes: a feature extraction subunit 1131, used to extract group statistical features from the primary aggregated record set to obtain a group statistical feature set; a quality scoring subunit 1132, used to perform context-aware data quality scoring on the group statistical feature set and the primary aggregated record set to obtain a context quality score record set; and a dynamic filtering subunit 1133, used to perform dynamic filtering on the context quality score record set based on context scores to obtain a verified salary record set.
[0021] In the aforementioned smart contract-based automatic payroll system 100, the feature extraction subunit 1131 is used to extract group statistical features from the primary aggregated record set to obtain a group statistical feature set. It should be noted that, given the lack of consideration for the inherent correlation of data in existing mechanisms, which primarily rely on isolated absolute value judgments, it is difficult to adapt to the objectively existing performance distribution differences between different business units, resulting in the inability to establish a verification benchmark adapted to the characteristics of specific teams. Based on this, the technical solution of this application further extracts group statistical features from the primary aggregated record set to obtain a group statistical feature set. Through the above processing, a dynamic and relative benchmark can be effectively established for subsequent context-aware verification. By constructing a unique mathematical profile of normal behavior for each business unit, the verification process can be adapted to the business characteristics of different teams, laying a data foundation for achieving context-aware quality assessment.
[0022] More specifically, in a concrete example of this application, a grouping operation is first performed, dividing the record set containing all employees into several independent group subsets based on the group identifier field in the primary aggregate record set. For each group... G Extract and calculate its key performance indicators. Statistical mean μ G With standard deviation σ G The calculation formula is expressed as follows:
[0023] in, μ G Indicates group G The arithmetic mean of the key performance indicators (KPIs) of all team members represents the central tendency of the team's performance, σ. G Indicates group G The standard deviation of key performance indicators for all team members quantifies the normal range of fluctuation in team performance. G | indicates a groupG The total number of members within, Indicates group G Inner j The key performance indicator (KPI) values for each member are then calculated. Based on this, the calculated mean and standard deviation are encapsulated as statistical feature records for the group, ultimately forming a group statistical feature set. For example, when processing data from the R&D department, if the department is in a critical technical phase, the calculated mean may generally be low and the standard deviation small. Conversely, due to differences in performance-based commissions, the standard deviation for the sales department may be larger. This differentiated feature extraction accurately reflects the current true business situation of each department, ensuring that subsequent data cleaning logic can distinguish between business fluctuations and genuine anomalies.
[0024] In the aforementioned smart contract-based automatic payroll system 100, the quality scoring subunit 1132 is used to perform context-aware data quality scoring on the group statistical feature set and the primary aggregated record set to obtain a context quality score record set. It should be noted that, given the lack of consideration for the group context of data points in existing scoring mechanisms, relying solely on static absolute thresholds cannot identify relative anomalies that fall within the numerical range but deviate from the group distribution, resulting in blind spots in data quality assessment. Therefore, the technical solution of this application further performs context-aware data quality scoring on the group statistical feature set and the primary aggregated record set to obtain a context quality score record set. Through this processing, data quality assessment can be effectively deconstructed into a product of field integrity and contextual consistency, upgrading anomaly detection from a static absolute threshold judgment paradigm to a dynamic relative statistical position judgment paradigm. This enables a quantitative assessment of the degree to which data points deviate from their group center trend, accurately identifying relatively unreasonable data points in specific business scenarios.
[0025] More specifically, in a specific example of this application, the execution process first iterates through each employee record in the primary aggregated recordset, retrieves the corresponding statistical mean and standard deviation from the group statistical feature set based on the group identifier in the record, and then applies the contextual quality scoring formula to calculate the overall score of the record, as shown below:
[0026] in, This represents a comprehensive data quality score that incorporates contextual consistency. w i This represents the preset weight of the i-th key field. δ i (x j ) For indicator functions, when a record j The i Each field takes a value of 1 if it is valid, and 0 otherwise. This represents the key performance indicator value of the current record j. μ G and σ G These are the mean and standard deviation of the group to which j belongs, obtained from the first step. λ is a very small positive constant used to prevent the denominator from being 0, and λ is an adjustable tolerance factor used to control the sensitivity of the Gaussian kernel function to deviation. This calculation logic uses the Gaussian kernel function to map the standardized difference between the current record's performance value and its group mean into a smooth, non-linear score. When an employee's performance is close to the team average, their contextual consistency score approaches 1; however, when their performance deviates significantly, whether too high or too low, the score rapidly decays to near 0. For example, in a high-performing sales team scenario with an average key performance indicator (KPI) of 150, if an employee record is marked with a performance indicator of 500 due to an input error, although this value is within the globally allowed range, it far exceeds the statistical mean of the group, causing the value in the exponential part of the formula to increase, thus affecting the final calculated contextual quality score. Data with an index close to 0 is identified as low-quality data; conversely, in a technical team with an average index of only 50, a record with an index of 45 will receive a high-quality score close to 1 because it closely matches the group distribution.
[0027] In the aforementioned smart contract-based automated payroll system 100, the dynamic filtering subunit 1133 is used to dynamically filter the context quality score record set based on context scores to obtain a verified payroll record set. It should be noted that although the preceding steps have completed a quantitative assessment of the data quality for each employee record, they have not substantially removed anomalous data identified as having low confidence. Without a mandatory filtering mechanism, dirty data generated by input errors, system failures, or special business scenarios may still flow into subsequent calculation stages, thereby undermining the fairness of the entire payroll system. Based on this, the technical solution of this application further performs dynamic filtering on the context quality score record set based on context scores to obtain a verified payroll record set. Through the above processing, the calculated high-quality scores can be effectively applied to actual data cleaning decisions, ensuring that each piece of data in the final output is not only complete at the field level but also reasonable at the business logic level. This ensures the accuracy, fairness, and robustness of the entire automated payroll system from the source, building a solid data foundation for achieving an end-to-end, human-intervention-free, reliable payroll management system.
[0028] More specifically, in a concrete example of this application, the execution process involves performing a set filtering operation on the context quality score record set. Based on preset quality control standards, only records with context quality scores higher than a preset dynamic threshold are retained, thereby generating the final high-purity data source. The mathematical expression of this filtering logic is as follows:
[0029] This represents the final set of verified records selected from the pool, while the second set represents the complete set of records after the second scoring step. This represents the context quality score calculated for record j in the second step. This represents the dynamic quality score threshold used for filtering. The execution of this step marks the completion of the entire cleaning process, which, by setting strict entry thresholds, excludes all records that fail the contextual consistency check (i.e., ...). Less than or equal to Records of this type (such as dynamic quality score thresholds) are physically removed or marked for isolation. With a setting of 0.7, when processing the salary data of a sales team, a record with an abnormally high performance value due to a decimal point misalignment has a context quality score of only 0.05, far below the threshold, and will therefore be automatically intercepted and removed by this step. On the other hand, another record reflecting a slight decline in performance due to normal sick leave has a score of 0.85, which is higher than the threshold, because its fluctuation is in line with statistical patterns. Therefore, it is retained and included in the subsequent salary calculation dataset, ensuring that the final payment behavior is only generated for those real and credible business performances.
[0030] In the aforementioned smart contract-based automatic payroll system 100, the data encapsulation unit 114 is used to perform fixed-point number conversion on sensitive fields in the verified payroll record set and execute serialization encapsulation to obtain the payroll calculation dataset. It should be noted that since the zero-knowledge proof circuits and confidential computing environments involved in subsequent steps are typically built on a finite-field arithmetic system, their arithmetic logic gates only support integer operations and cannot natively support the floating-point format commonly found in traditional payroll data. Furthermore, the precision rounding differences in floating-point operations under different hardware architectures can easily lead to the failure of cryptographic proof verification. Based on this, the technical solution of this application further performs fixed-point number conversion on sensitive fields in the verified payroll record set and executes serialization encapsulation to obtain the payroll calculation dataset. Through the above processing, the risk of precision loss and non-deterministic errors that may be caused by floating-point operations can be effectively eliminated, accurately adapting the monetary values at the business level to finite-field integer elements recognizable by the cryptographic underlying layer, thereby ensuring the mathematical rigor and consistency of results generated by subsequent off-chain calculations and proofs.
[0031] More specifically, in a concrete example of this application, the process first involves integer mapping of sensitive numerical values. This identifies floating-point sensitive fields in the verified payroll record set that involve core calculation logic such as base salary, performance bonus coefficients, and deductions. Based on preset precision requirements, a scaling factor is selected. The original floating-point value is multiplied by this scaling factor and rounded to convert it into a fixed-point integer without decimal places. For example, salary data accurate to the cent is multiplied by one hundred to eliminate decimal points. Subsequently, standardized encapsulation of the data structure is performed. The converted fixed-point integer data is mapped to a specific arithmetic vector structure according to the preset input port arrangement rules of the confidential bonus model circuit. This vector structure is then binary serialized and encoded, packaged into a compact, continuous byte stream format, ultimately generating a payroll calculation dataset for direct reading and processing by off-chain computing nodes.
[0032] In the aforementioned smart contract-based automatic payroll system 100, the off-chain confidential computation and list generation module 120 is used in an off-chain computing node to perform privacy computation processing on the payroll calculation dataset using a preset confidential bonus model to obtain a plaintext payroll list and private witness data containing intermediate calculation values. It should be noted that, given that complex payroll calculation models often contain core business secrets and that the original performance data involves highly sensitive employee privacy, directly deploying it in a transparent blockchain smart contract would inevitably lead to the leakage of sensitive logic and privacy data. Completely closed off-chain computation, on the other hand, lacks auditable transparency. Based on this, the technical solution of this application further utilizes a pre-defined confidential bonus model in off-chain computing nodes to perform privacy-preserving computation processing on the salary calculation dataset. Using a secure computing sandbox initialized based on the confidential bonus model, batch matrix numerical vectorization parsing is performed on the salary calculation dataset to obtain employee feature vector matrices and in-memory model instances. The in-memory model instances are then used to perform iterative operations containing non-linear salary logic on the employee feature vector matrices. The full computation trajectory dataset is then split into results and serialized with witness data to obtain a plaintext list of pending salaries and private witness data containing intermediate computational values. Through the above processing, computationally intensive and confidential salary logic operations can be effectively decoupled from the blockchain to a secure off-chain environment, physically isolating sensitive data from direct contact with external networks. Simultaneously, by generating private witness data containing complete computational trajectories, indispensable mathematical evidence is provided for the subsequent generation of zero-knowledge proofs, thus achieving the accurate execution of complex salary arithmetic logic without exposing trade secrets.
[0033] Figure 5 This is a block diagram of the off-chain confidential computation and inventory generation module in a smart contract-based automatic payroll system according to an embodiment of this application. Figure 5As shown, the off-chain confidential computation and list generation module 120 includes: a vectorization parsing unit 121, used to perform batch matrix numerical vectorization parsing on the salary calculation dataset using a secure computation sandbox initialized based on a confidential bonus model to obtain an employee feature vector matrix and a memory-based model instance; an iterative computation unit 122, used to perform iterative computation processing containing nonlinear salary logic on the employee feature vector matrix using the memory-based model instance to obtain a full calculation trajectory dataset; and a result splitting and serialization unit 123, used to split the full calculation trajectory dataset into results and serialize witness data to obtain a payroll list to be issued and private witness data.
[0034] In the aforementioned smart contract-based automatic payroll system 100, the vectorization parsing unit 121 is used to perform batch matrix numerical vectorization parsing on the payroll calculation dataset using a secure computing sandbox initialized based on a confidential bonus model to obtain employee feature vector matrices and in-memory model instances. It should be noted that performing complex payroll logic calculations on large-scale employee datasets using traditional serial processing methods faces inefficiency bottlenecks, and directly exposing model logic in an uncontrolled memory environment carries the risk of reverse engineering. Furthermore, standard database record formats are difficult to directly adapt to the high-performance matrix operations required for subsequent cryptographic proof generation. Therefore, the technical solution of this application further utilizes a secure computing sandbox initialized based on a confidential bonus model to perform batch matrix numerical vectorization parsing on the payroll calculation dataset to obtain employee feature vector matrices and in-memory model instances. Through this processing, sensitive computational logic can be effectively isolated in a protected memory area to prevent external tampering or eavesdropping, while converting discrete employee business records into a structured mathematical matrix form, laying a structural foundation for subsequent high-throughput parallel computing and the generation of zero-knowledge proof witness data.
[0035] More specifically, in a concrete example of this application, the execution process follows a sequential logic of environment initialization followed by data structure transformation. First, a logically isolated secure computing sandbox is instantiated in the volatile memory of the computing node. The pre-encrypted confidential bonus model is loaded into this sandbox and decrypted. The abstract business rules, including the basic salary structure, variable performance weighting coefficients, and global adjustment factors, are compiled into a memory-based model instance invisible to the operating system user space. Subsequently, parsing and mapping operations are performed on the payroll calculation dataset. The serialized and encapsulated binary data stream is traversed to extract the integer mapping values of the core fields related to payroll calculation for each employee, including basic salary, key performance indicator scores, and sales volume. These discrete values are then filled according to the specific column indices corresponding to the input variables of the confidential bonus model to construct a multi-dimensional employee feature vector matrix. Each row of the vector uniquely represents the full quantified features of an employee, ensuring that the data arrangement strictly aligns with the input requirements of subsequent arithmetic circuits.
[0036] In the aforementioned smart contract-based automatic payroll system 100, the iterative computation unit 122 utilizes a memory-based model instance to perform iterative computation processing on the employee feature vector matrix, incorporating nonlinear payroll logic, to obtain a full computation trajectory dataset. It should be noted that, due to the widespread presence of complex arithmetic logic in enterprise payroll systems, such as nonlinear incentives based on seniority, performance weighting, and dynamic bonus pool adjustments, a single linear aggregation operation is insufficient to accurately represent the actual business rules. Furthermore, zero-knowledge proof generation algorithms require the prover to provide a complete intermediate computational state from input to output to construct an assignment vector that satisfies circuit constraints. Based on this, the technical solution of this application further utilizes a memory-based model instance to perform iterative computation processing on the employee feature vector matrix, incorporating nonlinear payroll logic, to obtain a full computation trajectory dataset. Through this processing, complex payroll calculation tasks can be effectively and accurately executed in an off-chain confidential environment, while simultaneously capturing all intermediate variables and state transition data generated during the computation process, providing comprehensive information support for the subsequent construction of private witness data that passes R1CS constraint checks.
[0037] More specifically, in a specific example of this application, the execution process employs a row-level iterative mechanism, utilizing a memory-based model instance to traverse the employee feature vector matrix row by row. For each row representing a single employee feature vector, arithmetic operations are performed according to a preset non-linear salary calculation formula. This calculation logic involves not only the weighted summation of the basic data but also non-linear transformations based on specific business rules, the specific mathematical expression of which is as follows:
[0038] in, Indicates the first iThe final total payable amount calculated for each employee. Indicates the first i The fixed base salary of each employee, Indicates the first i Key performance indicator scores for each employee This represents the weighting factor of the key performance indicator score on the contribution of performance bonuses. Indicates the first i Sales revenue or business volume generated by each employee This represents the weighting factor for the contribution of sales revenue to performance bonuses. This indicates the bonus pool adjustment factor, which is affected by the company's overall profitability. Indicates based on the first i The nonlinear adjustment function value for the length of service of each employee. While performing the above calculations, the intermediate results generated by each arithmetic operation step are recorded simultaneously, including various products, sums and function mapping values. These intermediate data are encapsulated together with the original input and the final result to form a full calculation trajectory dataset.
[0039] In the aforementioned smart contract-based automatic payroll system 100, the result splitting and serialization unit 123 is used to split the full calculation trajectory dataset and serialize the witness data to obtain the payroll list to be paid and private witness data. It should be noted that since the full calculation trajectory includes both the final payment result and highly sensitive intermediate process data such as individual performance details, sales performance details, and company profit coefficients, direct output without effective data layering would lead to the complete exposure of trade secrets and personal privacy in subsequent stages. Furthermore, blockchain smart contracts only require definite transfer instructions, not redundant calculation details. Based on this, the technical solution of this application further splits the full calculation trajectory dataset and serializes the witness data to obtain the payroll list to be paid and private witness data. Through the above processing, the logical decoupling of public payment instructions and private calculation evidence can be effectively achieved. While providing a clear basis for on-chain asset transfers, it preserves a complete mathematical verification path for the generation of zero-knowledge proofs, thereby meeting the dual requirements of result disclosure and process confidentiality in payroll scenarios.
[0040] More specifically, in a concrete example of this application, the execution process follows the logic of data classification, extraction, and formatted recombination. First, a binary splitting operation is performed on the full computation trajectory dataset. From each complete computation trajectory, the employee's unique identifier and the final calculated total salary amount are extracted, combined into plaintext records in key-value pair form, and aggregated to generate a list of salaries to be paid. This list will serve as the basis for subsequent on-chain public inputs. Subsequently, witness data encapsulation for the zero-knowledge proof circuit is performed. All remaining original input variables, intermediate calculation results, and auxiliary calculation parameters in the full computation trajectory are flattened and mapped strictly according to the wire index order defined by the confidential bonus model circuit. These discrete values are converted into finite field element vectors recognizable by the arithmetic circuit and binary serialization encoding is performed on them. Finally, private witness data that can only be read by the proof generator is generated, ensuring that each logical step of the computation process has a corresponding numerical witness and is not disclosed to the outside world.
[0041] In the aforementioned smart contract-based automatic salary disbursement system 100, the zero-knowledge proof generation module 130 is used to generate a computational zero-knowledge proof based on a confidential bonus model circuit corresponding to the confidential bonus model, using private witness data as private input and a list of salaries to be disbursed as public input. It should be noted that although off-chain computing nodes perform complex privacy calculations, the plaintext list they output remains black-box data for the blockchain system, unable to prove its innocence. Furthermore, disclosing the original input or computational logic to verify the authenticity of the data would render the privacy protection mechanism ineffective, thus creating a dilemma where verification and privacy are mutually exclusive. Therefore, the technical solution of this application further utilizes a confidential bonus model circuit corresponding to the confidential bonus model, using private witness data as private input and a list of salaries to be disbursed as public input to generate a computational zero-knowledge proof. Through the above processing, the verification of the correctness of the computational logic can be effectively transformed into the mathematical verification of cryptographic evidence. Under the premise of strictly shielding the input data and model details, a trustworthy bridge connecting the off-chain confidential computing environment and the on-chain public verification environment is constructed, ensuring that the prover has valid witnesses that meet specific arithmetic constraints, thereby achieving the coexistence of transparency in the computation process and anonymity of data content.
[0042] Figure 6 This is a block diagram of the zero-knowledge proof generation module in a smart contract-based automatic payroll system according to an embodiment of this application. Figure 6As shown, the zero-knowledge proof generation module 130 includes: a mapping assignment unit 131, used to perform mapping processing on the payroll list to be paid using public input wires, and to parse and assign private witness data to the private witness wires of the confidential bonus model circuit to obtain an assigned circuit instance; a constraint checking unit 132, used to perform R1CS constraint system transformation and satisfaction checks on the assigned circuit instance to obtain a valid constraint vector set; and a proof construction unit 133, used to construct an elliptic curve pairing proof on the valid constraint vector set using a preset proof key to obtain a computational zero-knowledge proof.
[0043] In the aforementioned smart contract-based automatic payroll system 100, the mapping and assignment unit 131 is used to perform mapping processing on the payroll list to be paid using public input wires, and to parse and assign private witness data to the private witness wires of the confidential bonus model circuit to obtain an assigned circuit instance. It should be noted that since the arithmetic circuit of zero-knowledge proof only defines the mathematical constraint structure of the computational logic and does not contain specific business data, and cryptographic protocols strictly require the distinction between publicly visible statements visible to the verifier and secret knowledge held by the prover, without explicit wire assignment operations, the circuit cannot instantiate the abstract algorithm model into a concrete proposition to be proven. Based on this, the technical solution of this application further performs mapping processing on the payroll list to be paid using public input wires, and parses and assigns private witness data to the private witness wires of the confidential bonus model circuit to obtain an assigned circuit instance. Through the above processing, the specific business values within the current payment cycle can be accurately anchored to the corresponding input port of the circuit, establishing a rigid binding relationship between the public payment result and the private calculation process at the mathematical level, providing a unique instantiation basis for the subsequent generation of a complete zero-knowledge proof of computation.
[0044] More specifically, in a concrete example of this application, the execution process follows an instantiation path from interface definition loading to numerical filling. First, the interface description file of the confidential bonus model circuit is read to determine the index positions and type attributes of the input signals, identifying the set of wires marked as public inputs and the set of wires marked as private witnesses. Then, the plaintext list of payroll to be paid is traversed and parsed, extracting the employee's unique identifier and final salary amount from each record. These are converted into finite field elements conforming to the requirements of elliptic curve scalar field and assigned sequentially to the circuit's public input wires according to predefined mapping rules, establishing the boundary conditions for public verification. Next, the binary format private witness data is deserialized to restore the full numerical values, including base salary, performance indicators, sales performance, and all intermediate calculation steps. These values are matched one by one and filled into the private witness wires inside the circuit, ultimately forming a circuit instance object containing all signal assignments. This object completely freezes all state details of a single payroll calculation.
[0045] In the aforementioned smart contract-based automatic payroll system 100, the constraint checking unit 132 is used to perform R1CS constraint system transformation and satisfaction checks on the assigned circuit instances to obtain a valid constraint vector set. It should be noted that although arithmetic circuits intuitively describe the topological structure of payroll calculation logic, their non-standardized gate-level representation cannot be directly compatible with the elliptic curve pairing operation at the bottom layer of zero-knowledge proof algorithms. Furthermore, forcibly executing high-overhead cryptographic proof construction when the private witness data itself contains logical errors will lead to unnecessary consumption of computational resources and the ultimate failure of proof generation. Based on this, the technical solution of this application further performs R1CS constraint system transformation and satisfaction checks on the assigned circuit instances to obtain a valid constraint vector set. Through the above processing, the complex payroll calculation logic can be effectively flattened into a standard first-rank constraint system. Pre-defined mathematical satisfaction verification ensures that the assigned vectors strictly conform to the circuit constraint equations, thereby providing a solid and compliant algebraic foundation for the subsequent construction of polynomial-based cryptographic proofs.
[0046] More specifically, in a concrete example of this application, the execution process follows a transformation logic from topological structure to algebraic equations. First, the assigned circuit instance is flattened, converting each basic arithmetic logic gate in the circuit into a set of linear constraints satisfying multiplicative form, thereby constructing a first-order rank constraint system. During this process, for each logic constraint into which the circuit is decomposed, its corresponding coefficient vector is defined, and a satisfaction check is performed using the full assignment vector. The mathematical expression of this check logic is as follows:
[0047] in, m This represents the total number of constraints in a first-rank constraint system, that is, the total number of logic gates into which the circuit is decomposed. j This represents the constraint index for the current validation, with values ranging from 0 to... m , S This represents a full assignment vector containing circuit-specific variables, common inputs, private inputs, and intermediate auxiliary variables, with dimensions of [missing information]. n ×1, a j ,b j ,c j Indicates the first j The coefficient vector corresponding to each constraint has dimension 1. n ×1, This represents the inner product operation of two vectors. This step verifies whether the product of a linear combination of the input vectors and the weights is strictly equal to the linear combination of the output vectors. Only if all... mOnly when all constraint equations are true simultaneously is the current salary calculation trajectory confirmed to be valid, and these verified constraint parameters are packaged into a set of valid constraint vectors as the confidence input for subsequent proof construction.
[0048] In the aforementioned smart contract-based automatic payroll system 100, the proof construction unit 133 is used to construct an elliptic curve pairing proof on the valid constraint vector set using a pre-set proof key to obtain a computational zero-knowledge proof. It should be noted that although the valid constraint vector set confirms the correctness of the computational logic at the algebraic level, its massive data size makes it difficult to directly adapt to the extremely expensive storage and verification resources of the blockchain. Furthermore, the vector data, which has not undergone homomorphic encryption or obfuscation, still carries the risk of inferring private witnesses. Based on this, the technical solution of this application further utilizes a pre-set proof key to construct an elliptic curve pairing proof on the valid constraint vector set to obtain a computational zero-knowledge proof. Through the above processing, the data load required to verify the integrity of the computation can be effectively compressed to a constant-level byte size. Simultaneously, the discrete logarithm problem is used to completely shield the numerical information of private inputs, ultimately generating a compact and mathematically collision-resistant cryptographic credential. This allows on-chain nodes to verify the authenticity of off-chain payroll calculations simply by checking this credential.
[0049] More specifically, in a concrete example of this application, the execution process follows a high-strength cryptographic transformation logic. First, it retrieves the proof key, generated and stored through multi-party computation during system initialization. This key contains cryptographic parameters that correspond one-to-one with the confidential bounty model circuit structure. Then, it maps the polynomial coefficients of the effective constraint vector set onto a specific elliptic curve group, performing large-scale multiscalar multiplication and Fast Fourier Transform to compress the complex vector constraints into discrete point coordinates on the elliptic curve. Based on this, a zero-knowledge proof structure containing three core group elements is constructed: proof point A, proof point B, and proof point C. Proof points A and C are located in the first group of the elliptic curve, while proof point B is located in the second group. These points mathematically imply a commitment to the correctness of the original computation trajectory without revealing any specific numerical values. Finally, the generated group elements are binary serialized and converted into a hexadecimal string format suitable for network transmission and on-chain parsing, thus completing the final transformation from algebraic constraints to cryptographic credentials.
[0050] In the aforementioned smart contract-based automatic payroll disbursement system 100, the payroll proof data on-chain submission module 140 is used to submit the payroll list to be disbursed and the zero-knowledge proof of computation on-chain to obtain payroll verification transactions. It should be noted that since the payroll list to be disbursed and the zero-knowledge proof generated off-chain are currently only stored as static data files on the local computing node, the blockchain network cannot actively perceive or obtain this external data. Furthermore, the execution of smart contracts must be triggered by transaction instructions conforming to specific protocol specifications. If this data is not encapsulated into a standard blockchain transaction format and injected into the network, subsequent verification and payment logic will not be able to start. Based on this, the technical solution of this application further submits the payroll list to be disbursed and the zero-knowledge proof of computation on-chain to obtain payroll verification transactions. Through the above processing, cross-domain transmission of data from the off-chain local environment to the on-chain distributed ledger can be effectively realized, establishing a proof anchor point for the computation results and providing a compliant input carrier for triggering the automated execution of smart contracts.
[0051] More specifically, in a specific example of this application, the on-chain submission module 140 for the salary verification data includes: an encoding and verification unit, used to perform type conversion and concatenation encoding processing on the salary list to be paid and the zero-knowledge proof, and to calculate the integrity verification hash to obtain serialized call data; a signature and encryption unit, used to perform signature and encryption processing on the original transaction object containing the serialized call data and the current network state parameters to obtain a signed transaction data block; and a broadcast propagation unit, used to perform broadcast injection and mempool propagation of the signed transaction data block to the blockchain peer-to-peer network to obtain the salary verification transaction.
[0052] In other words, more specifically, the execution process follows a progressive logic from data adaptation and encoding to network broadcast propagation. First, the data payload is serialized and its integrity is verified. Based on the target blockchain's application binary interface specification, the set of employee on-chain wallet addresses (or the set of on-chain wallet addresses obtained by mapping employee unique identifiers through the contract registry) and the set of monetary values in the payroll list are type-converted into a dynamic array structure. Simultaneously, the elliptic curve group elements in the zero-knowledge proof are converted into a fixed-length byte stream. Then, concatenation encoding is performed, merging the two into a continuous hexadecimal byte string. Finally, a hash algorithm is used to calculate the integrity verification hash of this byte string to obtain the serialized call data. The mathematical expression of this verification logic is as follows:
[0053] in, This represents the generated integrity verification hash value. This represents the Keccak-256 one-way hash function, and || represents the bit string concatenation operator. This represents an encoding function that conforms to the virtual machine specification. This indicates the data in the pending payroll list. This involves calculating zero-knowledge proof data. Based on this, the transaction object is constructed and signed. The current blockchain network's state parameters, including transaction count and gas rate, are read. An original transaction object containing serialized call data and the aforementioned parameters is constructed, and an asymmetric cryptographic signature is performed on this object using the operator's private key, generating a signed transaction data block containing digital signature information. Finally, the transaction is broadcast and propagated. The signed transaction data block is injected into the blockchain peer-to-peer network via a remote procedure call interface, allowing it to be verified and propagated in the memory pools between nodes, ultimately forming a payroll verification transaction awaiting package confirmation.
[0054] In the aforementioned smart contract-based automatic payroll disbursement system 100, the on-chain smart contract verification module 150 is used to trigger the payroll master smart contract deployed on the blockchain to parse the payroll verification transaction, and to perform logical verification of the payroll list to be disbursed and the zero-knowledge proof to obtain a verification result flag. It should be noted that although the payroll verification transaction has been successfully broadcast to the blockchain network, it only represents the data submission action rather than the final confirmation of business validity. Furthermore, zero-knowledge proofs, as highly compressed cryptographic evidence, must undergo rigorous mathematical verification in the on-chain environment to prove that the underlying off-chain computation logic has not been tampered with. Without this substantial review process, the blockchain system will be unable to distinguish between legitimate payment requests and potential malicious attacks or invalid calculations. Therefore, the technical solution of this application further triggers the payroll master smart contract deployed on the blockchain to parse the payroll verification transaction, and to perform logical verification of the payroll list to be disbursed and the zero-knowledge proof to obtain a verification result flag. Through the above processing, the right to verify the results of off-chain calculations can be effectively returned to the decentralized smart contract. Without touching the original sensitive data, the determinism of mathematical algorithms completely eliminates human intervention and trust costs, thus establishing the legal basis for the subsequent automatic distribution of salary assets.
[0055] Figure 7 This is a block diagram of the on-chain smart contract verification module in a smart contract-based automatic payroll system according to an embodiment of this application. Figure 7As shown, the on-chain smart contract verification module 150 includes: a load parsing and reconstruction unit 151, used to perform load separation parsing on the salary verification transaction and aggregate the parsed finite field element set into a common input vector to obtain a reconstructed verification parameter set containing the common input vector and the computation of zero-knowledge proofs; a pairing verification unit 152, used to perform elliptic curve bilinear pairing verification on the reconstructed verification parameter set using a preset verification key and a pre-compiled contract to obtain a Boolean verification result; and a result persistence unit 153, used to lock the state variables of the smart contract and persist the result in response to the Boolean verification result indicating that the verification has passed, to obtain a verification result flag.
[0056] In the aforementioned smart contract-based automatic payroll disbursement system 100, the load parsing and reconstruction unit 151 is used to perform load separation parsing on payroll verification transactions and aggregate the parsed finite field element set into a common input vector to obtain a reconstructed verification parameter set containing the common input vector and the computation of zero-knowledge proofs. It should be noted that since the original load of blockchain transactions is usually transmitted in a compact binary serialization format over the network, and the zero-knowledge proof verification algorithm executed by on-chain smart contracts relies on specific elliptic curve group elements and finite field arithmetic logic, the original byte stream cannot be directly recognized and computed by the pairing function. Furthermore, the verification logic requires that the publicly available business data and cryptographic proofs be strictly bound mathematically to prevent data tampering. Based on this, the technical solution of this application further performs load separation parsing on payroll verification transactions and aggregates the parsed finite field element set into a common input vector to obtain a reconstructed verification parameter set containing the common input vector and the computation of zero-knowledge proofs. Through the above processing, the data format conversion from network transmission protocol format to cryptographic verification format can be effectively completed, and the discrete payroll details can be transformed into a mathematical vector that conforms to an algebraic structure, thereby providing standardized input parameters for subsequent high-precision elliptic curve bilinear pairing verification.
[0057] More specifically, in a concrete example of this application, the execution process follows a logical path from decoding and decomposition to algebraic reconstruction. First, the transaction payload is decoded and separated. Responding to the transaction trigger, the smart contract uses the decoding instructions of the application's binary interface to parse the received call data. Based on predefined byte offsets and data type signatures, the continuous hexadecimal byte stream is decomposed into two independent parts: an array of pending payroll items representing business content and a byte string representing the computational zero-knowledge proof of cryptographic evidence. Subsequently, the mapping and aggregation of finite field elements are performed. Each item in the pending payroll list is traversed, and the employee's unique identifier and payroll amount are converted from integer format to finite field elements over an elliptic curve scalar field. These elements are then linearly combined based on the basis parameters in the verification key to construct a common input vector L that integrates all publicly available information. The mathematical expression of this aggregation logic is as follows:
[0058] in, L This represents the aggregated common input vector, where l represents the number of common inputs. x i Indicates the first i A payroll data element (such as employee ID or amount) that has undergone finite field transformation. IC i This indicates that the preset key in the verification key is related to the first... i The group element basis is corresponding to each input. Finally, the calculated common input vector is... L The decoded zero-knowledge proof point π (containing three group elements A, B, and C) is structured and packaged to generate a reconstructed verification parameter set, which serves as the direct input object for the subsequent bilinear pairing verification function.
[0059] In the aforementioned smart contract-based automatic payroll system 100, the pairing verification unit 152 is used to perform elliptic curve bilinear pairing verification on the reconstructed verification parameter set using a pre-set verification key and a pre-compiled contract to obtain a Boolean verification result. It should be noted that due to the extremely limited computing resources and high gas costs of the smart contract runtime environment, directly implementing complex elliptic curve bilinear pairing operations in the application layer code would result in extremely high execution costs, even exceeding the block computation limit. Furthermore, the correctness of the verification logic is directly related to the security of on-chain assets; any deviation in arithmetic precision could lead to misjudgment. Based on this, the technical solution of this application further utilizes a pre-set verification key and a pre-compiled contract to perform elliptic curve bilinear pairing verification on the reconstructed verification parameter set to obtain a Boolean verification result. Through the above processing, the deeply optimized cryptographic primitive interface of the blockchain's underlying layer can be effectively invoked to complete high-complexity zero-knowledge proof verification with extremely low computing resources, establishing whether the reconstructed verification parameter set satisfies specific polynomial constraints at the mathematical level, thereby providing a deterministic logical truth value for the final verification result.
[0060] More specifically, in a concrete example of this application, the execution process follows a temporal path from key loading to pairing logic operation. First, the verification key generated during the system trust setup phase is retrieved from the immutable storage area of the smart contract. This key contains a fixed set of elliptic curve group elements, representing the cryptographic fingerprint of the confidential bonus model circuit. Then, the pre-compiled contract interface built into the blockchain node client is called, passing the public input vector from the reconstructed verification parameter set and the computed zero-knowledge proof points, along with the verification key, as input parameters to perform elliptic curve bilinear pairing verification. This verification logic aims to verify whether the following equation holds true:
[0061] in, This indicates the logical judgment result of the verification operation. Let represent a bilinear pairing function defined on the elliptic curve group, which has the property of mapping the discrete logarithmic relation of the elements of two groups to the target group. A, B, and C represent three core elliptic curve points resolved from the computation of zero-knowledge proofs, representing the commitment to off-chain computation. This represents the elliptic curve point parameters in the verification key. L This represents a public input aggregation vector containing payroll business information. If both sides of the above equation are strictly equal mathematically, it indicates that the off-chain payroll calculation process fully complies with circuit constraints and uses the correct private witness data. In this case, a Boolean verification result with a true value is output. Conversely, if the equation is not true, a Boolean verification result with a false value is output, thereby achieving a binary judgment of computational integrity.
[0062] In the aforementioned smart contract-based automatic payroll system 100, the result persistence unit 153 is used to lock and persist the internal state variables of the smart contract in response to a Boolean verification result indicating successful verification, thereby obtaining a verification result flag. It should be noted that, in the execution environment of the blockchain virtual machine, the Boolean value generated by elliptic curve bilinear pairing verification only exists in the temporary call stack memory. If it is not converted into a persistent storage state in a timely manner, the verification conclusion will be lost immediately after the transaction execution ends, and subsequent asset distribution steps require an immutable on-chain credential that can defend against replay attacks as the basis for execution. Based on this, the technical solution of this application further locks and persists the internal state variables of the smart contract in response to a Boolean verification result indicating successful verification, thereby obtaining a verification result flag. Through the above processing, the instantaneous calculation correctness verification can be effectively transformed into a permanent ledger state record, establishing the legitimate status of this payroll calculation on the blockchain timeline, and providing a unique and unforgeable state trigger signal for subsequent atomic payments.
[0063] More specifically, in a specific example of this application, the execution process follows a logical path of conditional branch judgment and state storage writing. First, the Boolean verification result output by the preceding steps is logically evaluated. If the result is false, the exception rollback mechanism is directly triggered to undo all state changes of this transaction and consume the used computing resources. If the result is true, a write operation is performed on the smart contract storage area to locate the predefined mapped state variable. This variable is usually indexed by the unique identifier of this pay batch. Its corresponding numerical state is updated from the default unverified or waiting to verified and locked. At the same time, the height value and timestamp of the current block are obtained and written to the storage slot as supplementary metadata. Finally, an on-chain event log containing the verification success status is generated and broadcast to the outside world, thereby completing the persistence and solidification from the logical truth value to the verification result flag.
[0064] In the aforementioned smart contract-based automatic payroll system 100, the automatic payroll asset distribution module 160 is used to automatically distribute payroll assets according to the mapping relationship in the payroll list in response to a verification result flag indicating successful verification. It should be noted that, due to the irreversible nature of the smart contract execution environment and the fact that asset transfers on the blockchain cannot be rolled back once they occur, a logically verified pass flag does not equate to physical security of fund transfers. Furthermore, open blockchain networks are constantly vulnerable to attacks that maliciously replay verified transactions to steal funds, and the depletion of liquidity in contract accounts can also cause batch payments to fail midway. Based on this, the technical solution of this application further responds to the verification result flag indicating successful verification, automatically distributing salary assets according to the mapping relationship in the payroll list. An atomic verification unit performs execution condition atomic verification on the verification result flag and the payroll list to obtain an approved payment context. A token transfer unit uses the approved payment context to perform mapping resolution on employee identifiers and batch token transfers to obtain a batch transfer completion signal. In response to the batch transfer completion signal, a state reset writing unit performs a forced reset of the verification result flag to prevent replay attacks and triggers an on-chain event log writing operation containing transaction metadata, thereby completing the automatic distribution of salary assets to the target account address. Through the above processing, the logical-level verification and confirmation of rights can be effectively transformed into atomic delivery at the asset level. Through strict pre-condition checks and post-state cleansing, the paths of replay and reentrancy attacks are completely blocked, establishing the security, determinism, and traceability of the payroll disbursement process in the on-chain execution phase.
[0065] More specifically, in a specific example of this application, the automatic salary asset distribution module 160 includes: an atomic verification unit, used to perform conditional atomic verification on the verification result flag and the list of salaries to be distributed to obtain an approved payment context; a token transfer unit, used to perform mapping and parsing of employee identifiers and batch token transfer based on the approved payment context to obtain a batch transfer completion signal; and a state reset writing unit, used to perform a forced reset process to prevent replay attacks on the verification result flag and trigger an on-chain event log writing operation containing transaction metadata in response to the batch transfer completion signal, so as to complete the automatic distribution of salary assets to the target account address.
[0066] Furthermore, the execution process follows a rigorous sequence of atomic operations. First, atomic checks are performed on the execution conditions, reading the verification result flag stored in the contract state. If the flag is true, the sum of all payments in the payroll list is calculated, and the balance of the current smart contract address's liquidity pool is checked to ensure it covers the sum, thus establishing an approved payment context and locking the execution environment. Based on this, mapping resolution and batch token transfers are performed. Each payroll record in the list is traversed, and the corresponding on-chain wallet address is retrieved from the immutable registry maintained internally by the smart contract using the employee's unique identifier. The standard interface of the token contract is then called to execute the asset transfer. The state changes resulting from this process follow the following mathematical model:
[0067] in, This represents the set of all items in the payroll list. k This represents the index of a single employee's salary entry in the set, where t and t+1 represent the blockchain state time points before and after the transfer action, respectively. This function represents the function to query the token balance in a specified address. This indicates that entries are utilized through mapping functions. k The recipient's wallet address is obtained by resolving the employee's unique identifier. Indicates an entry k The amount due recorded in the document. This represents the address of the main smart contract for payroll. Finally, after all transfer instructions have been executed, a state reset and log writing are immediately performed, the verification result flag is forcibly updated to false, and an on-chain event is triggered to record metadata such as the batch number, total amount, and timestamp, thereby completing the closed loop of the entire distribution process.
[0068] In summary, the smart contract-based automatic payroll disbursement system according to the embodiments of this application is explained. First, it utilizes multi-source heterogeneous data cleaning and a group context-aware anomaly detection mechanism to perform high-precision preprocessing of human resources and performance data off-chain, effectively eliminating relative outliers to ensure the purity and rationality of the input source. Subsequently, it executes privacy-preserving payroll model calculations in a secure computing sandbox and simultaneously generates zero-knowledge proofs to verify the correctness of the calculation logic, transforming complex business arithmetic into verifiable cryptographic credentials. Finally, the on-chain smart contract verifies the authenticity of the calculation result by checking the credentials against the publicly available payroll list, without needing to pry into specific calculation details and private parameters, and triggers atomic token transfers accordingly. This achieves automation, reliability, and immutability of the entire payroll disbursement process while protecting privacy data from leakage.
Claims
1. A smart contract-based automatic payroll system, characterized in that, include: The sensitive payroll data aggregation and preprocessing module is used to periodically clean and structure the acquired basic human resources data stream, raw performance data, and company financial data to obtain a payroll calculation dataset containing complete elements within the current payment cycle. The off-chain confidential computation and list generation module is used to perform privacy computation processing on the salary calculation dataset in off-chain computing nodes using a preset confidential bonus model to obtain a plaintext list of salaries to be paid and private witness data containing intermediate calculation values. The zero-knowledge proof generation module is used to generate zero-knowledge proofs based on the confidential bonus model circuit corresponding to the confidential bonus model, using private witness data as private input and the list of unpaid salaries as public input. The payroll verification data on-chain submission module is used to submit the payroll list to be paid along with the zero-knowledge proof to the on-chain payroll verification data in order to obtain a payroll verification transaction. The on-chain smart contract verification module is used to trigger the payroll master smart contract deployed on the blockchain to parse payroll verification transactions, and to perform logical verification of the payroll list to be issued and the zero-knowledge proof to obtain a verification result flag. The automatic payroll asset distribution module is used to automatically distribute payroll assets based on the mapping relationship in the payroll list in response to the verification result flag indicating that the verification has passed.
2. The automatic payroll system based on smart contracts according to claim 1, characterized in that, The sensitive salary data aggregation and preprocessing module includes: The multi-source data cleaning unit is used to clean and normalize the multi-source heterogeneous data stream of human resources, raw performance data and company financial data to obtain normalized basic data package, normalized performance data package and normalized financial parameters. The record association aggregation unit is used to perform left join association processing on the normalized basic data package and the normalized performance data package with the employee's unique identifier as the primary key, and to append the normalized financial parameters as global constants to each record to obtain the primary aggregated record set. The integrity verification unit is used to perform data integrity verification and anomaly cleaning on the primary aggregated record set to obtain a verified payroll record set. The data encapsulation unit is used to perform fixed-point number conversion on sensitive fields in the verified payroll record set and perform serialization encapsulation to obtain the payroll calculation dataset.
3. The automatic payroll system based on smart contracts according to claim 1, characterized in that, The off-chain confidential computation and inventory generation module includes: The vectorization parsing unit is used to perform batch matrix numerical vectorization parsing on the salary calculation dataset using a secure computing sandbox initialized based on a confidential bonus model, in order to obtain the employee feature vector matrix and the in-memory model instance. Iterative computation unit is used to perform iterative computation processing on the employee feature vector matrix, which includes non-linear compensation logic, using in-memory model instances to obtain the full computation trajectory dataset; The result splitting and serialization unit is used to split the full computation trajectory dataset and serialize the witness data to obtain the payroll list and private witness data.
4. The automatic payroll system based on smart contracts according to claim 1, characterized in that, The zero-knowledge proof generation module includes: The mapping assignment unit is used to perform mapping processing on the payroll list to be paid to the public input wire, and to parse and assign the private witness data to the private witness wire of the confidential bonus model circuit to obtain the assigned circuit instance. The constraint checking unit is used to perform R1CS constraint system transformation and satisfaction check on the assigned circuit instance to obtain a valid constraint vector set; The proof construction unit is used to construct elliptic curve pairing proofs on a valid set of constraint vectors using a pre-set proof key to obtain computational zero-knowledge proofs.
5. The automatic payroll system based on smart contracts according to claim 1, characterized in that, The on-chain submission module for salary verification data includes: The encoding and verification unit is used to perform type conversion and splicing encoding processing on the payroll list to be paid and the zero-knowledge proof calculation, and to calculate the integrity verification hash to obtain serialized call data; The signature encryption unit is used to perform signature encryption processing on the original transaction object containing serialized call data and current network status parameters to obtain a signed transaction data block; The broadcast propagation unit is used to broadcast and propagate signed transaction data blocks to the blockchain peer-to-peer network and mempool to obtain payee verification transactions.
6. The automatic payroll system based on smart contracts according to claim 1, characterized in that, The on-chain smart contract verification module includes: The load parsing and reconstruction unit is used to perform load separation parsing on the payroll verification transaction and aggregate the parsed finite field element set into a common input vector to obtain a reconstructed verification parameter set containing the common input vector and the computation of zero-knowledge proofs; The pairing verification unit is used to perform elliptic curve bilinear pairing verification on the reconstructed verification parameter set using a preset verification key and a pre-compiled contract to obtain a Boolean verification result. The result persistence unit is used to lock the state variables of the smart contract and persist the result in response to the Boolean verification result indicating that the verification has passed, so as to obtain the verification result flag.
7. The automatic payroll system based on smart contracts according to claim 1, characterized in that, The automatic distribution module for salary assets includes: Atomic verification units are used to perform execution condition atomic verification on the verification result flag and the list of payrolls to be paid in order to obtain the approved payment context; The token transfer unit is used to map and resolve employee identifiers and transfer tokens in batches based on the approved payment context to obtain a batch transfer completion signal. The state reset write unit is used to respond to the batch transfer completion signal, perform a forced reset process to prevent replay attacks on the verification result flag, and trigger an on-chain event log write operation containing transaction metadata to complete the automatic distribution of salary assets to the target account address.
8. The automatic payroll system based on smart contracts according to claim 2, characterized in that, The integrity verification unit includes: The feature extraction subunit is used to extract group statistical features from the primary aggregated record set to obtain a group statistical feature set. The quality scoring subunit is used to perform context-aware data quality scoring on the group statistical feature set and the primary aggregated record set to obtain the context quality score record set. The dynamic filtering subunit is used to perform dynamic filtering based on context scores on the context quality score record set to obtain the verified payroll record set.