In this document, we describe the terminology and models that we use in the Hydra Auction project.
In this document, we use L1 and L2 as follows:
Layer 1 (L1): the Cardano main network (mainnet) and ledger. |
Layer 2 (L2): the network and ledger within a single Hydra Head. |
Assets:
Auction lot: the NFT asset being sold in the auction. |
Voucher: the NFT asset that the winning bidder can use to buy the auction lot for the standing bid’s price. |
Bidding:
Minimum bid increment: a new bid can replace the standing bid only if it exceeds it by at least this minimum increment. |
Starting bid: the smallest bid that can be accepted by the auction. |
Standing bid: the highest of the bids that have been submitted on or before a given time. |
Deposits:
Bidder deposit: a fixed deposit that each bidder must provide (i.e. lock into the auction’s bidder deposit smart contract) to be eligible to participate in the auction. A bidder’s deposit can be claimed by the seller if the bidder wins the auction but does not buy the auction lot by the voucher expiry time. |
Fees:
Auction fees: fees paid to the delegates as compensation for hosting the bidding process of the auction on L2. These fees must be paid when the winning bidder buys or the seller reclaims the auction lot, and they must be distributed equally to the delegates. If the winning bidder buys the auction lot, then the auction fees are deducted from his payment to the seller. |
Roles:
Bidders: a group of people seeking to place bids to buy the auction lot. |
Delegates: a group of people trusted to collectively witness new bids and track the standing bid over time. |
Seller: the person seeking to sell the auction lot. |
Winning bidder: the bidder whose bid is the standing bid at the bidding end time for the auction. |
The auction lifecycle is defined by the following times, declared by the seller when the auction is announced:
|
|
|
|
|
For the purposes of modeling the state transitions of the auction, we partition time into periods () by the above lifecycle times:
|
|
|
|
|
|
flowchart LR
p0[Pre-auction] --> p1
p1[Pre-bidding] --> p2
p2[Bidding] --> p3
p3[Voucher active] --> p4
p4[Voucher expired] --> p5
p5[Cleanup]
classDef default font-size:90%, overflow:visible;
An auction can be modelled by the following state machine.
Here we use the UML statechart formalism,
whereby each transition is labelled as
input [condition]
.
A conjunction of multiple conditions is labelled
as [condition1, condition2, ...]
.
We omit the outputs of each state transition.
stateDiagram-v2
[*] --> Announced: AnnounceAuction [P0]
Announced --> BiddingOnL1: StartBidding [P2]
BiddingOnL1 --> BiddingOnL2: CommitStandingBid [P2, HI]
BiddingOnL1 --> VoucherActive: [P3]
BiddingOnL2 --> BiddingOnL1: FanoutStandingBid [P2]
BiddingOnL2 --> VoucherActive: FanoutStandingBid [P3]
VoucherActive --> Concluded: BidderBuys [P3]
VoucherActive --> VoucherExpired: [P4]
VoucherExpired --> Concluded: SellerReclaims [P4 ∪ P5]
Concluded --> [*]: Cleanup [P5]
The state transitions are as follows:
|
|
|
|
|
|
|
|
|
|
We use a separate state machine to represent a bidder deposit, because the auction does not interact with bidder deposits directly. Instead, the state of the auction can be referenced to enable certain state transitions in the bidder deposit state machine.
Conversely, while the seller may observe which bidders have created deposits for the auction to decide on the list of approved bidders at bidding start, this is not enforced by on-chain code so we represent this as an arbitrary decision by the seller in the auction state machine.
stateDiagram-v2
[*] --> Announced: AnnounceAuction [P0]
Announced --> Deposited: CreateDeposit [P1]
Deposited --> [*]: BidderBuys [W, P3]
Deposited --> [*]: SellerClaims [W, P4]
Deposited --> [*]: RefundDeposit [¬W, P3 ∪ P4]
Deposited --> [*]: RefundDeposit [P5]
The state transitions are as follows:
|
|
|
|
|
|
We use a separate state machine for the fee escrow because, while it gets initialized during a state transition of the auction, its further evolution proceeds independently from the auction.
stateDiagram-v2
[*] --> FeesDeposited: BidderBuys [P3]
[*] --> FeesDeposited: SellerReclaims [P4 ∪ P5]
FeesDeposited --> [*]: DistributeFees
The state transitions are as follows:
|
|
|