<p>Code for minting Spacebudz is actually open-source, so you could probably use that with a bit of tweaking.</p>
<p>As far as I know this code should basically mint tokens in order for every new transaction back to the transaction sender.</p>
<p>Here's the link to source repo: <a href="https://github.com/Berry-Pool/nft-server" rel="nofollow noreferrer">https://github.com/Berry-Pool/nft-server</a></p>

CC BY-SA 4.0
2021-10-12T07:57:00.260Z
2021-10-12T07:57:00.260Z
pyropy
<p>setting up the cardano node is very simple, and once set-up, as long as your resource is available, the node stays up-to-date with the blockchain. The CoinCashew tutorial (<a href="https://www.coincashew.com/coins/overview-ada/guide-how-to-build-a-haskell-stakepool-node#14-configure-your-topology-files" rel="nofollow noreferrer">https://www.coincashew.com/coins/overview-ada/guide-how-to-build-a-haskell-stakepool-node#14-configure-your-topology-files</a>) is great for this &amp; there are a number of YouTube videos that explain what do to do too (although tip from my experience, avoid DigitalOcean as a provider for VMs).</p>
<p>I then used this tutorial (<a href="https://developers.cardano.org/docs/native-tokens/minting/" rel="nofollow noreferrer">https://developers.cardano.org/docs/native-tokens/minting/</a>), to mint NFTs using the cardano-cli &amp; it worked great. I would imagine that based on this, it shouldn't be too complicated to derive a script to do it automatically.</p>
<p>Unfortunately, I cannot help you on your &quot;minting on payment&quot; answer as I am also just beginning to look into this. Also, I'm sure the new smart contracts would have that functionality?</p>

CC BY-SA 4.0
2021-09-23T12:33:15.560Z
2021-09-23T12:33:15.560Z
simon
<p>Look into dbsync as that is how you can actually look at transactions and not just the txhashes.</p>
<p>Basic setup would be dbsync server (postgres) + cnode (cli || wallet):</p>
<p><em><strong>dbsync</strong></em></p>
<ol>
<li>query slot every couple seconds to see if new block (new block means new potential transactions)</li>
<li>if new block, then grab any new transactions that meet your criteria (verify the amount of ada and grab the addr)</li>
</ol>
<p><em><strong>cli / wallet</strong></em></p>
<ol start="3">
<li>Send to minting script and mint and send in same tx :)</li>
</ol>
<p><em>side notes</em></p>
<ul>
<li>either mint 1 at a time, or do about 30 at a time in one tx.</li>
<li>If you need to do more then 30 you will need multiple addresses. To make this work the address you are sending too is different from the addresses you will be minting from. Assuming thousands of requests per block, you could mint 1200 NFTs, with 40 addresses, just need to keep track of them all</li>
</ul>

CC BY-SA 4.0
2022-02-08T20:28:00.850Z
Instead of using db-sync and querying transaction data, why can't you just query for the UTxOs at the receiving wallet address?  You could repeat this query on regular time interval.  I'm just curious why you suggested using db-sync?
Kurt Hartmann
CC BY-SA 4.0
2021-10-12T06:31:24.177Z
2021-10-12T06:31:24.177Z
George Mueller
<p>[REPOST: https://cardano.stackexchange.com/questions/4891/is-there-an-open-source-vending-machine-script-for-nft-minting]</p>
<p>We open-sourced one of these on GitHub here: <a href="https://github.com/thaddeusdiamond/cardano-nft-vending-machine" rel="nofollow noreferrer">https://github.com/thaddeusdiamond/cardano-nft-vending-machine</a></p>
<p>It's written in Python but requires no cardano-node (only cardano-cli and a Blockfrost key). There's also a sample script in main.py to show how to use it (or just invoke that script from CLI). Our PFP mint was done on my Macbook Pro. Hopefully that helps!</p>

CC BY-SA 4.0
2022-06-16T18:29:50.767Z
2022-06-16T18:29:50.767Z
iOddestHumanDad
<p>You can also use <a href="https://Bakrypt.io" rel="nofollow noreferrer">Bakrypt.io</a> which is an API specially made for minting Cardano Tokens (NFTs and Fungible Tokens) individually or in bulk. Hence, creating collections of thousands of assets at once. <a href="https://bakrypt.io" rel="nofollow noreferrer">Bakrypt.io</a> also supports Royalties following CIP-0027 standards.</p>
<p>Opening an account is free, meaning you only pay for confirmed transactions. The free tier offers up to 1gb in IPFS storage for free.</p>

CC BY-SA 4.0
2022-02-23T03:12:52.320Z
If you have a connection to a commercial product mentioned in your post it should be declared or explicitly denied.  See guidelines in help.
gRebel
CC BY-SA 4.0
2022-02-22T01:44:38.957Z
2022-02-23T03:15:20.160Z
2022-02-23T03:15:20.160Z
Wolfy
<p>this is what i have written,</p>
<p><a href="https://forum.cardano.org/t/auto-sell-and-send-tokens/94280/2" rel="nofollow noreferrer">https://forum.cardano.org/t/auto-sell-and-send-tokens/94280/2</a></p>
<p>my next step is to bring NFT auto minting.
is not huge difference to mint from sending the NFT.</p>
<p>if you want, contact me and we can work together on this.</p>

CC BY-SA 4.0
2022-02-23T10:39:36.710Z
2022-02-23T10:39:36.710Z
TTS17
<p>I wish to write a script that will automatically mint NFTs given payment to an address.
Firstly, I haven't found anyone that has shown how to do this, but if anyone has, or is willing to share, please let me know.</p>
<p>I notice the tutorial here suggests using cardano-cli, however, this requires cardano-node to be running which seems very brittle to me, because if you have issues keeping up with the current state of the blockchain, then you'll miss out on payments.
<a href="https://developers.cardano.org/docs/integrate-cardano/listening-for-payments-cli/" rel="noreferrer">https://developers.cardano.org/docs/integrate-cardano/listening-for-payments-cli/</a></p>
<p>Would using cardano-wallet be a better or safer option to listen for transactions?</p>
<p>What would be the steps to automatically minting NFTs based on payment?
And would anyone have any recommendations on how you'd host the script once you've written it? Would you have cardano-node constantly running in a virtual machine (e.g. EC2 instance).</p>

<cardano-cli><cardano-node><nft>
Minting NFT automatically based on transaction
# Minting NFT automatically based on transaction

(Asked by: username_0 on 2021-09-23)

I wish to write a script that will automatically mint NFTs given payment to an address.
Firstly, I haven't found anyone that has shown how to do this, but if anyone has, or is willing to share, please let me know.

I notice the tutorial here suggests using cardano-cli, however, this requires cardano-node to be running which seems very brittle to me, because if you have issues keeping up with the current state of the blockchain, then you'll miss out on payments.
<https://developers.cardano.org/docs/integrate-cardano/listening-for-payments-cli/>

Would using cardano-wallet be a better or safer option to listen for transactions?

What would be the steps to automatically minting NFTs based on payment?
And would anyone have any recommendations on how you'd host the script once you've written it? Would you have cardano-node constantly running in a virtual machine (e.g. EC2 instance).

**Tags:** cardano-cli, cardano-node, nft

---

## 6 answers

### Answer by username_1 on 2021-10-12. Score: 2

Code for minting Spacebudz is actually open-source, so you could probably use that with a bit of tweaking.

As far as I know this code should basically mint tokens in order for every new transaction back to the transaction sender.

Here's the link to source repo: <https://github.com/Berry-Pool/nft-server>


---

### Answer by username_2 on 2021-09-23. Score: 2

setting up the cardano node is very simple, and once set-up, as long as your resource is available, the node stays up-to-date with the blockchain. The CoinCashew tutorial (<https://www.coincashew.com/coins/overview-ada/guide-how-to-build-a-haskell-stakepool-node#14-configure-your-topology-files>) is great for this & there are a number of YouTube videos that explain what do to do too (although tip from my experience, avoid DigitalOcean as a provider for VMs).

I then used this tutorial (<https://developers.cardano.org/docs/native-tokens/minting/>), to mint NFTs using the cardano-cli & it worked great. I would imagine that based on this, it shouldn't be too complicated to derive a script to do it automatically.

Unfortunately, I cannot help you on your "minting on payment" answer as I am also just beginning to look into this. Also, I'm sure the new smart contracts would have that functionality?


---

### Answer by username_3 on 2021-10-12. Score: 1

Look into dbsync as that is how you can actually look at transactions and not just the txhashes.

Basic setup would be dbsync server (postgres) + cnode (cli || wallet):

***dbsync***

1. query slot every couple seconds to see if new block (new block means new potential transactions)
2. if new block, then grab any new transactions that meet your criteria (verify the amount of ada and grab the addr)

***cli / wallet***

3. Send to minting script and mint and send in same tx :)

*side notes*

* either mint 1 at a time, or do about 30 at a time in one tx.
* If you need to do more then 30 you will need multiple addresses. To make this work the address you are sending too is different from the addresses you will be minting from. Assuming thousands of requests per block, you could mint 1200 NFTs, with 40 addresses, just need to keep track of them all

> **Comments:**
> **username_4**: Instead of using db-sync and querying transaction data, why can't you just query for the UTxOs at the receiving wallet address?  You could repeat this query on regular time interval.  I'm just curious why you suggested using db-sync?  

---

### Answer by username_5 on 2022-06-16. Score: 0

[REPOST: https://cardano.stackexchange.com/questions/4891/is-there-an-open-source-vending-machine-script-for-nft-minting]

We open-sourced one of these on GitHub here: <https://github.com/thaddeusdiamond/cardano-nft-vending-machine>

It's written in Python but requires no cardano-node (only cardano-cli and a Blockfrost key). There's also a sample script in main.py to show how to use it (or just invoke that script from CLI). Our PFP mint was done on my Macbook Pro. Hopefully that helps!


---

### Answer by username_6 on 2022-02-22. Score: 0

You can also use [Bakrypt.io](https://Bakrypt.io) which is an API specially made for minting Cardano Tokens (NFTs and Fungible Tokens) individually or in bulk. Hence, creating collections of thousands of assets at once. [Bakrypt.io](https://bakrypt.io) also supports Royalties following CIP-0027 standards.

Opening an account is free, meaning you only pay for confirmed transactions. The free tier offers up to 1gb in IPFS storage for free.

> **Comments:**
> **username_7**: If you have a connection to a commercial product mentioned in your post it should be declared or explicitly denied.  See guidelines in help.  

---

### Answer by username_8 on 2022-02-23. Score: 0

this is what i have written,

<https://forum.cardano.org/t/auto-sell-and-send-tokens/94280/2>

my next step is to bring NFT auto minting.
is not huge difference to mint from sending the NFT.

if you want, contact me and we can work together on this.


---

