# Blockchain-Driven Generalization of Policy Management for Multiproduct Insurance Companies
## 4 Solution Approach
### Anchoring Protocol: Merkle Trees
This ensures that even when new policy types are added, the system maintains its efficiency and scalability without affecting the existing policies. In this way, the migration of data from the traditional system to the new blockchain-based model can be carried out efficiently through automated scripts. These scripts transform the data of existing policies into the new standardized model, minimizing errors and accelerating the migration process. Finally, the advantages of this approach include reduced maintenance costs without interrupting production operations or compromising data integrity. Two possible strategies can be considered for incorporating this data structure into the proposed architecture:  
1. Each leaf node represents a complete policy: In this scenario, the root of the tree within the Blockchain network would represent a client. As depicted in Figure 4, each leaf of the tree represents a complete policy held by that client, who may have one or several policies at the same time. In this case, conflict resolution and verification are swift--by checking the hash of the tree root, we can detect changes in the client's entire set of policies, or by checking the hash of each leaf node, we can detect changes in a specific policy. In terms of storage efficiency, this approach is advantageous when the policies are small and each client holds multiple policies simultaneously. 2. Each leaf node represents a policy data point, and each root represents a complete policy: In this second option, complete policies are recorded on the Blockchain rather than clients. Each leaf node of the tree represents a specific data point of the policy, providing greater granularity to the model. In other words, each client will have as many trees associated with them as the number of policies they have purchased. This model is depicted in Figure 5. In this case, verification can be more thorough, allowing the precise location of any changes to be identified. This alternative is more scalable when the number of policies per client varies significantly, as it only requires adding or removing nodes for each policy depending on the data needed. The strategy ultimately chosen is the second one, where each leaf node represents a specific data point of the policy, and the tree root represents a complete policy. This decision is based on the greater granularity provided by this option. It offers increased flexibility in managing and verifying individual policy data, allowing for the detection of changes at the exact point where they occur. The first strategy allows for the comparison of only the complete hash of each policy, detecting changes but not identifying the specific data point where the change occurs. In client management, having each complete policy as leaf nodes would require a static data model to account for all possible options based on the type of insurance being handled. This approach would reduce adaptability and efficiency when adding new policies, as it would necessitate changes to these predefined models. In contrast, the selected strategy allows for the addition of new policies without altering the rest, as it is a fully dynamic solution. By leveraging the standardized policy model, we will add only the data that is truly necessary to the tree. Figure 4: Leaf node as policy. Figure 5: Tree root as a policy. Additionally, considerations such as the size of the policies and the frequency of data updates have been taken into account. These factors directly impact the scalability of the solution. With the chosen option, each tree represents a single policy, which facilitates the organized management of large volumes of data. In both solutions, the primary element is always the policy. The inclusion of the client entity in the first option simply reflects a different way of organizing the information. This approach is more similar to the initial method of using only smart contracts, where a predefined data model is required.