Watermark Register
NFT Watermarks
NFT watermarks can be directly embedded into the media asset using three methods: lazy mint, mint, and authorized mint.
Lazy Mint
Creators can create vouchers without cost to propose derivative IP Assets for the collection. Other users can then use these vouchers to mint NFTs by paying the appropriate fees.
The parameters for the voucher are as follows:
requestId
bytes32
A unique ID used by the register.sol contract to specify which voucher or NFT the watermark request belongs to
maximumUse
number
How many times the voucher can be used
tradeToken
string
The token that the user pays with if xERC20 not present
watermarkPaymentToken
string
The token that watermark is paid in
creator
string
Address of the creator of the voucher
collection
string
Address of the collection the voucher belongs to
price
number
Price the creator sets for the mint. Must be greater than the minimum price set by the collection
signature
bytes32
Signature of the voucher
The requestId is the key variable in this process:
- A random, standardized - requestIdis provided by the sequencer when creating a voucher
- The sequencer maintains the watermark requests queue 
- When the register contract emits a register event, it includes the - requestId
- Xeal nodes listen for this event and provide the watermark 
- Upkeep nodes store these watermarks in batch in the upkeep contract 
A single voucher can create multiple NFTs using the maximumUse variable. NFTs created by the same creator using a single voucher share the same requestId but have different targetIds.
The targetId determines watermark assignment:
- If - targetIdis 0: The sequencer assigns a random watermark with the specified- requestId
- If - targetIdis greater than 1: The system matches the corresponding- targetIdfor watermarking and minting
Mint
When a collection is marked as permissionless (isPermissionless = true), anyone can mint an NFT by paying the minimum fee specified by the xNFT contract, without using lazy mint.
Authorized Mint
In collections marked as permissioned (isPermissionless = false), only the collection owner can mint NFT tokens without fees.
For pointer watermarks
A NFT token owner can use requestPointerWatermark to mint a watermark that points to the NFT. Only the NFT's information and the NFT owner information will be shown in the mobile verification.
Watermark Registration Process
- The process begins by calling the - requestWatermarkMapfunction from the register.sol contract:
function requestWatermarkMap(
    address _nftContract,
    uint256 _tokenId,
    address _watermarkPaymentToken,
    uint256 _watermarkCount,
    bytes32 _watermarkRequestId,
    uint256 _watermarkTargetId
) external payable- This Register contract can be called from any Xeal-supported chain. 
- Nodes listen for events emitted by this function call. 
- When a partition threshold for the watermark is met, the Register contract emits a - PartitionIdIncrementedevent:
event PartitionIdIncremented(uint256 newPartitionId, uint256 chainId);- This event notifies the node to collect all records for the watermark registers and create a Merkle proof. 
Watermark Threshold
The Register.sol contract manages fee collection and event emission for watermark processing by nodes. It enforces a maximum limit on watermark requests per call to maintain atomic operations and prevent node throttling.
Watermark Tracking
The contract maintains two key counters:
- currentWatermarkCount: Tracks the number of watermarks in the current partition
- partitionId: Identifies the current partition
The partitionId increments when currentWatermarkCount reaches the watermarkThreshold. The watermarkThreshold defines the maximum number of watermarks that can fit in a partition.
Request Limits
The maximum number of watermarks allowed in a request is calculated as:
watermarkThreshold - currentWatermarkCount + nextWatermarkThresholdnextWatermarkThreshold is used when the protocol updates the threshold value:
- Changes to threshold only take effect after - partitionIdincrement
- When - partitionIdincrements,- nextWatermarkThresholdbecomes the new- watermarkThreshold
- After the increment, - nextWatermarkThresholdresets to 0
Last updated