On-Chain Code Explained: A Deep Dive into the Auction Validator Use Case

In this example, a seller wants to auction some asset she owns, represented as a non-fungible token (NFT) on Cardano. She would like to create and deploy an auction smart contract with the following properties:

  • there is a minimum bid amount
  • each bid must be higher than the previous highest bid (if any)
  • once a new bid is made, the previous highest bid (if exists) is immediately refunded
  • there is a deadline for placing bids; once the deadline has passed, new bids are no longer accepted, the asset can be transferred to the highest bidder (or to the seller if there are no bids), and the highest bid (if exists) can be transferred to the seller.

This process is broken down into five main stages:

  1. Generating Keys and Addresses: This initial step involves creating unique cryptographic keys and corresponding addresses for each participant in the auction, such as the seller and bidders. These keys and addresses are essential for identifying and authorizing participants within the blockchain network. Plutus
  2. Getting Funds from the Faucet: Participants need to obtain test ADA (Cardano’s cryptocurrency) to cover transaction fees and place bids. This is achieved by requesting funds from a faucet, which is a service that provides free tokens for testing purposes. Plutus
  3. Minting the Token to be Auctioned: Before the auction can commence, the seller must create (or “mint”) the digital token that will be auctioned. This process involves defining the token’s properties and recording its existence on the blockchain.
  4. Placing Bids: Once the token is minted, bidders can participate by submitting their offers. Each bid is a transaction that includes the bid amount and is recorded on the blockchain, ensuring transparency and security. Plutus
  5. Closing the Auction: After the auction’s designated end time, the process concludes by finalizing the highest bid. The token is transferred to the winning bidder, and the bid amount is sent to the seller, completing the transaction. Plutus

Do you know what staking is ? Staking on the blockchain refers to the process where participants lock up a certain amount of cryptocurrency to support the operations and security of a blockchain network. In return, they earn rewards, typically in the form of additional cryptocurrency. Staking is often associated with proof-of-stake (PoS) or similar consensus mechanisms used by many blockchains.

INVEST

Partners :

INVEST IN CRYPTO.COM

INVEST IN LEDGER.COM

Cardano Use Case : Creation of a custom academic credentialing solution with Identus

Advertisements