1. Introduction
In The Report on the Work of the Government, it was emphasized that “Striving to modernize the industrial system and developing new quality productive forces at a faster pace.” [
1]. To promote the development of new quality productivity, it is necessary to give full play to the multiplier effect of data elements, such as the multiplicative interaction between data elements and scientific and technological innovation [
2], which are typically represented by digital technologies such as big data, blockchain, cloud computing, and artificial intelligence. Blockchain is a distributed bookkeeping technology maintained by multiple parties, utilizing a cryptographic chained block structure to verify and store data and automated script code (smart contracts) to program and manipulate data [
3]. Since Satoshi Nakamoto [
4] first proposed blockchain technology in 2008, after more than ten years of development, its application fields have become extensive. Swan [
5], in the book “Blockchain: A Blueprint for the New Economy”, states that the application of the blockchain is defined as three-tiered: blockchain 1.0–3.0. The technology has increasingly garnered significant attention from various countries. In recent years, China has also issued several white papers regarding the development of blockchain technology. For instance, in 2023, the Academy of Information and Communications Technology released the Blockchain White Paper (2023) [
6], which primarily provides an overview of the development of blockchain in the international and domestic contexts, the development of blockchain technology, its applications, regulatory frameworks, as well as the challenges and outlooks of blockchain development of China, among other topics.
There is no national security without network security, and the importance of cryptography as the core underlying technology of blockchain is self-evident. China has introduced and announced some independently designed cryptographic algorithms in recent years, such as the SM2, the SM4, the SM9 [
7], and other state secret algorithms, which have been successfully selected as international commercial cryptographic standards with a high degree of security and controllability, which is of great significance for safeguarding China’s national information security. However, China’s blockchain technology is still in its infancy, and the application areas must continue to be explored, researched, developed, and improved.
At present, the majority of cryptographic algorithms are based on the PKI [
8] system, such as the Rivest–Shamir–Adleman (RSA) algorithm, the ECDSA, and the ElGamal Cryptographic Algorithms (EGCA) and SM2 algorithm. The PKI system encryption process is shown in
Figure 1.
On the contrary, the SM9 algorithm is based on the IBC system [
9]. The IBC system encryption process is shown in
Figure 2. A comparison of the differences between the PKI and IBC systems is shown in
Table 1.
The security of the SM9 algorithm mainly relies on the elliptic curve discrete logarithm puzzle and some problems of bilinear pairs, with a level of security equivalent to the security strength of RSA-3072 bits [
10], which is resistant to Baby-Step Giant-Step (BSGS) algorithm attack, Pollard’s Rho algorithm attack, and Miyaji–Ochiai–Vanstone (MOV) attack [
11], thus ensuring the security of the algorithm during its use. Moreover, the SM9 algorithm authentication process mainly uses the Challenge Handshake Authentication Protocol (CHAP) in challenge/response mode, which is resistant to Trojan horses, password dictionaries, and other attacks [
12].
In blockchain systems, blockchain addresses play a crucial role, functioning similarly to bank accounts in the real world. They are primarily used to identify users and facilitate value transfers. Therefore, generating secure and efficient blockchain addresses is of great significance for the stable operation and widespread application of blockchain systems.
Foreign blockchain address generation methods mainly fall into two categories: those based on Elliptic Curve Cryptography (ECC) and those based on hash functions. Regarding the first approach, the traditional Bitcoin address is the Pay-to-Public-Key-Hash (P2PKH) address, which starts with the digit 1. Both Bitcoin’s P2PKH addresses and Ethereum addresses are generated by using the secp256k1 elliptic curve of the ECDSA algorithm. The process involves generating a public key from a private key and then performing a hash operation on the public key [
13]. The advantage of this method lies in the simplicity of the generation process and good compatibility. However, its drawback is that the generation of blockchain addresses relies on the user’s public–private key pair generated by a specific elliptic curve, and once the private key is lost, the user’s assets cannot be retrieved.
The second method is mainly adopted by the Bitcoin Pay-to-Script-Hash (P2SH) addresses, which start with the digit 3. To generate these addresses, the Secure Hash Algorithm 256-bit (SHA-256) algorithm and the RACE Integrity Primitives Evaluation Message Digest 160-bit (RIPEMD-160) algorithm are used successively to perform hash operations on the Redeem Script to obtain a hash value, which is then encoded using BaseCheck58 to obtain the final address [
14]. This method supports more complex transactions and scripts and offers higher security. Nevertheless, it is more complicated to create and manage compared to P2PKH addresses.
In China, the Chain Maker [
15] serves as a reference for blockchain address generation. It is mainly applied in domestic financial and government affairs fields, where high requirements for information security and compliance are imposed. In the Chain Maker, the generation of user blockchain addresses begins with the generation of the Subject Key Id (SKI) based on the user’s public key, which is an identifier used in X.509 certificates to uniquely identify the user’s public key and is employed for the quick search and verification of the public key in the certificate and public-key management systems. Subsequently, the keccak256 algorithm is used to perform a hash operation on the SKI, and the last 20 bytes of the hash value are truncated to obtain the address. This address generation method is essentially based on ECC and is, by default, the same as Ethereum’s address algorithm.
In the original SM9 algorithm, the user holds two pairs of public and private keys, which are used for digital signatures and encrypted communication; it is not very convenient for the user to use in practice, which requires remembering and storing the two private keys, and they must be used separately for each situation. Therefore, based on the high security of the SM9 algorithm, the advantages of the IBC system, and considering the practical needs of users, this paper proposes a blockchain address generation method based on an improved SM9 algorithm. The improved SM9 algorithm enables users to complete operations such as signing, encryption, and decryption with only one pair of public–private keys.
3. Design Method
3.1. Blockchain Address Generation Process in Ether
At the present time, the blockchain applies the ECC algorithm to randomly generate the corresponding private key for each node, generate the corresponding public key after the elliptic curve, and generate the user blockchain address [
22]. A blockchain address is a digital identifier that receives and sends cryptocurrencies in a blockchain network. Depending on the blockchain network used and its purpose, it can be categorized into a Bitcoin address, an Ethereum address, a contact address, etc. The following section focuses on generating the user’s private key, public key, and account address in Ether.
A pseudo-random number generator first generates a 256 bit random number as the user’s private key.
Using the elliptic curve digital signature algorithm ECDSA-secp256k1, the user’s private key is mapped to a 65 byte public key. The selected curve equation is
y2 =
x3 + 7 [
23].
The 32 byte user public key hash is calculated using the Keccak-256 hash algorithm.
Finally, the last 20 bytes of the above hash value are taken as the user’s account address.
The generation process is shown in
Figure 3.
3.2. The Improved SM9 Algorithm
The improved SM9 algorithm synthesizes two pairs of system master keys and two pairs of user keys generated by the original SM9 algorithm into a pair of system master keys and a pair of user keys, respectively. The system parameters used in the improved SM9 algorithm are consistent with those used in the original SM9 algorithm.
In the original SM9 algorithm, the system’s signing master public key and encryption master public key are in two additive cyclic groups, G2 and G1, respectively. If two pairs of public–private keys of a user are combined into one pair, it is necessary to first merge the system’s two master private keys into one. First, a random number generated by the Key Generation Center (KGC) is used as the system’s master private key (no distinction is made between the system’s signing master private key and the encryption master private key). Then, the system’s master public key is obtained from the system’s master private key (no distinction is made between the system signing master private key and the encrypting master private key here). The improved SM9 algorithm is used to place the system’s master public key in group G1. Finally, according to the method of user key generation in the original SM9 algorithm, two pairs of user’s public–private keys can be synthesized into one pair of public–private keys (no distinction is made between the user signing and encrypting keys). The user’s private key is in group G2 and the user’s public key is in group G1. The specific implementation process is as follows:
The KGC first randomly selects an integer SS in the interval [1, N − 1] as the master private key of the system. Subsequently, KGC computes the point PS = SS·P1 in the group G1, where P1 is the generator element of the additive cyclic group G1, and uses PS as the master public key of the system. In this process, P1, P2, and PS are public, while SS must be kept secret.
The KGC selects a private key generation function identifier hidden for each user, which can be represented by a single byte. Let the identifier of user A be IDA. The KGC first computes t1 = H1(IDA||hid, N) + SS over the finite field FN, where H1 is a hash function. If the computed t1 is equal to 0, the KGC must regenerate the master private key and update the master public key as well as the private keys of all generated users. In case t1 is not equal to 0, the KGC continues to compute t2 = SS·t1−1 (here, t1−1 denotes the multiplicative inverse element of t1 in the modulo N sense) and then computes user A’s private key SA = t2·P2, where P2 is the generating element of the additive cyclic group G2. Also, the public key QA = H1(IDA||hid, N) P1 + PS for user A is computed and makes QA public, while the private key SA must be kept secret.
Let bit string
M sign the message. Algorithm 1 shows the specific algorithmic procedure for user A to obtain message
M digital signature (
h,
S).
Algorithm 1: The improved SM9 signature generation algorithm. |
Input: System parameters, System master public key PS, Message M, Private key SA Output: Signature Value (h, S)
- 1.
g: = e(Ps, P2) - 2.
r: = Random([1, N−1]) - 3.
w: = gr - 4.
h: = H2(M||w, N) - 5.
L: = (r-h) mod N - 6.
while L==0 do - 7.
r: = Random([1, N−1]) - 8.
w: = gr - 9.
h: = H2(M||w, N) - 10.
L: = (r-h) mod N - 11.
end while - 12.
S: = [L]·SA - 13.
return (h, S)
|
User B uses the following Algorithm 2 to verify the integrity of message
M′ and its digital signature (
h′,
S′), as shown below:
Algorithm 2: The improved SM9 signature verification algorithm. |
Input: System Parameters, System Master Public Key Ps, Message M′, Public Key QA Output: Verification Successful or Verification Failed
- 1.
if h′∈[1, N−1] then - 2.
if S′∈G2 then - 3.
g: = e(Ps, P2) - 4.
t: = gh′ - 5.
u: = e(QA, S′) - 6.
w′: = u·t - 7.
h: = H2(M′||w′, N) - 8.
if h = h′ then - 9.
return Verification Successful - 10.
else - 11.
return Verification Failed - 12.
end if - 13.
else - 14.
return Verification Failed - 15.
end if - 16.
else - 17.
return Verification Failed - 18.
end if
|
3.2.1. Correctness Proof of the Improved SM9 Algorithm
In the user B verification process, it is necessary to check whether
h2 =
h′ is equal or not because
h2 =
H2(
M′||
w’, N) and
h′ =
H2(
M||
w, N), so it can be transformed to check whether
w =
w’ is equal or not. The proof process is as follows:
3.2.2. Comparison Between the Original SM9 Algorithm and the Improved SM9 Algorithm in Different Aspects
In the original SM9 algorithm, two distinct pairs of system master public–private key pairs are generated. One pair is specifically dedicated to system signing, with the system signature master private key being 32 bytes in length and the corresponding system signature master public key being 128 bytes long. Similarly, the other pair is intended for system encryption, where the system encryption master private key also measures 32 bytes, and the system encryption master public key spans 64 bytes. The improved SM9 algorithm generates a pair of system master public and private keys. Specifically, the system master private key has a length of 32 bytes, while the system master public key measures 64 bytes.
In the original SM9 algorithm, two separate pairs of user public–private key pairs are generated. One pair is designed specifically for user signature, with the user signature private key being 64 bytes in length and the corresponding user signature public key being 128 bytes long. The other pair is for user encryption, where the private key measures 128 bytes and the public key is 64 bytes. In stark contrast, the improved SM9 algorithm generates a single pair of user public–private keys. The user private key measures 128 bytes, and the user public key is 64 bytes.
Using the original SM9 algorithm, the signature values h and S have lengths of 32 bytes and 64 bytes, respectively, while the encrypted ciphertext value has a length of 97 bytes. In contrast, with the improved SM9 algorithm, the lengths of the signature values h and S are 32 bytes and 128 bytes, respectively, and the length of the encrypted ciphertext value remains 97 bytes.
Figure 4 shows the process of generating system and user public and private keys based on the original SM9 algorithm, along with its corresponding application scenarios.
Figure 5 illustrates the process of generating system and user public and private keys based on the improved SM9 algorithm, along with its corresponding application scenarios.
3.2.3. The Blockchain Address Generation Method Based on the Improved SM9 Algorithm
Referring to the above process of generating the user’s account address in Ether, this scheme uses the improved SM9 algorithm to generate the user’s public and private key and account address in the following steps:
KGC generates a 256 bit (32 byte) random number as the system master private key through a pseudo-random number generator.
The system master private key is obtained by selecting a BN curve with a parameter of 256 bits, whose equation is
y2 =
x3 + 5 [
16]. Then, a 512 bit (64 byte) system master public key is obtained based on other system parameters.
The system master private key obtains a 1024 bit (128 byte) user private key through user identification and other system parameters. The private key is used for transaction signing, asset management, and encrypted communication.
The system master public key obtains a 512 bit (64 byte) user public key through user identification and other system parameters.
The user public key calculates a 256 bit (32 byte) hash value through the state secret SM3 algorithm [
24].
Take the last 20 bytes of the hash value as the blockchain address.
The specific process is shown in
Figure 6 below:
3.3. Security Analysis of This Program
In blockchain, it is crucial to ensure the security of the user’s private key because it is directly related to the security of the user’s assets. In the original SM9 algorithm, the user’s private key is calculated by the system master private key based on the user’s identity and system parameters; assuming that the private key of user A is
SA and the identity is ID
A, then the formula for calculating the private key of A is as follows.
It is known that the public key hash can be derived from the user’s public key. However, the public key cannot be reverse-derived from the public key hash, which is guaranteed by the properties of the hash function: unidirectionality, weak collision, and strong collision [
25]. The user’s account address is obtained by taking the last 20 bytes of the public key hash, so the public key cannot be inferred from the account address. Additionally, the user’s identity uniquely determines the user’s public key.
It is challenging for a third-party attacker to calculate the private key of user A by utilizing the public key of user A, the system master public key, and the system parameters when the user keeps his private key secret. The security of the SM9 algorithm is based on the elliptic curve discrete logarithmic puzzle, which satisfies the computational security [
26], thus ensuring the security of the user’s private key and assets.
Their relationship is shown in
Figure 7.
4. Results
This experiment mainly focuses on the comparative study of the signature and verification time of messages of different lengths, the length of the generated user public and private keys and signature values, and the generation time of the user account address. Specifically, in terms of signing and verification time, the improved SM9 algorithm is compared with the original SM9 algorithm, the 381 bit-parameter Barreto–Lynn–Scott 12 (BLS12-381) algorithm, the SM2 algorithm, and the Schnorr digital signature algorithm (Schnorr algorithm) for messages of different lengths; in terms of the length of the generated user’s public–private key and signature value, the improved SM9 algorithm is compared with the ECDSA algorithm, the BLS12-381 algorithm, the SM2 algorithm, and the Schnorr algorithm; the improved SM9 algorithm is compared with the ECDSA algorithm in terms of account address generation time. In addition, the name of the manufacturer of the device running this software is Lenovo, and the city where it is sourced is Zhengzhou, China. The test environment used in this experiment is described below.
Processor: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz 2.11 GHz;
Memory: 16.0 GB;
Operating System: 64 bit operating system, x64-based processor;
Compilation environment: Visual Studio Code 2024, Version: 1.89.
4.1. Efficiency Analysis
4.1.1. A Comparison of the Signing and Verification Times of the Improved SM9 Algorithm with the Original SM9, SM2, BLS12-381, and Schnorr Algorithms
To evaluate the performance of the improved SM9 algorithm in terms of signature generation and verification across varying message lengths, experiments were conducted in this study for message lengths of 256 bytes, 512 bytes, 1024 bytes, and 2048 bytes. For each specified message length, the experiments were independently repeated five times, and the average results from these five trials were calculated to ensure the stability and reliability of the findings. Furthermore, this paper compared and analyzed the performance of the improved SM9 algorithm with the original SM9 algorithm, the BLS12-381 algorithm, and the Schnorr algorithm. The experimental results for signature and verification are shown in
Figure 8 and
Figure 9, respectively.
The results clearly indicate that, in descending order of time taken for signing messages of varying lengths, the algorithms are as follows: the original SM9 algorithm, the BLS12-381 algorithm, the improved SM9 algorithm, the SM2 algorithm, and the Schnorr algorithm.
During the signature generation process, the original SM9 algorithm necessitates both dot product operations and pairing operations on an elliptic curve. The high computational complexity associated with the pairing operation significantly contributes to the longest signing duration. In contrast, the BLS algorithm primarily involves dot product operations on an elliptic curve. The utilization of the optimized BLS 12-381 elliptic curve enhances the efficiency of the dot product operations, thereby reducing the signing time.
The improved SM9 algorithm builds upon the original SM9 algorithm, enabling users to possess a pair of public and private keys for both signature and encryption functionalities. Additionally, optimizations in code implementation, such as the Miller loop, constant t modulo power operation, multiplication by a large integer, and modulo inverse operation, result in a shorter signing duration compared to the original SM9 algorithm.
The SM2 algorithm involves elliptic curve dot product operations and hash functions in its signature generation process. Due to optimizations in its implementation efficiency, the SM2 algorithm exhibits a relatively shorter signing time.
Finally, the Schnorr algorithm primarily entails a dot product operation and a modulus operation, possessing the lowest computational complexity and consuming the least time among the algorithms examined.
During the signature verification process for diverse messages, each algorithm entails computations similar to those involved in its signature generation phase. The BLS12-381 algorithm and the original SM9 algorithm continue to exhibit longer processing times, whereas the improved SM9 algorithm, the SM2 algorithm, and the Schnorr algorithm demonstrate shorter processing durations.
4.1.2. A Comparative Analysis of Time Efficiency in User Account Address Generation Using the Improved SM9 Algorithm and the ECDSA Algorithm
The ECDSA algorithm combined with the Keccak-256 hash algorithm generates the user account address, and five experiments were conducted to test the time required for its generation. The start time of the timing was the generation of the user’s private key, and the end time was the generation of the user account address. Because the user’s public key is generated by combining the user’s private key with the system parameters, the starting time of the timer was the generation of the user’s private key.
The user’s account address was generated using the improved SM9 algorithm and combined with the SM3 algorithm. Five experiments were conducted to test the time required for its generation. The starting time was the generation of the user’s public key, and the ending time was the generation of the user’s account address. Because the user’s identity generates the user’s public key and the system master public key combined with the system parameters and has no direct relationship with the user’s private key, the starting time was the generation of the user’s public key.
The experiment’s results are shown in
Table 2 below.
The experiment’s results are shown in
Figure 10 below.
It was calculated that the average time taken to execute the ECDSA algorithm is 3169.3µs, whereas the average time for the improved SM9 algorithm is 4083.7 µs. The execution time of the improved SM9 algorithm is 1.29 times longer than that of the ECDSA algorithm. This is because using the improved SM9 algorithm involves two elliptic curve dot product operations and one hash operation when generating the user blockchain address, whereas using the ECDSA algorithm involves one elliptic curve dot product operation and one hash operation. It is worth noting that the length of the user account address generated by the improved SM9 algorithm is equivalent to that generated by the ECDSA algorithm.
4.2. Comparison of Spatial Storage
Table 3 presents the experimental results obtained by comparing the lengths of the generated user public key, private key, and signature value using the improved SM9 algorithm, the SM2 algorithm, the ECDSA algorithm, the BLS12-381 algorithm, and the Schnorr algorithm.
The results indicate that the length of the user private key generated by the improved SM9 algorithm is four times greater than that produced by the other algorithms considered. Additionally, the length of the user public key generated by the improved SM9 algorithm is approximately 1.3 times longer than that generated by the BLS12-381 algorithm, twice as long as that produced by the Schnorr algorithm, and equivalent to the lengths generated by the SM2 and ECDSA algorithms. Furthermore, the length of the signature value produced by the improved SM9 algorithm is 2.5 times longer than those generated by the SM2, ECDSA, and Schnorr algorithms, and approximately 1.6 times longer than that produced by the BLS12-381 algorithm.
4.3. A Comparison of Security and Applicable Scenarios Among the Improved SM9, BLS12-381, SM2, and Schnorr Algorithms
The security of the SM9 algorithm is grounded in the q-strong Diffie–Hellman (q-SDH) assumption, which underpins its Existential Unforgeability under Chosen Message Attack (EUF-CMA) in the random oracle model, and this enables it to effectively withstand forgery attacks and ciphertext attacks [
27]. The SM9 algorithm encompasses functionalities such as encryption, signing, key exchange, and key agreement. A notable advantage is its certificateless nature, which reduces the complexity and cost of certificate management, making it suitable for scenarios requiring identity-based encryption (IBE) and multi-party signatures.
The SM2 algorithm, whose security is based on the elliptic curve discrete logarithm problem (ECDLP), is resilient against forgery signature attacks, key replacement attacks, and white-box attacks [
28]. It offers functionalities including digital signatures, public key encryption, and key exchange, and is particularly suited for smart cards and resource-constrained devices. In sectors with high demands for autonomy and control, such as national government affairs and finance, the use of national cryptographic algorithms SM9 and SM2 aligns with national security requirements.
The BLS12-381 algorithm derives its security from both the ECDLP and the hardness of computations involving bilinear pairings. It is capable of resisting forgery signature attacks and chosen message attacks [
29]. The BLS algorithm boasts short signature lengths and efficient verification processes, along with robust aggregability, rendering it ideal for scenarios requiring extensive signature verification, such as blockchain applications.
The Schnorr algorithm, whose security rests on the discrete logarithm problem over elliptic curves, is resilient against forgery signatures, chosen message attacks, side-channel attacks, and replay attacks [
30]. It distinguishes itself with the shortest signature length and minimal computational overhead for both signing and verification, while also supporting signature aggregation. This makes it well suited for scenarios demanding efficient signing and verification processes.
6. Discussion
The application of the SM9 algorithm, which is based on the IBC system, for generating blockchain addresses holds promise in critical sectors such as national government affairs and finance. This approach facilitates enhanced identity management and information security assurance. For example, on blockchain platforms designed for data sharing and business collaboration among government departments, the SM9 algorithm can generate addresses and perform identity authentication using unique identity identifiers for each department. This eliminates reliance on external certificate authorities and enhances the security and trustworthiness of the information exchanged. Furthermore, the improved SM9 algorithm can be utilized for signature verification of user transactions and encrypted communication among users within the blockchain. This will effectively promote the widespread adoption of China’s national cryptographic algorithm series in the blockchain domain, gradually reducing dependence on foreign cryptographic algorithms. By doing so, it can mitigate security risks associated with potential backdoors in foreign algorithms and trust issues related to certificate authorities, thereby strengthening national information security autonomy and protecting the public’s information security.
However, in the context of the IBC system, the user’s private key is generated by the KGC. If the KGC is attacked or compromised, the security of the entire system will be severely jeopardized, posing a key escrow issue. Additionally, the signing and verification processes of this algorithm are typically more complex than those of traditional algorithms, such as the ECDSA, resulting in slower processing speeds. To enhance performance, the optimization of the bilinear pairing computation algorithm or the adoption of hardware acceleration technologies (e.g., GPUs, FPGAs) can be considered. Finally, integrating the IBC algorithm into existing blockchain systems may necessitate modifications to the existing protocols, which could lead to compatibility issues. Therefore, corresponding work needs to be carried out to ensure the maturity and standardization of the IBC system’s algorithms.