Definition: A Comb Swap is a peer-to-peer (P2P) contract where two parties (e.g., Alice and Bob) exchange value for Haircomb tokens using a decider. The swap is facilitated on an EVM-compatible chain and involves constructing a decider to manage the token exchange securely and efficiently.
Characteristics:
Constructed in a P2P fashion between the two parties.
Decentralized and trustless exchange of value for Haircomb tokens.
Uses the decider to ensure that both parties fulfill their obligations in the swap.
Use Cases:
Peer-to-Peer Token Exchange: Alice and Bob exchange assets directly without intermediaries, using the decider to verify and execute the transaction.
Value Swapping: Users can securely swap their assets for Haircomb tokens on EVM-compatible chains with the assurance of a trusted contract.
Binary Comb Trade
Definition: The Binary Comb Trade is a contract where the outcome of a trade is determined by a single bit in the decider’s 16-bit signature. The Merkle contract flips the destination of assets between Alice and Bob, depending on the binary value of the decider bit.
Characteristics:
Uses a single bit from the decider’s 16-bit signature to decide the trade's outcome.
Automatically flips the destination of the assets based on the bit's value (0 or 1).
Ensures that both parties have an equal chance of receiving the desired asset.
Use Cases:
Merkle Contract Flipping: Alice and Bob's trade destination alternates based on the bit in the decider, allowing for randomized asset distribution.
Binary Trades: The binary comb trade provides a simple yet effective way to decide asset destination between two parties.
Amount Decided Later Contract
Definition: In the Amount Decided Later contract, the decider’s 16-bit number scales the destination amount sent to one party, while the remainder is allocated to the other party. This contract is designed for scenarios where the final amount is not predetermined at the contract’s initiation.
Characteristics:
Based on the 16-bit number signed by the decider.
Scales the amount sent to Alice based on the value derived from the signed number.
Automatically calculates and sends the remainder to Bob.
Use Cases:
Utility Billing: The amount might represent a specific subscription service or an utility that's continously consumed by Alice, and the remainder is settled between Alice and Bob at the end of the billing period.
Delayed Amount Determination: The amount Alice receives is determined after the contract is signed, with the remainder allocated to Bob.
Proportional Asset Distribution: This contract allows for dynamic distribution of assets between parties based on a predetermined scaling factor.
Auction Contract
Definition: The Auction Contract leverages the decider’s signed 16-bit number to select a winner from a list of bidders stored in a Merkle tree. This contract automates the auction process, ensuring that the highest bidder is chosen fairly and transparently.
Characteristics:
Uses a signed 16-bit number from the decider to pick the winner.
Bidders are organized within a Merkle tree for efficient selection.
Automatically processes and concludes the auction once a winner is determined.
Use Cases:
Decentralized Auctions: Bidders participate in an auction for Haircomb tokens or other assets, with the decider selecting the winner based on the signed number.
Efficient Auction Execution: The contract ensures that the winner is chosen transparently and fairly from the Merkle tree, with minimal intervention required from participants.