# Digital Management of Competencies in Web 3.0: The C-Box(r) Approach
## 3 The C-Box(r) Platform
### Business Logic
#### 3.3.1 Notarization Process  
Figure 4 illustrates the process of notarization triggered whenever an issuer wants to deliver a badge to a learner. * From the Web Application, the issuer releases a badge **(1)**, and the application makes an HTTP call to the Web API component to perform _authorization_ (does the user have the right to access this feature?) and _validation_ (can the learner for whom the badge is to be issued receive this badge from this issuer?, etc.) checks **(2)**. * Then, the Web API component instantiates the services necessary for the release **(3)**: specifically, the Assertion Service creates the badge image and saves it in blob storage and creates the necessary database records for the description and Open Badge standards, any files attached to the certification are saved, and a notification email is sent to the learner **(3-5)**. * Following these procedures, the Assertion Service queries the Blockchain Service **(6)** that will take care of the notarization. * This amounts first of all to the creation of the JSON that represents the certification. For this, required data are retrieved from the database **(7)** and from the blob repository **(8)**. This JSON contains the descriptive information of the certification, and the hash of each attachment is made and added to the JSON. * Then, the hash of this JSON is calculated **(9)** and added as an input parameter to the transaction executing the notarization. This transaction is a function of the smart contract (called Notarize), which uniquely associates the assertion identifier with the obtained hash string. * Through the Alchemy RPC service, the gas cost required to mint the transaction is estimated (this value is indeed variable because it depends on the state of the Polygon network). The Blockchain service signs the transaction with the private key of the smart contract owner and sends the transaction again through the Alchemy RPC endpoint **(10)**. * Mind that the time required for the transaction to be mined is variable (and also depends on the amount of gas associated with the transaction). To avoid blocking the user in a process that could also take minutes, the Blockchain Service sends the transaction without worrying about its actual mining **(12)**. Instead, the transaction hash (which uniquely identifies it) is saved to the local database with a \"pending\" status **(11)**. * Asynchronously, Alchemy queues the transaction to its own transaction mempool **(13)**. If for any reason the transaction should be rejected by the network (dropped), a specific webhook is used to notify the C-Box(r) Web API component, which will take care of retrying the transaction. * If instead the transaction is mined **(14)**, Alchemy's webhook service will make an API call to C-Box(r) containing the transaction hash, the actual gas used, the gas cost, and the block number **(15)**. * This information is saved in the C-Box(r) application's cloud database by the Blockchain Service **(16, 17)**. * Finally, through a websocket connection, if the issuer is still connected to C-Box(r), he/she will be informed of the successful notarization of the assertion in the blockchain. Figure 5 describes the process of verifying the integrity of a C-Box digital badge after notarization. * The verification carried out through a notarization check can be performed by any user (Verifier) by consulting the dedicated verification section on the C-Box portal **(1)**. Figure 4: Notarization of an Open Badge released by an issuer organisation. * The C-Box Web application queries the API application, which through the Assertion service retrieves from the database all the data necessary for verification and page display **(2, 3)**, such as the smart contract address or the assertion's identification code. * The Verifier user can then use a Polygon block explorer or directly use the verification page to interact with the getAssertionUri function of the Notarization Smart Contract **(4)**.