Skip to content

Escrow Operations

Escrow holds VIZ tokens in a conditional transfer: funds are released only after approval by both the recipient and a neutral agent, or arbitrated by the agent in case of dispute.

Escrow flow:

escrow_transfer  →  escrow_approve (by both "to" and "agent")
                 →  escrow_release (by "from" or "to")
                 →  [escrow_dispute]  →  escrow_release (by "agent" only)

           (ratification deadline missed)
                 →  expire_escrow_ratification_operation [virtual — funds return]

escrow_transfer_operation (ID 15)

Auth: active of from

Creates an escrow. Funds leave from immediately into escrow balance; both agent and to must approve before release is possible.

FieldTypeDescription
fromaccount_name_typeSender
toaccount_name_typeIntended recipient
agentaccount_name_typeNeutral escrow agent (arbitrator)
escrow_iduint32_tUnique ID chosen by sender (default 30)
token_amountasset (VIZ)Amount to hold in escrow
feeasset (VIZ)Agent fee — paid to agent upon approval
ratification_deadlinetime_point_secDeadline for both parties to approve
escrow_expirationtime_point_secExpiry if escrow is never released
json_metadatastringOptional terms / metadata
json
[15, {
  "from": "alice",
  "to": "bob",
  "agent": "charlie",
  "escrow_id": 1001,
  "token_amount": "100.000 VIZ",
  "fee": "1.000 VIZ",
  "ratification_deadline": "2024-06-01T00:00:00",
  "escrow_expiration": "2024-07-01T00:00:00",
  "json_metadata": "{\"description\":\"payment for work\"}"
}]
  • ratification_deadline must be before escrow_expiration.
  • Both timestamps must be in the future at broadcast time.
  • escrow_id must be unique per from account.
  • If not approved before ratification_deadline, the virtual expire_escrow_ratification_operation fires and funds return to from.

escrow_approve_operation (ID 18)

Auth: active of who

Approves or rejects the escrow. Both to and agent must approve for the escrow to become active.

FieldTypeDescription
fromaccount_name_typeOriginal escrow sender
toaccount_name_typeOriginal escrow recipient
agentaccount_name_typeEscrow agent
whoaccount_name_typeWho is approving: must be to or agent
escrow_iduint32_tEscrow ID
approvebooltrue to approve, false to reject
json
[18, {
  "from": "alice",
  "to": "bob",
  "agent": "charlie",
  "who": "bob",
  "escrow_id": 1001,
  "approve": true
}]
  • who must be either to or agent.
  • Once approved, cannot be revoked.
  • If approve: false — escrow is cancelled and funds return to from.
  • Must be broadcast before ratification_deadline.

escrow_dispute_operation (ID 16)

Auth: active of who

Raises a dispute on an approved escrow. After a dispute, only the agent can release funds.

FieldTypeDescription
fromaccount_name_typeOriginal escrow sender
toaccount_name_typeOriginal escrow recipient
agentaccount_name_typeEscrow agent
whoaccount_name_typeWho is disputing: must be from or to
escrow_iduint32_tEscrow ID
json
[16, {
  "from": "alice",
  "to": "bob",
  "agent": "charlie",
  "who": "alice",
  "escrow_id": 1001
}]
  • Can only be raised on an approved escrow (both to and agent have approved).
  • Must be raised before escrow_expiration.

escrow_release_operation (ID 17)

Auth: active of who

Releases escrow funds to receiver. Partial releases are allowed.

FieldTypeDescription
fromaccount_name_typeOriginal escrow sender
toaccount_name_typeOriginal escrow recipient
agentaccount_name_typeEscrow agent
whoaccount_name_typeAccount releasing the funds
receiveraccount_name_typeAccount receiving the funds (must be from or to)
escrow_iduint32_tEscrow ID
token_amountasset (VIZ)Amount to release (may be partial)
json
[17, {
  "from": "alice",
  "to": "bob",
  "agent": "charlie",
  "who": "alice",
  "receiver": "bob",
  "escrow_id": 1001,
  "token_amount": "100.000 VIZ"
}]

Release permission rules:

StateWho can releaseTo whom
No dispute, before expirationfrom or toThe other party
No dispute, after expirationfrom or toEither party
Disputedagent onlyEither party
  • Partial releases are allowed; the remainder stays in escrow.

See also: Data Types, Operations Overview, Virtual Operations.