## 4 Implementation
### Smart Contract
In the implemented system, minimal interaction both from game developer and users is required. Wallets need to be generated using available tools. Users can choose from many available wallets, depending on the used blockchain. Otherwise, game developer can decide to provide their own solution. Additionally some native tokens should be purchased in order to cover transaction fees. While this could be mitigated by moving custody of the wallet into the cloud and managing it from game developer perspective, this would highly impact the desired fault tolerance, especially on the line between user and game developer. Figure 6: Opening of a booster pack (**left**) and details of a selected asset (**right**). To validate the economic viability of the system, the estimated cost of operation was calculated. Firstly, the average required gas amounts for the prepared implementation were verified. The results are presented in Table 2. Then, the gas price for several blockchains was compared using publicly available tools [39; 40] (Table 3) to calculate final transaction cost on different platforms (Table 4). The results are estimates, as there are many dynamically changing factors. The gas price is paid in blockchain native currency and can change multiple times per second. The price of native tokens is subject to dynamic changes too. The data uses estimates as it is only purpose is to estimate the economic viability of the protocol. The choice of compared blockchain platforms used the following criteria:

* Native EVM support--to avoid additional third-party fees;
* Major NFT platforms support--in order to ensure ease of use for end user. \begin{table}
\begin{tabular}{l c} \hline \hline
**Operation** & **Gas Cost** \\ \hline Contract initialization & 2,291,501 \\ Game registration within the system & 49,242 \\ Collection registration within a game & 93,230 \\ Claiming booster of 15 cards & 213,904 \\ Transfer of token & 57,293 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Gas required to run operations. \begin{table}
\begin{tabular}{l c} \hline \hline
**Chain** & **Gas Price** \\ \hline Ehhereum & USD 3.28571 \\ Polygon & USD 0.00405 \\ Arbitrum & USD 0.00443 \\ Optimism & USD 0.00034 \\ Avalanche & USD 0.10000 \\ Base & USD 0.00104 \\ Binance Smart Chain (BSC) & USD 0.07143 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Gas price in USD/100,000 gas (as of 22 November 2024). Figure 7: Collected cards listed properly on Opensea marketplace. The gas cost in the EVM is deterministic and should always be the same for the same operation. The results for the system differed slightly as there are several factors that could impact the final price. The first token for a given wallet will be slightly more expensive as some data need to be set up in the contract. On the other hand, obtaining another copy of an already-owned token will be slightly cheaper. The average used was calculated assuming the worst case scenario--a fresh wallet with no repeated tokens. The system was deployed to Optimism network, which is an Ethereum layer 2 solution. Layer 2 solutions highly reduce the cost of operation for a smart contract. Choosing Ethereum provided a wide range of available tools and services that are mature and compatible with Ethereum standards. This choice allowed verification of two aspects of the system. The economical viability and interoperability. The data shows that aside from the Ethereum mainnet, which would incur high costs for end users, the system is economically viable. The cost of securing 15 card boosters on many viable platforms does not reach one cent. Also, the transfers, which are used in trading of assets, go higher than a cent only on Ethereum. It has also been verified that the system is still fully usable even with the system operator and game developer services turned off. The Opensea platform can be replaced by its counterparts, such as Rarible, or completely skipped and data resolved manually. The system was confirmed to provide the same level of ownership that the physical medium provides.