Skip to content
DigiStamp Contracts, home

⚠️ NOTICE: Deployment Testing in Progress We have recently deployed a major platform update and are currently performing post-deployment testing and validation. Please do not use this website or submit any transactions until testing is complete. Some features may be unavailable or behave unexpectedly. Thank you for your patience as we work to ensure everything is functioning correctly.

← Template gallery

Two-party signed agreement

Both parties sign the same terms with their own DigiByte wallets. The agreement is fulfilled when both confirm completion, and lapses at expiry if they do not.

Agreementssignaturesapprovalgeneraltwo-party-agreement v1

Who enforces what

  • Condition doneA Approval givenCryptographically verifiable
  • Condition doneB Approval givenCryptographically verifiable
  • Action complete Record the outcomeApplication-enforced
Consensus-enforced
Every DigiByte node enforces it. Nobody can override it, including Contracts.
DigiAsset-indexer-enforced
DigiAsset indexers apply it after a transaction confirms. It is not DigiByte consensus: a valid DigiByte transaction can still be treated as burning assets.
Application-enforced
Contracts decides it in its own application, from data you can check. You trust Contracts' nodes, records and evaluation.
Cryptographically verifiable
Anyone can check it from public data and mathematics alone (wallet signatures, drand). Contracts records it; you need not trust Contracts to verify it.

Before it can be signed, fill in

  • a DigiByte address for every party
  • the terms

Simulation

The standard scenarios, run through the same rule engine the live service uses, with example values in every blank (addresses nobody holds keys for, and a format-valid example asset).

ScenarioOutcomeActions

Nothing happens

Everyone signs, then nobody does anything until expiry.

lapsednone

Both confirm completion happens

The least that makes rule “Both confirm completion” true happens at block 24500005.

fulfilled
complete: update contract state (execute)

Data unavailable

The rule conditions are met, but every outside data source is unreachable. Nothing irreversible may happen.

fulfilled
complete: update contract state (execute)

Rules

  1. 1. Both confirm completion

    When “doneA” AND “doneB”

    • → Record the outcome: fulfilled. The contract ends.Application-enforcedIrreversible
  2. Expiry

    At DigiByte block 24,540,320 (20 confirmations), if no outcome has been recorded, the contract ends as lapsed. Nothing that happens at or after expiry counts.

Conditions

  • doneAApproval givenCryptographically verifiable

    The party-a approves “The agreement is completed” by signing an approval with their DigiByte wallet.

    A DigiByte message signature by the party, naming this contract version and the subject. Anyone can verify it; Contracts records it and counts it from the next block.

    • An approval cannot be withdrawn once recorded.
    • An approval submitted after the expiry does not count.
  • doneBApproval givenCryptographically verifiable

    The party-b approves “The agreement is completed” by signing an approval with their DigiByte wallet.

    A DigiByte message signature by the party, naming this contract version and the subject. Anyone can verify it; Contracts records it and counts it from the next block.

    • An approval cannot be withdrawn once recorded.
    • An approval submitted after the expiry does not count.

What you are trusting

DigiByte itself does not enforce these rules. Contracts evaluates them from public data and records the outcome; the parties’ signatures and any anchors can be checked by anyone.

  • Contracts' evaluation and records
  • Contracts to record an approval when the party submits it

Irreversible once done

  • Both confirm completion: Record the outcome: fulfilled. The contract ends.

These run only when every condition they depend on is known. Missing or unconfirmed data never triggers them.

Use it from code

The same template is available from the API (GET /api/contracts/v1/templates/two-party-agreement) and the TypeScript SDK:

const { draft } = await client.templates.get("two-party-agreement");
// fill in addresses and amounts, then:
const { id } = await client.contracts.create(draft, { idempotencyKey: crypto.randomUUID() });