Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Schema

Technical reference for the Trustless Work V2 Single-Release and Multi-Release escrow objects returned by Core API v2.

Schema

Trustless Work V2 supports two escrow families:

  • Single Release

  • Multi Release

They share the same core concepts but place settlement state differently.

This page documents the Core API v2 read model returned to applications.

It is not a literal copy of the Soroban storage structs.

The API normalizes on-chain data into application-friendly camelCase objects and enriches some fields such as asset metadata.


Core differences

The most important structural distinction is:

Property
Single Release
Multi Release

Amount

Escrow-level

Per milestone

Receiver

Escrow-level role

Per milestone

Dispute

Escrow-level

Per milestone

Released state

Escrow-level

Per milestone

Approval

Per milestone

Per milestone

Settlement

One final payout

Independent milestone payouts

Everything else follows from that distinction.

Compare Escrow Types


Single-Release Escrow

A Single-Release Escrow represents multiple conditions leading to one final settlement.

The Core API read shape is conceptually:


Single-Release fields

Field
Type
Description

type

string

Escrow family. For this object: single-release.

contractId

string

Deployed escrow contract identifier.

contractBaseId

string

Base/factory contract associated with this escrow deployment.

engagementId

string

External business identifier supplied by the integrator.

title

string

Human-readable escrow title.

description

string

Human-readable escrow description.

amount

number

Total Single-Release settlement amount in human-readable token units.

balance

number

Current funded token balance.

platformFee

number

Platform fee normalized by Core API as a percentage.

receiverMemo

number

Numeric receiver memo stored with the escrow.

trustline

Trustline

Asset metadata used by the escrow.

roles

SingleReleaseRoles

Role assignments.

milestones

Milestone[]

Conditions that gate final settlement.

dispute

Dispute

Dispute state for the entire escrow.

released

boolean

Whether the Single-Release settlement has already executed.


Single-Release Roles

Field
Type
Description

approvers

string[]

Addresses authorized to approve milestones.

serviceProviders

string[]

Addresses authorized to update milestone status and evidence.

platform

string

Platform address associated with the escrow and Platform Fee.

releaseSigners

string[]

Addresses authorized to execute eligible settlement.

disputeResolvers

string[]

Addresses authorized to resolve existing disputes.

receiver

string

Final beneficiary of the Single-Release payout.

admin

string

Address with supported configuration authority.

observers

string[]

Read-only participant addresses.

Operational role lists support multiple addresses.

V2 caps role lists at 5 addresses.

The Receiver, Platform, and Admin are singular fields.

Review Roles and Permissions


Single-Release Milestone

Field
Type
Description

description

string

Description of the milestone condition or deliverable.

status

string

Application-defined progress value.

evidence

string

Evidence or reference associated with the milestone.

approvals

MilestoneApprovals

Threshold approval state.

A Single-Release milestone does not contain:

  • amount

  • Receiver

  • dispute state

  • released state

Those economic properties belong to the escrow as a whole.


Milestone Approvals

V2 replaces the V1 approved: boolean model with threshold approvals.

Field
Type
Description

target

number

Number of distinct approvals required.

approvalCount

number

Number of approvals currently recorded.

approvedBy

string[]

Addresses that have already approved the milestone.

A milestone satisfies its approval requirement when:

Do not derive protocol approval from the milestone's status string.

For example:

is not approved at the protocol level.

Review the Approval Phase


Dispute

Field
Type
Description

isDisputed

boolean

Whether the dispute is currently open.

reason

string

Reason supplied when the dispute was opened.

resolved

boolean

Whether the dispute has reached a resolution.

For Single Release, this object belongs to the escrow.

For Multi Release, each milestone contains its own Dispute object.


Multi-Release Escrow

A Multi-Release Escrow represents independent milestone settlements.

The Core API read shape is conceptually:


Multi-Release fields

Field
Type
Description

type

string

Escrow family. For this object: multi-release.

contractId

string

Deployed escrow contract identifier.

contractBaseId

string

Base/factory contract associated with this escrow deployment.

engagementId

string

External business identifier supplied by the integrator.

title

string

Human-readable escrow title.

description

string

Human-readable escrow description.

balance

number

Current funded token balance.

platformFee

number

Platform fee normalized by Core API as a percentage.

receiverMemo

number

Numeric receiver memo stored with the escrow.

trustline

Trustline

Asset metadata used by the escrow.

roles

MultiReleaseRoles

Global role assignments.

milestones

MultiReleaseMilestone[]

Independently settleable milestones.

Multi Release does not contain top-level:

  • amount

  • receiver

  • dispute

  • released

Those properties belong to individual milestones.


Multi-Release Roles

The role model is the same as Single Release except there is no escrow-level receiver.

Field
Type
Description

approvers

string[]

Global Approvers for escrow milestones.

serviceProviders

string[]

Addresses authorized to update milestone status and evidence.

platform

string

Platform address associated with the escrow and Platform Fee.

releaseSigners

string[]

Addresses authorized to execute eligible milestone settlements.

disputeResolvers

string[]

Addresses authorized to resolve disputes.

admin

string

Address with supported configuration authority.

observers

string[]

Read-only participant addresses.

Receivers live directly on each milestone.


Multi-Release Milestone

Field
Type
Description

description

string

Milestone condition or deliverable.

status

string

Application-defined progress value.

evidence

string

Evidence or external reference.

approvals

MilestoneApprovals

Threshold approval state for this milestone.

amount

number

Settlement amount allocated to this milestone.

dispute

Dispute

Dispute state for this milestone.

released

boolean

Whether this milestone has already settled normally.

receiver

string

Final beneficiary of this milestone's settlement.

Each milestone can therefore progress independently.

For example:


Trustline

The Core API read model exposes asset information as:

Field
Type
Description

address

string

Token contract address used by the escrow.

contractId

string

Contract identifier exposed by the API for the same asset reference.

symbol

string

Token symbol resolved by the Core API, such as USDC.

There is an important implementation distinction here.

The raw V2 Soroban contract stores:

The additional contractId and symbol fields are part of the Core API representation, not additional fields stored in the escrow's V2 Trustline struct.

This is why API schema and contract storage should not be treated as identical representations.


API names vs on-chain names

Soroban structs use Rust-style snake_case.

For example:

Core API v2 exposes application-friendly camelCase:

Use the schema of the integration surface you are calling.

Do not copy raw contract field names into API requests or responses unless that endpoint explicitly expects them.


Amount normalization

Raw Soroban token amounts are integer values using the token's decimal precision.

Core API v2 normalizes these values before returning them.

For example:

Current V2 HTTP read DTOs expose normalized amounts as JSON numbers.

This applies to values such as:

  • amount

  • balance

  • milestone amount

Applications should use the Core API representation rather than manually interpreting raw contract integers when consuming API reads.


Platform Fee representation

The V2 smart contract stores the Platform Fee internally as a basis-point value.

Core API v2 converts that raw value into a percentage for the HTTP read model.

Conceptually:

meaning:

Do not assume the contract's raw fee integer and the HTTP API's platformFee number use the same unit.


Status is not protocol state

The following values are separate:

status is application-defined text.

For example:

does not mean:

Likewise, using:

as a status string does not set:

Applications must use the dedicated protocol fields for economic authorization.

Status ≠ Approval ≠ Dispute ≠ Release


Evidence

The read model exposes milestone evidence as a string:

When updating milestone status, V2 allows the new evidence value to be omitted.

If no new evidence is supplied, the existing evidence remains unchanged.

That update behavior should not be confused with the read schema, where evidence is returned as the milestone's current string value.


Contract storage vs Core API read model

Do not assume these layers expose identical objects.

Core API can:

  • convert snake_case to camelCase

  • normalize token amounts

  • normalize Platform Fee units

  • add asset symbols

  • add deployment metadata such as contractId

  • omit internal or redundant fields from specific responses

The smart contract remains authoritative for execution.

The API schema is the correct interface for applications consuming Core API v2.


Endpoint-specific response shapes

This page describes the primary V2 escrow read object.

Individual endpoints may wrap or adapt that object.

For example, transaction-submission responses can include:

  • transaction hash

  • ledger information

  • deployed contract ID

  • an escrow snapshot

Some redundant or internal fields may be omitted from those snapshots.

Always use the endpoint's API reference as the final source for that endpoint's exact response envelope.

Explore the V2 REST API


Single vs Multi reference

Property
Single Release
Multi Release

type

single-release

multi-release

contractId

Escrow-level

Escrow-level

balance

Escrow-level

Escrow-level

platformFee

Escrow-level

Escrow-level

roles.receiver

Yes

No

amount

Escrow-level

Per milestone

milestone.receiver

No

Yes

dispute

Escrow-level

Per milestone

released

Escrow-level

Per milestone

approvals

Per milestone

Per milestone


Escrow Properties

Escrow Types

Roles and Permissions

Escrow Lifecycle

Developer Guide

Last updated