ConditionalDisclosure
SIP Protocol API Reference v0.7.0
SIP Protocol API Reference / ConditionalDisclosure
Class: ConditionalDisclosure
Section titled “Class: ConditionalDisclosure”Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:7155
Conditional Disclosure Manager
Handles automatic disclosure of viewing keys after specified time or block height for regulatory compliance.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ConditionalDisclosure():
ConditionalDisclosure
Returns
Section titled “Returns”ConditionalDisclosure
Methods
Section titled “Methods”createTimeLocked()
Section titled “createTimeLocked()”createTimeLocked(
params):TimeLockResult
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:7168
Create a time-locked disclosure
Encrypts the viewing key with a deterministic key derived from the commitment and reveal time. The key can only be reconstructed after the specified time/block height.
Parameters
Section titled “Parameters”params
Section titled “params”Time-lock parameters
Returns
Section titled “Returns”Time-lock result with encrypted key
Throws
Section titled “Throws”If parameters are invalid
Throws
Section titled “Throws”If encryption fails
checkUnlocked()
Section titled “checkUnlocked()”checkUnlocked(
timeLock,currentTimeOrBlock?):UnlockResult
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:7178
Check if a time-lock is unlocked and retrieve the viewing key
Parameters
Section titled “Parameters”timeLock
Section titled “timeLock”Time-lock result to check
currentTimeOrBlock?
Section titled “currentTimeOrBlock?”Current time (Date/number) or block height (number)
number | Date
Returns
Section titled “Returns”Unlock result with viewing key if unlocked
Throws
Section titled “Throws”If time-lock format is invalid
Throws
Section titled “Throws”If decryption fails
verifyCommitment()
Section titled “verifyCommitment()”verifyCommitment(
timeLock,viewingKey):boolean
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:7189
Verify a time-lock commitment
Verifies that the verification commitment in the time-lock matches the hash of the provided viewing key and reveal time.
Parameters
Section titled “Parameters”timeLock
Section titled “timeLock”Time-lock to verify
viewingKey
Section titled “viewingKey”`0x${string}`
Viewing key to verify against
Returns
Section titled “Returns”boolean
True if commitment is valid