Lock Secret Schemas

Note

The catbuffer schemas repository defines how each transaction type should be serialized. In combination with the catbuffer-generators project, developers can generate builder classes for a given set of programming languages.

Lock Secret Types

LockHashAlgorithm

The list of supported hashing algorithms.

Enumeration: uint8

Id Description
0 (Op_Sha3_256) Proof is hashed using SHA3-256.
1 (Op_Hash_160) Proof is hashed twice: first with SHA-256 and then with RIPEMD-160 (bitcoin’s OP_HASH160).
2 (Op_Hash_256) Proof is hashed twice with SHA-256 (bitcoin’s OP_HASH256).

Secret Lock

SecretLockTransaction

Use a SecretLockTransaction to transfer mosaics between two accounts. The mosaics sent remain locked until a valid SecretProofTransaction unlocks them.

The maximum number of blocks the lock can lie up to is 30 days, being this parameter configurable per network. If the transaction duration is reached without being proved, the locked amount goes back to the initiator of the SecretLockTransaction.

Version: 0x01

EntityType: 0x4152

Inlines:

Property Type Description
recipientAddress UnresolvedAddress Address that receives the funds once unlocked.
secret Hash256 Proof hashed.
mosaic UnresolvedMosaic Locked mosaic.
duration BlockDuration Number of blocks for which a lock should be valid. If reached, the mosaics will be returned to the initiator.
hashAlgorithm LockHashAlgorithm Algorithm used to hash the proof.

Secret Proof

SecretProofTransaction

Use a SecretProofTransaction to unlock SecretLockTransactions.

The transaction must prove knowing the proof that unlocks the mosaics.

Version: 0x01

EntityType: 0x4252

Inlines:

Property Type Description
recipientAddress UnresolvedAddress Address that receives the funds once unlocked.
secret Hash256 Proof hashed.
proofSize uint16 Proof size in bytes.
hashAlgorithm LockHashAlgorithm Algorithm used to hash the proof.
proof array(byte, proofSize) Original random set of bytes.