# Offline Payment of Central Bank Digital Currency Based on a Trusted Platform Module
## 3 Methodology
### Offline CBDC Model Protocol
Assuming that token_A\({}_{O2}\) originated from a token that was traded once in an offline transaction, the value of 'cbSta' will be O2. The transaction number, 'cbRt', was recorded as 712, and this token also reflects the current counter value of Alice's TPM. It was received from a transaction with Ann, whose counter value, 'cbEctn', was 39 at the time of the transaction, and token_A02 is validated by Ann's digital signature. Similarly, if we assume that token_A04 originated from a token that was traded offline three times, the value of 'cbSta' would be O4. This token is guaranteed by Chan, whose TPM counter was 42 at the time of the transaction. In order to provide a more comprehensive understanding of the transaction process, Alice and Bob first engage in the offline CBDC wallet program and choose the appropriate function from the on-screen menu. Alice will designate herself as the 'Sender', whereas Bob will identify himself as the 'Receiver'. Alice and Bob subsequently position their devices in close proximity to establish a secure short-range wireless communication link, utilizing technologies such as Bluetooth or NFC. Upon successful establishment of this communication, Bob's offline CBDC wallet transmits his current TPM counter number along with a random number to Alice's offline CBDC wallet. All transmitted values are digitally signed, and Bob's ID certificate, which includes the signature verification key, is sent to facilitate the signature verification process. Following this, Alice's wallet verifies the received data and displays Bob's ID and the input box for the remittance on the screen. After Alice confirms Bob's ID and inputs the desired amount, USD 60, her wallet requests an increment of the counter and a random number from the TPM_A. Upon receipt of the increased counter and random number from the TPM_A, Alice's wallet generates two tokens based on this information. The first token, referred to as Token_t, represents Alice's balance and is valued at USD 40. As this is a temporary token, the value of 'cbSta' is designated as \(\mathrm{T_{P}}\). The transaction number (\(\mathrm{R_{T}}\)) is computed by Alice's wallet in accordance with the established calculation rules to derive the value 'cbRt'. The \(\mathrm{R_{T}}\) is calculated according to step 9-2, as follows:  
\[\mathrm{R_{T}}=[\ \{\mathrm{R_{1}}(0)+\mathrm{R_{2}}(712)+\mathrm{R_{3}}(39)+ \mathrm{R_{B}}(7721)+\mathrm{R_{A}}(512)+\mathrm{C_{A}}(15+1)+\mathrm{C_{B}}(98 1)\}\ mod\ \mathrm{R_{A}}(512)]+\mathrm{R_{A}}(512)=765 \tag{1}\]  
The incremented value of Alice's TPM counter is denoted as 'cbOtcn' (16). The second token, referred to as Token_B05, serves as the remittance token, with the value 'cbSta' assigned to O5, as the maximum value of the input tokens' 'cbSta' is O4. The transaction number (\(\mathrm{R_{T}}\)) also corresponds to the temporary token. Since the ownership of this token  
Figure 5: Example of a complete offline payment process. will be transferred to Bob, it includes Bob's ID and his current TPM counter number. Both tokens are signed by Alice's TPM and transmitted to Bob's wallet, accompanied by Alice's ID certificate and all input tokens. Bob's wallet verifies each value, including signatures, transaction number (R\({}_{\text{T}}\)), counter number, and others. It subsequently updates the 'cbSta' value of the temporary token (Token_t) from T\({}_{\text{p}}\) to O5 and removes Alice's signature. Following this, Bob's wallet displays the amount \"T\", USD 60, on the screen. Upon Bob's confirmation, the token, designated as Token_B\({}_{\text{O5}}\), is stored in his wallet. Additionally, Bob's wallet requests the TPM_B to sign the revised temporary token value (derived from Token_t). Once the wallet receives the signed token, it finalizes Alice's balance token, referred to as Token_A\({}_{\text{O5}}\), and sends it back to Alice's wallet. When Alice's wallet displays the updated remaining balance on the screen, USD 40, she confirms the transaction, and the token is subsequently stored in her wallet.