2.4.1. Ethereum Keystore
Ethereum Keystore is a means of authenticating oneself for a specific Ethereum address, and it is a file that encrypts Private Key with Passphrase [
14,
15]. To obtain a Private Key, one must know both the Keystore file and the Passphrase, and for usability purposes, the Private Key is not directly exposed and instead, the Keystore and Passphrase combination is used to create a secure standard for transactions [
16].
The Ethereum platform generates a Private Key and a Public Key using the ECDSA (Elliptic Curve Digital Signature Algorithm). The passphrase is encrypted using a one-way cryptographic algorithm called “Scrypt” to generate a Derived Key, as shown in
Figure 1 [
17].
For the decryption of the Private Key, it is encrypted using the AES algorithm as shown in
Figure 2 and then it needs the generation of Cipher Text.
The MAC for verifying whether the user-input Passphrase matches is stored in the keystore by concatenating the last 16 bytes of the Derived Key (32 Bytes) with the Cipher Text and hashing the result using the SHA3-256 hash function, as shown in
Figure 3.
The resulting keystore file created in this way is shown in list 1.
To decrypt the keystore, you must first verify that the entered passphrase is correct. Based on the entered passphrase, a new Derived Key and MAC are generated and checked for a match with the MAC within the keystore. If a match is confirmed, the new Derived Key, Cipher text, and cipher parameters information within the keystore are input into the AES decryption algorithm to decrypt the ciphertext into the private key, as shown in
Figure 4 [
18].
2.4.2. Symverse
Symverse is a layer-1 blockchain platform with one-second block finality based on self-sovereign distributed identities, using the SYM coin [
19]. It uses a unique 10-byte ID system with an ID document which contains 20-byte Public Key Hash used as an address and a 10-byte ID system consisting of a network identifier (SymID, 2 bytes), CitizenID (6 bytes), and account identifier (2 bytes). Symverse is a collaborative blockchain service that can be extended to independent blockchain platforms based on the Symverse platform. Its block creation method is an enhanced BFT (Byzantine Fault Tolerant) appling strategic voting theory and PoS (Proof of Stake) to achieve fast block finality [
11].
SCT (Symverse Contract Template) is a template protocol designed to make it easy to create and operate smart contracts within the Symverse blockchain [
20]. In the case of Ethereum, the ERC-20 protocol allows you to write a smart contract with Solidity and register it on the blockchain through a transaction, and operate the smart contract through the EVM [
20], but in Symverse, SCT-20 is a template that provides standard inputs and outputs as shown in
Table 3 to easily create a token smart contract on the blockchain with data type JSON via RPC. To create an SCT contract, use the SCT_CREATE Function in
Table 4 and pay the transaction fee of 0.8049 SYM coins. The SCT contract generates a transaction using the RLP (Recursive Length Prefix) encoded value of array (“0x14”, 0, array (“SYMBOL NAME”, “SYMBOL”, convertEth2WeiHex(10000000000, 18), SymID)) in the input parameter of
Table 5, converted to Hex, and sends it to the Symverse blockchain to create a token smart contract. To transfer the generated token, we use the SCT_TRANSFER function in
Table 3 and set the gasPrice in
Table 4 to 7,000 to transfer the token.
A transaction is an act of recording a ledger in a block on the blockchain, and once a transaction is recorded, it cannot be modified or deleted. In Symverse, transactions include normal transaction behavior, SCT transactions, and Deposit transactions [
17]. The data required for a transaction is shown in
Table 5.
The transaction of general transaction behavior is to transfer SYM coins, SCT transaction is to transfer smart contracts, and Deposit transaction is for interest distribution. The gas consumed by a transaction is calculated by the following formula.
The gas consumed in a transaction is calculated by the following formula.1:
Formula 1. Calculate consumed gas.
Consumed Gas is calculated as the base gas rate (base_gas) set in the blockchain plus the number of non-zero bytes of input_data*680, and the number of zero bytes*40 plus the contract operation gas rate.
The token transfer transaction (1) prepares a private key corresponding to the sender’s SymID, (2) retrieves the recent transaction nonce in the SymID’s blockchain, and (3) prepares the raw transaction data as follows.
a. Add 1 to the recent transaction nonce. b. Prepare
$input = array (“0x14”, “0x1”, array(“Receiver SymID”, convertEth2WeiHex(1000000000, 18))) to be used as transaction input and prepare, RLP-encode the sct_data d.Prepare the transaction data.
$tx_req = array (“from” => “Sender SymID”,”to” => “Contract ID”,”gasLimit” => bcdechex(2000000), “gasPrice” => bcdechex(100000000000), “value” => 0x0, “nonce” => LatedNonce+1, “type” => “1”, “workNodes” => array(“Work Node SymID”), “input” => “0x”.RLP(sct_data)) e. Sign the transaction data. (4) Send an RPC from the signed data as a JSON data type.
$param_arr = array (“jsonrpc” => “2.0”, “method” => “sym_sendRawTransaction”, “params” => array(
$tx_raw), “id” => 1) Use the returned transaction hash to get a transaction receipt to check if the transaction was processed successfully. You can see the transaction processing flow in
Figure 5.
The next chapter will introduce the details and architecture of the system proposed in the thesis, and the various modules that address the problems discussed in this chapter. We will also provide an evaluation of the system’s performance, security, and usability, demonstrating its potential to provide a comprehensive solution for non-face-to-face financial transactions.