0

I m starting to get into coding, and I did not manage to find an answer to this question. When you buy an nft you are asked to send an X amount of ada to a wallet, and then few min after the website automatically sends you the nft. How do I begin to learn how to do it myself?

1

1 Answer 1

0

I will try to answer this question as there are a few ways this could be happening. So far, I've seen the following

  • Cardano Smart Contract (most decentralized solution and preferred)
  • Minting Machine (very centralized and code cannot be verified)
  • Manually sending

Cardano smart contracts - There is an onchain portion and and off chain portion to consider but in general you can consume a utxo at a smart contract address by simply sending a transaction that meets the contracts parameters for successful validation. When you send ada, you are creating a transaction and submitting it. The smart contract verifies that you have met the requirements and the NFT gets transferred to your wallet. (This is made more seamless with a wallet connector. Connecting a wallet and signing the transaction on the site can trigger the submit and execute the smart contract)

Minting Machines - I've seen a lot of these around and I don't like them as they are not really part of of the blockchain. It's a bash script that gets executed if it detects a deposit of ada coming into an address. Some of the ada that comes in is used to build a transaction to mint the nft. Then another transaction to send the nft to the buyers address is created and sent to the original sender.

Manual - As a developer, I've gotten request to do this manually until they build out one of the other options listed above. My recommendation is to learn the cardano-cli and try some transactions on a node. Then learn haskell and plutus to build smart contracts.

2
  • Per his description, I think he means the second option (minting machine), since he sends X amount of ADA to an address, instead of consuming a script
    – Mateus
    Commented Apr 2, 2022 at 12:30
  • And with smart contracts you lose a critical feature: you know exactly what NFT you are buying, so there is no randomness behind the scenes
    – Mateus
    Commented Apr 2, 2022 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.