# A Universal Privacy-Preserving Multi-Blockchain Aggregated Identity Scheme
## 3 System Design
### Management of the Authorized Addresses
#### 3.4.1 Map a Wallet Account to a Prime Number  
To prevent falsification of membership proofs, the RSA accumulator requires that the elements are all prime. If an element is not prime (i.e., \(m=pq\)), if \(m\) is in the RSA accumulator, then it will be easy to construct a witness that \(p\) or \(q\) is in the accumulator. Therefore, we need to map the address information to the prime number first.  
The same address can be used for different blockchains; for example, Bitcoin's P2 PKH (Pay-to-PubKeyHash) address starts with the number 1, as shown below:  
\[1A1 zP1e\ldots mv7 DivfNa\]  
This address can be used to receive Bitcoin or Bitcoin Cash. To limit the scope of authorization, a suffix is added to the end of the wallet account to indicate that the blockchain is authorized. For example, the above address for identity authorization on the Bitcoin chain is expressed as:  
\[1A1 zP1e\ldots mv7 DivfNa@BTC\]  
Authorization of an address on both Ethereum and the bnb smart Chain is expressed as:  
\[0x715 cB9B\ldots A89 eEe@ETH@BSC\]  
To support batch authentication of non-custodial wallets compatible with the BIP44 protocol [30], the extended public key can be added to the accumulator as an element. Using the extended public key can only derive the public key of the account, but not the private key, so the extended public key can be disclosed. VASPs can directly derive all wallet accounts corresponding to the user's mnemonic phrase from the extended public key without checking each account. Authorization of the extended public key is expressed as:  
\[xpub6 DDo\ldots 24 hJ@BTC@ETH@BNb\]  
Next, the wallet account information is mapped to a hash value, denoted as _Hex_, using the secure hash function Kecack-256. It takes the first \(l\) characters (including the two prefixes 0x) of the _Hex_, converts it to a decimal number and uses the Miller-Rabin primality test algorithm to determine whether it may be a prime number. If the result is not prime, the new hex is obtained by hashing the previous result as input using Kecack-256. Finally, we will get a prime number. The estimated average number of cycles of the method is \(ln(16^{l-2}-1)\). The above process is shown in Figure 3.  
The Miller-Rabin algorithm detects whether the target is likely to be a prime number by random sampling multiple times. The scheme uses the Miller-Rabin deterministic primality test, where the selection of a specific integer can determine (rather than guess based on probability) whether an integer is prime within a certain range. For \(l=18\), the average runtime for mapping wallet accounts to prime numbers is about 20,000 ms on a computer configured with a 2.3 GHz Intel Core i9 16 GB 2667 MHz DDR4, which is sufficient for security, and the prime number obtained will be less than \(2^{64}\). For cases within \(2^{64}\), [PERSON] finds the best set of test credentials: [2, 325, 9375, 28,178, 450,775, 9,780,504, 1,795,265,022] [31]. The scheme uses these credentials instead of randomly selected credentials. The following Algorithm 7 shows the algorithm.