Logo
Registry

disordered

@example

• v1.0.0

Example protocol demonstrating transaction ordering and UTxO management patterns

Disordered Protocol

An educational example protocol that demonstrates transaction ordering flexibility and UTxO management patterns in the TX3 language. This protocol showcases how transaction components can be declared in different orders while maintaining logical correctness.

Key Features

  • Flexible Declaration Order: Demonstrates that inputs, outputs, and references can be declared in any order
  • Party Declaration Flexibility: Shows parties can be declared after their usage in transactions
  • UTxO Reference Patterns: Includes reference inputs for advanced transaction patterns
  • Basic Transfer Logic: Simple ADA transfer with change management

Educational Value

Transaction Structure Flexibility

The protocol intentionally declares transaction components in a non-traditional order:

  1. Output first: Receiver output declared before input
  2. Input second: Source input declared after output
  3. Change output: Sender change calculated and returned
  4. Reference input: Demonstrates reference UTxO usage
  5. Late party declaration: Receiver party declared after transaction

Transaction Flow

  1. Setup: Sender initiates transaction with specified quantity
  2. Reference: Protocol references a specific UTxO for validation
  3. Transfer: ADA moves from Sender to Receiver
  4. Change: Remaining balance returned to Sender after fees

Parameters

  • quantity: Int - Amount of ADA to transfer (in lovelace)

Use Cases

  • TX3 Learning: Understanding transaction component ordering flexibility
  • Code Organization: Learning different ways to structure TX3 protocols
  • Reference Patterns: Exploring reference input usage
  • Development Training: Teaching protocol structure best practices

Technical Notes

  • Reference UTxO: Uses a zero hash reference for demonstration
  • Party Scoping: Shows that party declarations have file-level scope
  • Order Independence: Proves TX3 parser handles component order flexibility

This protocol is essential for understanding TX3's flexible syntax and serves as a foundation for more complex transaction patterns.

disordered

Published by

@example

Install

trix install example/disordered

Publication datePublished 10 months ago
Back to all Protocols