# Towards a New Business Model for Streaming Platforms Using Blockchain Technology
## 4 Proposed Solution
### Automatic Smart Contract Generation Service  
One of the main features and key points of our computing solution is the specification of a service to automatically generate a smart contract for each video uploaded by the content creator. All data exchanges between the middleware and the streaming platform can be protected with asymmetric encryption. It should be noted that the application of encryption to smart contracts makes it difficult to gain unauthorized access to the stored content. It is also important to note that the decision to use encryption is optional and must be defined in an initial configuration in the middleware. When a smart contract chooses to use the encryption provided by the middleware, the public key used to encrypt the content is stored in it. Access to the content stored in the contract is only possible via StreamingChain, as the private key and decryption mechanism are kept in the middleware. This measure aims to prevent unauthorized decryption of information; for example, if someone gains access to the contract stored on the network, they will not be able to decrypt the information because the private key is stored in the proposed solution. This approach aims to minimize excessive costs associated with implementing encryption and decryption mechanisms within smart contracts. StreamingChain performs the tasks described below during the smart contract creation. It generates the 512-bit public and private keys for encrypting and decrypting the information stored in the contract. Then, with the keys created, it deploys the contract, adding the public key used to encrypt the data, the business rules for audience metrics and payment between the parties involved, and the identification of the content creator and the streaming platform accounts using their respective public keys from the blockchain network wallets. Finally, it establishes the relationship between the private encryption/decryption key and the contract's address, making it possible to access the information in the contract when consulting the data. Below, we carefully explain the sequence of actions created by the computational service using the algorithm described in Algorithm 1. ```
Data: \(\mathcal{A}\), \(\mathcal{B}\), \(\mathcal{C}\), \(\mathcal{D}\), \(\mathcal{



ABI and stores the retrieved content in the _contract_ variable. Upon completion of this task, the streaming platform's private key is retrieved to facilitate payments, and this information is also stored in the _contract_ variable, as shown in line 10. Two functions described in the algorithm are responsible for helping to generate and publish the smart contract on the blockchain network. The _DEPLOY_ function, described between lines 12 and 14, manages the contract's byte code and the address of the content creator's digital wallet, while the _SEND_ function, described between lines 17 and 19, captures the streaming platform's public key, the gas balance in the wallet, the gas price and the transaction value. Once all the necessary information has been obtained, an instance of the smart contract is created on the blockchain network, as described in line 24, and from that moment on, the streaming platform takes ownership of the contract, as all the costs related to transactions on the blockchain network are borne by it, including payment transactions between the digital wallets.