The core of the idea can be understood from the name –
Consolidated: A CDS contract will typically manage storage for multiple linked logic contracts. A single CDS layer can manage an arbitrary amount of storage spaces, but CDS also supports segmentation through the use of multiple CDS layers.
Dynamic: Storage structures can be adapted post-deployment at the contract level.
Storage: The focus is on making storage evolvable and extendable in itself.
Two critical features:
Dynamic storage spaces: Segregated storage areas (defined by a hash structure) that can be created through a function invocation in a post-deployment setting. They are populated by a mapping-of-extendable-struct.
Extendable structs: A custom struct type that can have new members appended to it through function invocation.
The core objective of CDS is to introduce a standardized, full-service approach to storage management, cross-contract interoperability, and upgradeability. With CDS, storage structures can be extended and created in-place, removing the need for any manual storage management and saving re-deployments. Access and modification patterns are static, which helps to stabilize and simplify complex cross-contract dependencies in large or rapidly-evolving ecosystems – and the consolidation of storage into one (or more, if desired) CDS layers ensures efficient single-hop data access for any linked external contract.
CDS also provides a strong foundation for governance solutions. One of the core complaints that I hear about upgradeability patterns in general is that they make protocols unsafe, since faulty or malicious logic can be introduced at any time. CDS can be managed by self-executing governance systems, which effectively enables full upgradeability (critically, in terms of both logic and storage) without sacrificing any decentralization.
CDS Intuition: data is stored in a single contract, which uses custom storage structure abstractions that enable you to create and extend mapped storage structures in-place. Stored data is segmented logically through a hashing scheme, and access controls ensure that the data layer is only accessible to explicitly permissioned entities. Since data structures can be created or extended in-place, we can efficiently manage the full data requirements for evolving multi-layer smart contract systems with a single CDS layer. Since each layer shares the same data bank, we have standardized access patterns and seamless interoperability, even between logically segmented layers.
Please share your thoughts below!