Skip to main content
CDR vaults can be gated behind the DATA Foundation’s license tokens so that only license holders can decrypt the vault contents. In the current Aeneid release, this is a manual integration: you encode the CDR condition data yourself and mint DATA Foundation license tokens separately.

Prerequisites

Aeneid Contracts

How the DATA Foundation License Read Pattern Works

Every CDR vault has a writeConditionAddr and readConditionAddr. For a DATA Foundation license-gated vault on Aeneid:
  • writeConditionAddr usually points at OwnerWriteCondition, with writeConditionData = abi.encode(ownerAddress)
  • readConditionAddr points at LicenseReadCondition, with readConditionData = abi.encode(licenseTokenAddress, ipId)
  • accessAuxData at read time is abi.encode(uint256[] licenseTokenIds)
The CDR SDK does not register the IP Asset or mint the license token for you. Create the IP and obtain its ipId with DATA Foundation tooling first, then configure the vault. If you have not registered the asset yet, start with Register IP Asset. If you need to attach or inspect license terms before minting, see Attach Terms.

Upload a License-Gated Vault

The same condition setup works with uploadFile() if the encrypted content lives off-chain.

Mint a License Token Before Reading

Before a user can read a DATA Foundation license-gated vault, they still need to mint a license token. The DATA Foundation core SDK’s wipClient handles the WIP wrap and approval steps so the reader can wrap IP, approve the RoyaltyModule, and mint in three short calls. WIP is Wrapped IP, the ERC-20 wrapped form of the native IP token. the DATA Foundation’s royalty / license flows use WIP, so the reader first wraps IP, then approves the RoyaltyModule to spend it.
licenseTermsId: 2054 is only an example. Replace it with the license terms ID actually attached to your IP Asset. You receive that ID when you register the asset or attach terms.
The wrap, approve, and mint calls above are all on-chain transactions. The later accessCDR() call adds one more on-chain read request.

Read With a License Token

At read time, pass the caller’s license token ID through accessAuxData.
If the caller does not hold a valid license token for the vault’s IP Asset, the read request reverts on-chain and validators will not produce partial decryptions.

Custom Condition Contracts

License gating is just one pattern. You can deploy your own condition contract for any access control logic by implementing one or both of these interfaces:
The CDR contract calls these functions before allowing a write() or read() operation. Return true to allow, false to deny. Then pass your contract’s address as readConditionAddr or writeConditionAddr when allocating a vault.