disordered
@example
• v1.0.0Example 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:
- Output first: Receiver output declared before input
- Input second: Source input declared after output
- Change output: Sender change calculated and returned
- Reference input: Demonstrates reference UTxO usage
- Late party declaration: Receiver party declared after transaction
Transaction Flow
- Setup: Sender initiates transaction with specified quantity
- Reference: Protocol references a specific UTxO for validation
- Transfer: ADA moves from Sender to Receiver
- 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