Skip to content

most basic nft minting is now failing #299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
reitcircles opened this issue Jan 31, 2024 · 9 comments
Closed

most basic nft minting is now failing #299

reitcircles opened this issue Jan 31, 2024 · 9 comments

Comments

@reitcircles
Copy link

Describe the bug
Standard example from tutorials fails to execute

To Reproduce

  1. download https://github.com/Python-Cardano/pycardano/blob/main/examples/native_token.py
  2. then run it first time to get the address : in my case addr_test1vzwy2qavznsp3lgut03hp62vyde6y8ttjh3plwk6ds3y4zg37je5g
  3. The use the faucet from cardano to transfer some tADA
  4. Check using cardano-cli the utxo

Logs
` TxHash TxIx Amount

a0facadf037b67622c0099de4f0828bcc81efb910efec8b73e9250044e93712f 0 10000000000 lovelace + TxOutDatumNone`

  1. Now that tADA is there in the wallet, try to mint the NFT
  2. Following error happens: pycardano.exception.UTxOSelectionException: All UTxO selectors failed. inside the function: signed_tx = builder.build_and_sign([payment_skey, policy_skey], change_address=address)
  3. Such a basic thing is now giving error ...something is wrong ...

Expected behavior
Should have just minted the NFT tokens

Environment and software version (please complete the following information):

  • OS:
  • Distributor ID: Ubuntu
  • Description: Ubuntu 20.04.6 LTS
  • Release: 20.04
  • PyCardano Version [0.9.0]

Additional context
None

@cffls
Copy link
Collaborator

cffls commented Feb 11, 2024

I saw a few success NFT mint transactions under your account: https://preview.cardanoscan.io/address/609c4503ac14e018fd1c5be370e94c2373a21d6b95e21fbada6c224a89

Is the issue resolved now?

@theeldermillenial
Copy link
Contributor

theeldermillenial commented Apr 3, 2024

I am also running into this issue. I think the problem is that it is trying to find input UTxOs for the newly minted native tokens.

edit: I am nearly certain that this is the case. We should probably consider adding in the ability to ignore certain multiassets so that newly minted assets can be ignored when trying to meet the output UTxO fulfillment requirements.

@theeldermillenial
Copy link
Contributor

Okay, I'm going to add a mint_assets input to the coin selection algos. It will be a MultiAsset that includes the number of assets that will be minted, and will be subtracted from the total_requested component of the algos.

@cffls @nielstron Do you see any potential issues with this?

@nielstron
Copy link
Contributor

nielstron commented Apr 11, 2024

AFAIK all minted tokens are considered as inputs in the tx builder, I think there is no need for explicitly adding them to the coin selection

@nielstron
Copy link
Contributor

@cffls
Copy link
Collaborator

cffls commented Apr 11, 2024

Agreed with @nielstron , all token minted will be provided to tx builder automatically. I am still not sure what the root cause was for this issue. The first thing came to my mind was the chain context, e.g. blockfrost, wasn't in sync with the tip of chain, so it couldn't find the utxo from the new account. If this happens in the future, please post a full log from pycardano, from which we can tell what exactly failed. For example, if UTXO selection failed, it will tell what UTXOs were provided, and what failed to fulfill, see here.

@theeldermillenial
Copy link
Contributor

Well, I'm glad I asked first. This was super helpful. My issue is separate from what was reported here then.

I'm building pycardano into a backend application, where the frontend gives me the utxos from a wallet. Because I already have the utxos and I've almost completely removed blockfrost from the workflow, I had to create a custom utxo selection loop outside of the builder because the builder will hit blockfrost for utxos any time non-ada assets are in the outputs.

With the link provided by @nielstron, I can fix this. However, I wonder if there might be a better solution to the current build workflow so that coin selection doesn't force a context call to get utxos.

@nielstron
Copy link
Contributor

nielstron commented Apr 11, 2024

If you do not provide an input address there should be no call to fetch UTxOs from the chain? If at all that call would be triggered by fee calculation, not presence of tokens. Check out #204 if you don't want to spend all utxos of the wallet

@nielstron
Copy link
Contributor

I would like to close this issue actually because the discussion appears to diverge. @theeldermillenial please re-open a new issue with the full error log when you encounter this issue again and feel free to open an enhancement issue if you feel like the building needs some improvements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants