text:
Is there an open source vending-machine script for NFT minting?
Many projects either use a vending-machine service like NFT-Maker PRO or buffybot or have built their own vending-machine scripts.
Is there any open-source vending machine script that can be connected to a cardano-node to mint NFTs when a UTxO arrives on a specific address?

Here is my version of a vending machine:

Upgraded with metadata creation
"Completed" counter backed up in a *.txt file so if the machine restarts the script does not start minting from the beginning
You should create your own Blockfrost project
Picture uploaded to Infura
Sorry for the Hungarian comments

#!/bin/bash

cd /opt/cardano/cnode/priv/wallet/cpostal
looping=1
log=log_file.txt
txs=txs.txt
numberCompleted=`cat numbercompleted.txt`

# ez lesz raymond címe, most a sajátom
donationAddr=`cat rajmond_yoroi_address`

# erre a címre várjuk a befizetéseket
paymentAddr=`cat payment.addr`

paymentSignKeyPath=./payment.skey
policySignKeyPath=./policy/policy.skey
scriptPath=./policy/policy.ada.2.120.script

POLICYID=$(cardano-cli transaction policyid --script-file $scriptPath) > policy/policyID

# ez az én yoroi-s stake címem
profitAddr=`cat yoroi_address`

echo "" >> $txs
echo "" >> $log
echo "Log File" >> $log
echo "-------------------" >> $log
echo "Process started at: $(date +%T)" >> $log
echo "-------------------" >> $log
echo "" >> $log

arcedula=50000000 # ennyit kérünk ezért az NFT-ért

trap 'looping=0;wait' INT TERM

while (( looping )); do
    echo ==================================================================================
    cardano-cli query utxo --address $paymentAddr --mainnet > fullUtxo.out
    tail -n +3 fullUtxo.out | sort -k3 -nr > balance.out
    cat balance.out
    while read -r utxo; do
        sleep 5s
    #echo "UTXO detected" >> $log
        tx_hash=$(awk '{ print $1 }' <<< "${utxo}")
    echo "TXHash: "$tx_hash
    idx=$(awk '{ print $2 }' <<< "${utxo}")
        utxo_balance=$(awk '{ print $3 }' <<< "${utxo}")
    tx_in="--tx-in ${tx_hash}#${idx}"
    if [ $( grep -q "${tx_hash}" "$txs" && echo $? ) ];
    then
       # echo "Previous tx" >> $log
        echo "nem trténr  utalás"
        break
    else
        echo ${tx_hash} >> $txs
        echo "utalás trtént"
        echo "A küldő cím: " >> $log
        echo $(curl -H 'project_id: *********' \
                https://cardano-mainnet.blockfrost.io/api/v0/txs/${tx_hash}/utxos \
                | jq '.inputs' | jq '.[0]' | jq '.address') >> $log
            in_addr=$(curl -H 'project_id: *********' \
                https://cardano-mainnet.blockfrost.io/api/v0/txs/${tx_hash}/utxos \
                | jq '.inputs' | jq '.[0]' | jq '.address' | sed 's/^.//;s/.$//')
            echo "Address: ${in_addr}"
        echo "utalás értéke: "$utxo_balance
            if [ ${utxo_balance} != $arcedula ] || [ $(ls "/opt/cardano/cnode/stamps/s1/" | wc -l) == 0 ];
            then
            echo ${utxo_balance} >> $log
            echo "Refund Initiated..." >> $log
        echo `date` >> $log
        echo "Pénzvisszafizetés"
            currentSlot=$(cardano-cli query tip --mainnet | jq -r '.slot')
                cardano-cli transaction build-raw \
                    --fee 0 \
                    ${tx_in} \
                    --tx-out ${in_addr}+${utxo_balance} \
                    --invalid-hereafter $(( ${currentSlot} + 1000)) \
                    --out-file tx.tmp >> $log
                fee=$(cardano-cli transaction calculate-min-fee \
                    --tx-body-file tx.tmp \
                    --tx-in-count 1 \
                    --tx-out-count 1 \
                    --mainnet \
                    --witness-count 1 \
                    --byron-witness-count 0 \
                    --protocol-params-file protocol.json | awk '{ print $1 }') >> $log
                echo "Fee:"$fee >> $log
        fee=${fee%" Lovelace"}
                amountToSendUser=$(( ${utxo_balance}-${fee} ))
            echo ${amountToSendUser} >> $log
                cardano-cli transaction build-raw \
                    --fee ${fee} \
                     ${tx_in} \
                    --tx-out ${in_addr}+${amountToSendUser} \
                    --invalid-hereafter $(( ${currentSlot} + 1000)) \
                    --out-file tx.raw >> $log
echo "Pénz visszküldés submit" >> $log
         cardano-cli transaction sign \
                    --signing-key-file $paymentSignKeyPath \
                    --tx-body-file tx.raw \
                    --out-file tx.signed \
                    --mainnet >> $log
echo "Pénz visszaküldés submit" >> $log
                cardano-cli transaction submit --tx-file tx.signed --mainnet >> $log

# *******************************************NFT MINT *************************************
            else
            echo ========================================================= >> $log
        echo ======================== ÚJ NFT ========================= >> $log
        echo ========================================================= >> $log
        echo "Sending NFT..." >> $log
        echo `date` >> $log
            numberCompleted=$(( numberCompleted+1 ))
        echo "Token száma: $numberCompleted" >> $log
        echo $numberCompleted > numbercompleted.txt
#           POLICYID=$(cardano-cli transaction policyid --script-file $scriptPath) ezt beépítetem az elejére, de ha minden nFT küln policit kapna akkor ide kell

#*********************** metadata gerebléyzés *****************

  tokenname=`cat /opt/cardano/cnode/stamps/s1/Stamp_Ada_$numberCompleted.png.ipfs.txt | awk -F'"' {'print $4 '} | awk -F'.' {'print $1'} | sed -e 's/_//g'`
tokennameID=`cat /opt/cardano/cnode/stamps/s1/Stamp_Ada_$numberCompleted.png.ipfs.txt | awk -F'"' {'print $4 '} | awk -F'_' {'print $3'} | awk -F'.' {'print $1'} | sed 's/^0*//'`
  ipfs_hash=`cat /opt/cardano/cnode/stamps/s1/Stamp_Ada_$numberCompleted.png.ipfs.txt | awk -F'"' {'print $8 '}`
echo "tokenname:" $tokenname >> $log
echo "tokennameID:" $tokennameID >> $log
echo "Poolpm név:"$POLICYID"."$tokenname >> $log

echo "{">> $tokenname"metadata.json"
echo "      \"721\": { ">> $tokenname"metadata.json"
echo "           \"$POLICYID\": { ">> $tokenname"metadata.json"
echo "              \"$tokenname\": { ">> $tokenname"metadata.json"
echo "                \"description\": \"CARDANO POSTAL SERVICE STAMP\"," >> $tokenname"metadata.json"
echo "                \"name\": \"Ada Lovelace stamp $tokennameID\"," >> $tokenname"metadata.json"
echo "                \"id\": $tokennameID, ">> $tokenname"metadata.json"
echo "                \"creator\": \"Ildiko Kovacs\"," >> $tokenname"metadata.json"
echo "                \"image\": \"ipfs://$ipfs_hash\"," >> $tokenname"metadata.json"
echo "                \"url\": \"https://cardanopostalservice.io\"" >> $tokenname"metadata.json"
echo "              }" >> $tokenname"metadata.json"
echo "            }">> $tokenname"metadata.json"
echo "        }" >> $tokenname"metadata.json"
echo "}">> $tokenname"metadata.json"
metadatajson="${tokenname}metadata.json"

echo ================
echo "mintelési adatok"
echo "tokenname:" $tokenname
echo "tokennameID:" $tokennameID
#cat $metadatajson

# **************** Bevétel szétdobása ********************

       amountToSendUser=1800000
((amountToDonate = arcedula * 5 / 100)) # ez magy rajmondnak

((amountToSendProfit = arcedula - amountToDonate - amountToSendUser))  # ez megy szabinak

echo 'vegleges szamok:'
echo 'arcedula:' $arcedula
echo 'amount to send profit:' $amountToSendProfit
echo 'amount to send user:' $amountToSendUser
echo 'amount to donate:' $amountToDonate

                currentSlot=$(cardano-cli query tip --mainnet | jq -r '.slot')
                cardano-cli transaction build-raw \
                    --fee 0 \
                    ${tx_in} \
                    --tx-out ${in_addr}+${amountToSendUser}+"1 $POLICYID.${tokenname}" \
                    --tx-out ${profitAddr}+${amountToSendProfit} \
            --tx-out ${donationAddr}+${amountToDonate} \
            --mint="1 $POLICYID.${tokenname}" \
            --minting-script-file $scriptPath \
            --metadata-json-file ${metadatajson} \
                    --invalid-hereafter $(( ${currentSlot} + 10000)) \
                    --out-file tx.tmp >> $log
                fee=$(cardano-cli transaction calculate-min-fee \
                    --tx-body-file tx.tmp \
                    --tx-in-count 1 \
                    --tx-out-count 3 \
                    --mainnet \
                    --witness-count 2 \
                    --byron-witness-count 0 \
                    --protocol-params-file protocol.json | awk '{ print $1 }') >> $log
            fee=${fee%" Lovelace"}
                amountToSendUser=$((${amountToSendUser}-${fee}))
                cardano-cli transaction build-raw \
                    --fee ${fee} \
                    ${tx_in} \
                    --tx-out ${in_addr}+${amountToSendUser}+"1 $POLICYID.${tokenname}" \
                    --tx-out ${profitAddr}+${amountToSendProfit} \
            --tx-out ${donationAddr}+${amountToDonate} \
            --mint="1 $POLICYID.${tokenname}" \
                    --minting-script-file $scriptPath \
            --metadata-json-file ${metadatajson} \
                    --invalid-hereafter $(( ${currentSlot} + 10000)) \
                    --out-file tx.raw >> $log

echo 'amount to send user minusz fee:' $amountToSendUser
echo "Fee:"$fee

echo "NFT küldés aláírás" >> $log
                cardano-cli transaction sign \
                  --signing-key-file $paymentSignKeyPath \
               --signing-key-file $policySignKeyPath \
                  --tx-body-file tx.raw \
                  --out-file tx.signed \
                  --mainnet >> $log
echo "NFT küldés submit" >> $log
              cardano-cli transaction submit --tx-file tx.signed --mainnet >> $log

echo "============= mintelés vége ============="
echo
            fi
            rm tx.*
        echo "====bejegyzés vége====" >> $log
        fi
     done < balance.out

  wait
done

I hope it help,
cheers!

You may be interested in this MIT licensed Cardano NFT vending machine bash script available on GitHub. It hasn't been updated in 6 months, but you can fork it from the ftpmorph repo and audit to see if it does what you need.

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!


text:
Is there an easy way to see how many NFT's exist on the Cardano blockchain?
I would like to get the number of all NFT's ever created on Cardano. This means all native assets with a supply of 1. Is there a website where I can find this information or are there tools that can achieve this?
I don't mind running my own node for this, if there is no other way.

Check https://pool.pm/tokens which seems to provide the total at the top of the page.

Also you can fetch them all from blockFrost with this end point
https://cardano-mainnet.blockfrost.io/api/v0/assets
For a detailed explanation here is the Link
https://docs.blockfrost.io/#tag/Cardano-Assets/paths/~1assets/get

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
How can I use cardano-serialization-lib in the browser to decode CBOR?
I'm building a simple website with pure HTML and JS (no React, Angular, etc.). I use Nami to connect to a Cardano wallet and use the Nami's cardano.getBalance() method to get the balance of the wallet.
This output (as most of the outputs of Nami) is CBOR encoded. I used https://cbor.me/ to decode it manually but I need to be able to do this in code to be able to work with the values.
Nami's README says to use the cardano-serialization-lib to do this. So I tried to use it but there is no documentation on how to actually use it.
Here's what I've done so far:
<html>
  <head>
    <!-- Cardano Serialization Lib -->
    <script
      type="module"
      src="https://cdn.jsdelivr.net/npm/@emurgo/cardano-serialization-lib-asmjs@9.1.2/cardano_serialization_lib_bg.min.js"
    ></script>
    <script
      type="module"
      src="https://cdn.jsdelivr.net/npm/@emurgo/cardano-serialization-lib-asmjs@9.1.2/cardano_serialization_lib.asm.min.js"
    ></script>
    <script
      type="module"
      src="https://cdn.jsdelivr.net/npm/@emurgo/cardano-serialization-lib-asmjs@9.1.2/cardano_serialization_lib.min.js"
    ></script>
  </head>
  <body>
    <script>
      function f() {
        window.cardano.enable().then((a) => {
          console.log(a);
          window.cardano.getBalance().then((b) => console.log(b));
        });
      }
      setTimeout(f, 1000); // wait for cardano object to be injected
    </script>
  </body>
</html>

I included the cardano-serialization-lib-browser using jsdelivr.com. Now the goal is to use this library to deserialize the output of cardano.getBalance().
My problems are:

I don't know how to call the library in my JS code.
I don't know what functions to use to deserialize CBOR as there is no documentation.

Any help would be highly appreciated.

With the help of Samuel's answer, I have been able to get it running.
Some important things I didn't know:

import from CDN has to be done with the full url.
The library has to be imported inside of my script, not in the <head>.

Here's the working example:
<html>
  <head>
    <!-- Cardano Serialization Lib -->
    <script
      type="module"
      src="https://cdn.jsdelivr.net/npm/@emurgo/cardano-serialization-lib-asmjs@9.1.2/cardano_serialization_lib_bg.min.js"
    ></script>
    <script
      type="module"
      src="https://cdn.jsdelivr.net/npm/@emurgo/cardano-serialization-lib-asmjs@9.1.2/cardano_serialization_lib.asm.min.js"
    ></script>
  </head>
  <body>
    <script type="module">
      import * as wasm from "https://cdn.jsdelivr.net/npm/@emurgo/cardano-serialization-lib-asmjs@9.1.2/cardano_serialization_lib.min.js";

      function hexToBytes(hex) {
        for (var bytes = [], c = 0; c < hex.length; c += 2)
          bytes.push(parseInt(hex.substr(c, 2), 16));
        return bytes;
      }

      function f() {
        console.log("hello");
        window.cardano.enable().then((a) => {
          console.log(a);
          window.cardano.getBalance().then((res) => {
            const balance = wasm.Value.from_bytes(hexToBytes(res));
            const lovelaces = balance.coin().to_str();

            console.log(lovelaces);
          });
        });
      }
      setTimeout(f, 1000);
    </script>
  </body>
</html>

CBOR is a serialization standard that's unrelated to the blockchain tooling itself. For nodejs, you can use something like https://github.com/paroga/cbor-js to encode/decode the CBOR.

I had a look at this library but it was last updated in 2015 and seems like it's not maintained anymore. And besides that I'll need some cardano specific functionality later like building transactions etc. Therefore I need to use cardano-serialization-lib.

Ah, your question didn't make it clear what you were trying to do. I thought you just wanted cbor.me equivalent in your code (which serialization lib doesn't provide). I'm not aware of any sort of balance object but for example the transaction class has a from_bytes method. See https://github.com/Emurgo/cardano-serialization-lib/blob/531e8cc2991c73edc19392558909ebb5a233b77d/rust/pkg/cardano_serialization_lib.js.flow#L4755

It's a Value type it returns. See https://cardano.stackexchange.com/questions/4112/nami-wallet-showing-getbalance-returning-a-nan which is a duplicate of this question.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Why is ADA locked up with native assets and can it be detached from the native assets?
In Yoroi I can see that there is some ADA locked up with my native assets:

Can I spend this ADA without the native asset? If I would not care about the native asset, could I create a transaction that only spends the ADA and not the asset?

In Cardano, each UTXO can contain a heterogeneous mixture of tokens and data, but must contain at least some amount of ADA. This is done on purpose to prevent both inadvertent and malicious chain bloat. Read more about the intricacies of minUTXOvalues here.
On your Yoroi wallet, you probably have a couple UTXO's with token data such that the min amount of ADA in each of those UTXO's totals to the locked amount displayed to you by Yoroi. In your case, it's not much, but if you want to free up the ADA you can always consolidate your assets into fewer UTXOs.

On Cardano you cannot transfer or own native assets (i.e. any token other than Ada) without having it combined with a certain amount of Ada. This amount of Ada is called the minimum Ada value needed and it depends on the byte size of the native tokens. Native tokens with large token names have a large byte size, those with small token names a small byte size. This constraint ensures that the total byte size of the ledger (all unspent funds of all wallets) has a maximum value and thus does not explode.
So, as long as you keep your native assets, you cannot spend the minimum Ada amount. Also, if you want to transfer your native assets in a simple transaction you need to send them together with this minimum Ada value.

authors: DryEaz 抽濕機專門店

authors: TIGER 虎牌網上商店


text:
What are the protocol magic values for the preview and preprod test networks?
The cardano testnet has a protocol/testnet magic value of 1097911063.
Where do I find this value for the preprod and preview test networks?

You can check the byron or shelley genesis files for protocolMagic or networkMagic respectively.
Genesis files for each network can be found here: https://book.world.dev.cardano.org/environments.html

networkMagic from the Shelley genesis files: Preview: 2, Preprod: 1


text:
Is there a limit on how many distinct tokens can be sent in one transaction?
Let's say someone has 10'000 different tokens on one address. Each token is in a single UTxO. Would it be possible to send them all in one transaction to another address (or the same address), so they are all in one UTxO? Or is there a limit on how many distinct tokens one can send in a single transaction?

The maximum transaction size is specified in the genesis configuration of the chain. For reference, here is a genesis config for the Shelley Testnet.
The maxTxSize is set to 16384 (bytes, I assume).
"maxTxSize": 16384,

So. Yes, there is definitely a limit to how many different tokens you could include in a UTxO.
This doesn't answer the question on limits to the number of inputs for a transaction. Obviously these couldn't result in an output larger than maxTxSize, but I can't say if there are additional constraints on the number of inputs. I'm curious to know so I might keep looking. In the mean time, I hope that helps.

We can simulate this in the playground. I set up three tokens T1,T2 and T3 and gave one of each to Wallet 1 at the beginning.
Then I sent three separate transactions, sending each token in its own transaction to Wallet 2, resulting in 3 new UTxOs in Wallet 2, one for each token.
I then paid all the tokens back to Wallet 1 in a single transaction.
If you zoom in on the image, you can see that there are four inputs, which are the lovelace for fees plus one UTxO for each token. One of the outputs to Wallet 1 is a single UTxO with all three tokens included. The other output is the change given back to Wallet 2 after Lovelace fees are deducted.
As mentioned by Aoaddeola, there should be no theoretical limit to the number of tokens this can scale for.

To the best of my knowledge, there is no limit to the amount of tokens a transaction can contain.
A Value itself has the following Signature Map CurrencySymbol (Map TokenName Integer). Which literarily means an unlimited number of tokens, since Map poses no limit to the amount of elements it can contain.


text:
How is the active stake of a stake pool calculated?
This question is related to my previous question: When are the snapshots for the active stake in an epoch taken?
The active stake of a pool is used to calculate the rewards. What kind of system calculates the active stake of a stake pool? Is this done by the Cardano nodes or by the stake pools themselves or some other part of the Cardano ecosystem?

Data captured by the snapshot is stored on-chain as a part of the ledger state, so all fully synchronized cardano-node instances have access to it. So, for example, when you run the cardano-cli query stake-distribution --mainnet --out-file stakeDist.out command the cardano-cli queries and outputs the current active stake data for each pool.

I think this answer is (partly) wrong: ledger state is not stored on-chain and nor are the stake snapshots that are part of it. Ledger state is kept in memory by the nodes and it is a result of folding (reducing) the blockchain.

Just a minor correction. These snapshots are part of ledger state and are not actually stored on the blockchain (They are too big. There is a new snapshot every 5 days and over 1 million stake addresses.). The are part of ledger state that can be recreated by replaying the block chain from genesis.

From my understanding, the active stake is calculated as a sum of all coins that were delegated to a particular pool. You can take a look here.

So is this part of the nodes? Or is this shelly-spec-ledger part of some other system running in parallel? And if it's part of the nodes, which nodes are running this code? And who initiates the transactions/reward payouts?


text:
How can I execute a SundaeSwap transaction from the Cardano-CLI?
Goal
I want to be able to use the cardano-cli to swap some tokens on SundaeSwap.
What I have

Working local cardano-node
cardano-cli

What is missing
If I understood this correctly (please correct me if I'm wrong), I need to get the source code of the SundaeSwap smart contract, compile it somehow and then send a transaction with the correct data (datum) to the contract address. But I'm not sure how to do this and where to find the contract source code. Any help is much appreciated!

The contract code is not open source.

Do I need the source code of the contract to call it from the CLI?

You need the compiled version, but without the source you will not know how to use it, I assume.

All compiled plutus scripts are on-chain, the nodes need something to run the code. You can view the compiled plutus core via almost any blockchain explorer. For example, cardanoscan.io provides this. Given a transaction that uses a smart contract you can view the tab contract (for the plutus core) and the used datum/redeemer. All this data is in CBOR encode to save space onchain. You can decode it via cbor.me. Good luck hacking/reverse engineering a way to post swap request via the client! It is possible :)


text:
What are technical differences in smart contract execution on Cardano in comparison to Ethereum?
In my understanding, smart contracts on Cardano are always provided to the blockchain via a transaction and there is no code that is stored at the blockchain, but just a hash (the public key address). Ethereum seems to store them instead: see What is the maximum number of contracts Cardano can store?
Is this correct?
What are the other main technical differences?
Update
Also beyond that Cardano uses the eUTxO-based model and Ethereum uses an account-based model.

Feel free to improve! :)

technical aspect
Cardano
Ethereum
notes

model
eUTxO-based
account-based
see cardano lecture,see question,...

smart contract code location
not stored on-chain, but shipped with transaction
stored on-chain ?

smart contract maximum count
unlimited
limited ?
see question

access third party contract e.g. an oracle
import and use lib (required or just helpful?),, compile your own contract, ship third party validator script with transaction, ...
call it via an address ?
see question

...
...
...
...

This video lecture in the Plutus Pioneers Program explains it https://youtu.be/igV7kMXcdpw


text:
How can an oracle guarantee certain update rates respectively uptime?
After reading the question General approach for allowing multiple smart contract transactions per block I'm wondering how an oracle can guarantee update rates respectively uptime.
If too many transactions want to consume the oracle eUTxO, wouldn't this prevent the oracle provider itself from calling its update endpoint because the eUTxO will often be consumed before he can do it?

If "too many transactions want to consume the oracle eUTxO", you can implement a deadline and after deadline the oracle's utxo is no longer usable(or consumable) and can only be updated by oracle operator.

If they are consumed, the provider would just create new UTXOs from the fees they have collected.
Keep in mind, an oracle would have to consume all of its UTXOs anyway to update the price.

The oracle validator in the Plutus Pioneer Program example is programmed in a way that a user has to provide the exact same datum (which contains the oracle information) at the new oracle eUTxO: Use    -> traceIfFalse "oracle value changed"       (outputDatum == Just x)
So the provider does not create a new eUTxO but ensures through the validator that the consumer does.

That an oracle would have to consume its own (or by a user) provided eUTxO is exactly the problem that I am stating in the question. I'm wondering if the oracle provider could often be to late because someone else submitted a transaction for use first.

If an oracle provides multiple eUTxOs, it can update the provided values one by one. So there is no need to do that all at once. And because of the same reasons, that I'm discussing here in this question, I doubt that an oracle provider can guarantee that all oracle eUTxO (if he provides multiple) datum values will always be in sync.

After CIP-31 is implemented, none of this will be an issue.
This Cardano Improvement Proposals adds what is called "reference UTxOs" which are read-only. So if the Oracle provider has write access and everyone else only has read access, then the Oracle will never have anyone to collide with other than herself.

In the Plutus Pioneer example in lecture 6, the oracle's UTxO is identified by an NFT. Any transaction that wants to consume this, whether it be a transaction wanting to access the information in the oracle, or whether it be a transaction created by the oracle provider to update the value, would first find the UTxO by looking for the NFT.
If another transaction has consumed the oracle UTxO as an input, it must have created a new oracle UTxO as an ouput. This new UTxO may have the the same Datum, or an updated Datum depending on the reason for consumption, but as part of the transaction constraints, it must also contain the NFT.
The next transaction that tries to consume the oracle UTxO will then find this new UTxO rather than the previous one, as this is now where the NFT is sitting.


text:
How can I see if an UTxO holds an NFT in the postgres DB?
Is it possible to find out if an UTxO on the tx_out postgres table holds an NFT? OR in generell which kind of asset this UTxO holds?
Thank you!

Assuming that an NFT is implemented as a multiasset (pretty sure that is not the only way) then this is relatively trivial:
select * from ma_tx_out where tx_out_id = <insert your tx_out id here> ;


text:
How is a slot leader actually selected to make a block?
As far as I can tell, once some blockchain data is fed into a hash, this creates an epoch nonce that is used to define the slot leaders in that epoch.
How is the nonce used to select slot leaders, and what is slot leadership evaluated against to deliver a block on average every 20 slots?  Why can some slot leaders create a block, and why cant others?
Are inputs like transaction hashes part of the block proposal and acceptance process?  Is there some kind of difficulty/target like in regular PoS?

1.) epoch nonce
2.) pool's vrf key
3.) pool's percentage of overall staked ada
4.) active slots coefficient
All four of these determine if a pool is allowed to mint a block in a given slot (happens once per-second on mainnet). The activeSlotsCoefficient protocol parameter is what determines that we make on average 1 block every 20 seconds. Sometimes more, sometimes less, but on average, 1 every 20 seconds.
See my video about this topic to learn more: https://youtu.be/M3Xq1qz3ljU

Thanks, it would be best if the answer was written here, what is evaluated against what, is there a hash with a number of leading zeros like classic PoS?


text:
Plutus Pioneer Week02: otherScript validator
In gift.hs, I do not understand the logic for why in the lookups for the grab contract there is Constraints.otherScript validator. The grabber is the consumer of the UTXO and thus the burden of providing the validator is on him, not the provider. It seems that the other is the provider who by definition does not have a validator.
grab :: forall w s e. AsContractError e => Contract w s e ()
grab = do
   utxos <- utxoAt scrAddress
   let orefs   = fst <$> Map.toList utxos
      lookups  = Constraints.unspentOutputs utxos      <>
                 Constraints.otherScript validator -- ###### THIS LINE #####
      tx :: TxConstraints Void Void
      tx       = mconcat [mustSpendScriptOutput oref $ Redeemer $ I 17 | oref <- orefs]
   ledgerTx <- submitTxConstraintsWith @Void lookups tx
   void $ awaitTxConfirmed $ txId ledgerTx
   logInfo @String $ "collected gifts"

The grabber is the consumer of the UTXO and thus the burden of providing the validator is on him, not the provider.

Correct! And I feel like this might be where your misunderstanding is.
You are right that "the burden of providing the validator" is on the grabber. The grab and give functions are called offchain to construct txs to perform those actions. So the line in question is in fact the code where the grabber "provid[es] the validator."
The Constraits are a way to declaratively specify

What kind of script and UTxOs you want to target with your tx (lookups)
What kind of tx you want to send (tx)

When we include
Constraints.otherScript validator

we are just saying that we want to target our validator with your tx. Or, it might be more accurate to say, we will need our validator in order to perform the tx.

Admittedly the name of the function as well as the documentation doesn't shed too much light on what it's doing:
-- | A script lookups value with a validator script
otherScript :: Validator -> ScriptLookups a
otherScript vl =
    let addr = Address.scriptAddress vl in
    mempty { slOtherScripts = Map.singleton addr vl }

So otherScript really means ourScript? This is very confusing.

That's not quite right. Maybe think of it as adding "another" script to the lookups. You could theoretically include multiple validators if you're spending outputs from different scripts in a single transaction. Remember, validators just check if you are allowed to spend outputs at a script address.

So it seems that in this particular case for grabbing, since there is only one grabber (at a time), there is just one validator. And hence there is no ambiguity in simply stating otherScript because there's just one script out there altogether for this particular transaction.


text:
How can I query the version of the node running a stake pool?
The version of the node running on the entire blockchain can be consulted in PoolTool.
I want to check the individual version of a stake pool. Thanks.

I believe PoolTool asks node operators to send them the data.
In bitcoin style nodes there is an RPC getpeerinfo and that shows peer info like major version, I dont think there is anything for cardano-node yet.
You could try looking thorough cardano-node logs and see if there is version data exchanged (I expect there is), you would then just need to manually configure mainnet-topology.json to point your node to the pool node.
Bear in mind this will only give the public relay version, not the block producer version.


text:
Why do Binance run 62 pools if it is an exchange?
Enterprise addresses
Enterprise addresses carry no stake rights, so using these addresses means that you are opting out of participation in the proof-of-stake protocol.
Exchanges or other organizations that control large amounts of ada – but hold it on behalf of other users – may wish to follow a policy of not exercising stake rights. By using enterprise addresses, exchanges can demonstrate that they follow this policy. Since enterprise addresses are not associated with any staking key, they are automatically excluded from the mechanisms that influence the slot leadership schedule. Note that using addresses with no stake rights effectively decreases the total amount of stake, which plays into the hands of a potential adversary.
Source: https://docs.cardano.org/core-concepts/cardano-addresses#gatsby-focus-wrapper

From a tax point of view, in many countries you have to report staking and trading differently (DYOR). An exchange therefore does not have the right to stake users' coins without their consent. However, Binance offers a wide range of staking offers to their clients (including ADA staking) and it is only when the user subscribes to an ADA staking offer that the exchange stakes the ADA. With millions of users and millions of ADA, creating your own staking pools becomes a very profitable business for the exchange.
But staking your ADA on an exchange does not help secure Cardano, it is better to choose small independent pools to help the network with decentralization. By sending your ADA to a wallet like Daedalus or Yoroi, you can choose the pool to which you delegate your ADA.

It's their ADA, they can do what they want. This is why you should never stake your ADA with an exchange, no matter the return because, they lock your ADA for a time period and it doesn't help secure the Cardano network. Always stake with SPOs.
I stake with https://airadapool.com/ AADA because they belong to the Tech school, CareerDevs, I joined in 2016. They were the point in my life where someone sat me down and explained crypto. I've been in crypto since and that's why I stake with them and won't move till they are over 1M ADA.

Yes, I have no doubt...I am asking if exchanges can run a stake pool "entreprise address" should not allow them

Its an open system, they can do what they want.

Because it is profitable for them to do so. If they run 62 pools, they get approximately 32M * 62 * 0.05% a year, which is approximately 96M ADA. They would only change their mind if  it was bad for their image, but as people still stake with them, there is no reason for them to stop.


text:
Is there any platform to read the Mempool?
I want to see the queued transactions in the mempool, where can I see that?
Thank you.

Is there any Update on that issue as of today? So is there any chance to read (historic) cardano mempool transactions?

Please see this API: https://docs.blockfrost.io/#tag/Cardano-Mempool
Also note that a mempool is a local viewpoint, and other nodes might have a different mempool at the same time. It's a local measurement of an individual node.

A protocol to interface with the local mempool was merged recently in the context of a larger piece of work to increase network throughput. It can now be accessed from Ogmios.
Even though, unfortunately it does not provide access to transactions received from peers - only to those submitted locally.

You should follow the referencing guidelines when referring to external sources.  Your answer may not work well if the external sources move or change.


text:
I would like to run a relay node on Ubuntu 20 server without creating a wallet, what are my options? Are packaged binaries available?
I am looking to setup a full node on an Ubuntu 20.04 server for mainnet and leave it running. I don't intend to run a stakepool. Are there any packaged distributions I can use?

A stake pool is just a full node with some additional configuration, so the binaries are the same.
If you need to run cardano-node, you might want to start with its Getting started documentation and you can find the release binaries on the Github's release page of cardano-node.


text:
15- or 24-word recovery seeds for ADA wallets
In security terms, what is the difference between 15- and 24-word seed?
Therefore, which option is recommended (from a security point of view)?

Following the BIP39 standard, 15 word seeds are proving about 160 bits (20 bytes) of entropy, where 24 word seeds are providing around 254 bits (32 bytes) of entropy.
As long as you do everything to protect your word seed, 160 bits of entropy is plenty. In the past, people used 24 words to split it into two parts, but today they are better ways to split your seed, such as Shamir backup.
Little bit off topic, but I urge people to use hardware wallets, they are not that expensive and provide a huge increase in security over plain wallets - that is my security recommendation.

Unfortunately, hardware also breaks. What's the expected lifetime of a hardware wallet?

A hardware wallet is just an utility. It is of course a must to have a well protected physical shamir backup.

If you get a metal wallet like a Cryptotag or Blockplate you can protect your seed phrase better than paper. Do not use anything made from Aluminum since that will melt in a house fire.


text:
Should I transfer my ADA to the latest wallet when a new era become available?
I haven't been part of a new Era change but when a new era become avaiable, should I transfer my ADA to the latest wallet? i.e. from a Shelley to a Goguen wallet.
What is the process that I should perform and risks involved?
What happen if I don't do this?

Good and valid question. This was necessary for Byron to Shelley but most likely will not be the case going forward. See Marek's answer.

There is nothing you need to do, thanks to the hard fork combinator, hard forks are entirely transparent to the users!


text:
Where is stored off-chain code?
As I understand, a smart contract in Cardano contains on-chain code and off-chain code.

On-chain code is executed by cardano nodes in order to validate transaction.
Off-chain code builds a transaction in the user wallet then submit it to the blockchain.

On-chain code is stored in the blockchain, but what about off-chain code if this is executed on user wallet. Where is this code stored?
I guess is in the blockchain too, but how does the user wallet get it?

I guess [the off-chain code] is in the blockchain too[?]

No. Actually. They mean it when they call it "off-chain" :).
Background:
Generally speaking, you want to minimize the amount of code you put on-chain because that code is expensive. For Plutus smart contracts, the role of on-chain code is simply to look at a transaction and say "yes" or "no".
There are two uses for the off-chain code:

Compile and submit the on-chain scripts
Create transactions that will be validated by the on-chain scripts

But as I mention in this other question's answer, there is nothing keeping someone from writing their own off-chain code to interact with the on-chain script. This is important for a smart-contract writer to understand when thinking about the security of the on-chain validation.
Answer:

Where is stored off-chain code?

There is nothing binding the on-chain code to a singular off-chain code. So there is no correct answer.

How does the user wallet get it?

From what I understand, there will be options. It could be stored in a repo by the SC writer where you could download it, or perhaps hosted on a website where your wallet can access it (similar to how Metamask works on Uniswap or other Ethereum sites), or you could write it yourself in an attempt to exploit the contract.
As a SC creator, it will be your responsibility to make your off-chain code available to consumers so they can interact with your contract in your intended way.

Also, I imagine a central repository similar to what we have for tokens metadata will be ran by the Cardano Foundation.

This. I imagine at some point there could be a dApp browser of sorts. As we’ve seen with the Plutus Playground, the endpoints interface can be used auto-generate a UI. This could help lower the barrier to entry for dApp writers so they don’t need to build a UI themselves. If you can get your SC onto the registry then anyone can find it and use it.


text:
Cardano Node Causing Browser Errors
I am not a developer, just a hobbyist.
I installed the Cardano Node (1.33.0-win64) so that I could point my Nami Wallet Browser Extension to it, rather than the web server node Nami points to by default. Ever since installing the node, I get browser errors that reference the Cardano Node and  "WebAssembly.instantiateStreaming" (full console error from dev tools below). Just visiting websites is all it takes to get the errors.
Can someone help me learn more about this, and perhaps point me in the direction to a solution? I could just uninstall the node, but I want to solve the issue.
Thank you!
cardano_serialization_lib.js:13074          GET https://www.google.com/wasm/csl-v10.0.4.wasm 404
cardano_serialization_lib_init @ cardano_serialization_lib.js:13074
(anonymous) @ CardanoSerializationLib.ts:11
(anonymous) @ CardanoSerializationLib.ts:15
(anonymous) @ dom-script.js:27
(anonymous) @ dom-script.js:27
cardano_serialization_lib.js:12883 WebAssembly.instantiateStreaming failed because your server does not serve wasm with application/wasm MIME type. Falling back to WebAssembly.instantiate which is slower. Original error:
TypeError: Failed to execute 'compile' on 'WebAssembly': HTTP status code is not ok
load @ cardano_serialization_lib.js:12883
await in load (async)
cardano_serialization_lib_init @ cardano_serialization_lib.js:13079
await in cardano_serialization_lib_init (async)
(anonymous) @ CardanoSerializationLib.ts:11
(anonymous) @ CardanoSerializationLib.ts:15
(anonymous) @ dom-script.js:27
(anonymous) @ dom-script.js:27

Your browser or extension is trying to get the wasm code.
Your error shows GET https://www.google.com/wasm/csl-v10.0.4.wasm 404
The 404 result means 'not found'.
I found this reference: https://github.com/Emurgo/cardano-serialization-lib/issues/398
Do you have Eternl wallet extension installed in your browser? Seems that it is using the wasm URL above and failing, so best to disable Eternl wallet extension and try again.
Keep in mind that browser extensions inject their code into every page that you visit, so if one extension is not working correctly the impact will be felt on every page that you visit.

I think this issue is being tracked on https://github.com/ccwalletio/tracker/issues/119. It is a pretty major bug introduced by this Wallet Browser Extension.

I disabled Eternl and that totally eliminated the error message! I thought it was the node this whole time. Thank you so much.


text:
How to format metadata for Lucid?
Our metadata as a CIP 25 looks like this:
Pool pm metadata tool
We are using Lucid to attach it during transaction building in this way:
const filename= "https://arweave.net/" + arweaveId
      const metadata = {
        [policyId]: {
          "Origin Certificate": {
            "description": [
                "Village": "Los Hornos, Comayagua",
                "Country": "Honduras",
                "Grower": "Nelvin Humberto Vaquis",
                "SCA Grade": "85",
                "Altitude": "5245 ft",
                "Variety": "Parainema, PACA, & H-90",
                "Characteristic": Citrus Flavor, Floral Tones",
                "Bean": Medium Complexion"
            ],
            "files": [
               {
                  "mediaType": "image/png",
                  "name": "Origin Certificate",
                  "src": filename
               }
            ],
            "image": filename,
            "mediaType": "image/png",
            "name": "Origin Certificate"
          }
      },
      version: "1.0"
      };

But something exceeds the character limit even though none of the strings exceed 64 characters. Also, removing the quotation marks removes the error about the character limit but the metadata doesn't format correctly.
To attach the metadata we do the following:
.attachMetadata(721, metadata)

What could we change to eliminate the issue?

From the looks of it, file links are too long. Have you tried shortening links, or using different file hosting service?
Try something that looks more this: Pool pm metadata tool.


text:
Is there any way to check reward address value?
Smart contract should allow the reward withdrawal only if all rewards are withdrawn. In other words only if the reward address will have exactly 0 lovelaces after the reward withdrawal. Is there any way/idea how to check this?

The ledger already enforces this rule. See "Reward accounts are set to zero for each corresponding withdrawal." in the Shelley ledger spec.

Thanks for your answer james! Yeah, I know about this. But the question is how can Plutus validator script get this info? As far as I know, all withdrawal data Plutus validator has is txInfoWdrl :: Map StakingCredential Integer. So, there is no any flags like 'Rewards are set to zero' or something like that. At the moment I use a stakeDeregistrationCert trick (it fails in case withdrawal amount < reward amount since stake address can be deregister only if reward amount = 0). However it's a bit expensive (tx fee) and complicated, and I'm trying to find a cheaper and easier way.


text:
Can't collect utxo from the gift script address
I'm following Plutus Pioneers Program, 4th Cohort.
In the 2nd week we learned the smart contract Gift.hs
-- This validator always succeeds
mkGiftValidator :: BuiltinData -> BuiltinData -> BuiltinData -> ()
mkGiftValidator _ _ _ = ()

and used make-gift.sh and collect-gift.sh scripts for sending/receiving ada to/from Gift.addr script address addr_test1wqag3rt979nep9g2wtdwu8mr4gz6m4kjdpp5zp705km8wys6t2kla
This address has some UTXOs like this one
                           TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------

0f7262dba9374e8819a2170516a86b70e3857001f9c0dbe82ebaafcac1c3a676     0        1000000000 lovelace + TxOutDatumInline ReferenceTxInsScriptsInlineDatumsInBabbageEra (ScriptDataConstructor 0 [])

which looks correct from the smartcontract's point of view (has TxOutDatumInline, etc), but when I try to send the tx and collect this utxo I get the error
Command failed: transaction submit  Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (FromAlonzoUtxowFail (WrappedShelleyEraFailure (ExtraneousScriptWitnessesUTXOW (fromList [ScriptHash "3a888d65f16790950a72daee1f63aa05add6d268434107cfa5b67712"]))))])

Could someone explain me please why this is happening? Shouldn't the smart contract validator always succeeds?

I'm using only --tx-in-script-file and having the same error. I noticed that if you include the script of the same smart contract, I'm obliged to reference the script rather than using --tx-in-script-file. I want to be able to use --tx-in-script-file even if the UTXO includes a reference to the same script. Any solution for that?

ExtraneousScriptWitnessesUTXOW means the script witness is being included in the txbody when it doesn't need to be because the witness requirement is already satisfied by a reference script.
Either include the script in the txbody OR reference the UTxO where the script has been stored when building a transaction. You are only allowed to do one or the other.

Thanks for your answer James, but I still don't fully understand... Does this mean that an error was made while creating the transaction 0f7262...c3a676 ? And now there is no way to collect this UTXO from the gift address?

No. It means the transaction you are currently building is including both. e.g.. with the cli you are using both --tx-in-script-file and --spending-tx-in-reference

That output you are spending has both the reference script and the inline datum. So because you need to reference the input for its datum you must also use the reference script and not provide the script file.

Thanks for your patience James, the solution finally dawned on me :) My mistake was that when I tried to create the UTXO like 0f7262...c3a676, I specified a vesting.plutus as tx-out-reference-script-file, just for testing. But it 'works' (the error ExtraneousScriptWitnessesUTXOW occurs) only with --tx-out-reference-script-file "$assets/gift.plutus". Probably, in the case when the scripts do not match each other, the offchain validation does not start at all

Unfortunately I can't mark your answer as correct, because It requires 15 reputation at least, but you've helped me a lot. Thank you very much!


text:
Remix IDE & Cardano
Are there currently any plans for a Cardano version of the Remix IDE?
Currently it works for Solidity on Ethereum and Binance Smart Chain and the network is selectable from a drop fown list box. This suggests at least some form of modularity and extensibility.

Welcome to our new community! This question has 2 close votes (not from me!) so I just thought I'd warn you that these type of questions that are only temporarily valuable may be better for our chat room.

I’m voting to close this question because questions about the future of Cardano can't be effectively addressed on this site and would be better addressed directly to the Cardano Team on their forum. This site is not operated by the Cardano organization.

I did not personally hear anything about such plans.
However, I'm voting to close this question as I feel this is good question for Remix developers and might be off-topic for this StackExchange space.


text:
how do I know if I should use cardano-cli or cardano-wallet
I'm new here and it's still a bit vague for me... In the developers' docs I often see that you can do the same thing with cardano-cli and cardano-wallet (receive payments, create metadata transactions, ...). So how do I know if I should use one or the other ?

The answer is it depends. The wallet provides a lot of high level automation, like coin selection for transactions, change addresses, etc... The CLI provides a bare bones I'm doing everything myself. In a production application, I'd recommend if you're not using the wallet, you use something like db-sync, graphql or rosetta to construct your transactions and handle the signing logic in your programming language of your choice rather executing cardano-cli from your code. That being said, I made my own single address wallet wrapping around CLI and cardano-addresses if you want to see an example of how you would utilize the CLI commands to build a simplified wallet here: https://github.com/input-output-hk/adawallet

Just like using the command line interface (CLI) on your computer exposes more capabilities as well as potential user errors, so does using the CLI on Cardano.
Unless you are very familiar with the CLI and the syntax, you are best off using the GUI Wallet software (Daedalus, Yoroi, ADALite, or....).


text:
What is the proper way to rotate KES keys?
I would like to rotate my KES keys using cardano-cli (I'm not using cncli or other tools). What would be the proper way to rotate the keys?
is the VRF keys need to be updated also?

VRF keys does not need to be rotated, only KES keys.
To use cardano-cli, follow the KES_period.md, as such:
Create new KES keys:
cardano-cli node key-gen-KES --verification-key-file kes.vkey --signing-key-file kes.skey

To find out how long one period is and for how long a key can evolve, we can look into the genesis file. If that file is called mainnet-shelley-genesis.json,
we can type
cat mainnet-shelley-genesis.json | grep KES
"slotsPerKESPeriod": 129600,
"maxKESEvolutions": 62,

in this example, the key will evolve after each period of 129600 slots and that it can evolve 62 times before it needs to be renewed.
Before we can create an operational certificate for our node, we need to figure out the start of the KES validity period, i.e. which KES evolution period we are in.
We check the current tip of the blockchain:
cardano-cli query tip --mainnet

{
    "epoch": 259,
    "hash": "dbf5104ab91a7a0b405353ad31760b52b2703098ec17185bdd7ff1800bb61aca",
    "slot": 26633911,
    "block": 5580350
}

In this example, we are currently in slot 26633911, and we know from the genesis file that one period lasts for 129600 slots. So we calculate the current period by
expr 26633911 / 129600
> 205

With this we are able to generate an operational certificate for our stake pool:
cardano-cli node issue-op-cert \
--kes-verification-key-file kes.vkey \
--cold-signing-key-file cold.skey \
--operational-certificate-issue-counter cold.counter \
--kes-period 205 \
--out-file node.cert

We need to add KES key creation step: cardano-cli node key-gen-KES
--verification-key-file kes.vkey
--signing-key-file kes.skey

This link is also helpful in this regard: https://www.coincashew.com/coins/overview-ada/guide-how-to-build-a-haskell-stakepool-node/part-iv-administration/kes-rotate-companion-script

I always found this very useful on this matter: https://ecp.gitbook.io/how-to-guides-for-coincashew-method-cardano-spos/maintenance-and-daily-operations/how-to-guides-for-spos-using-coincashew-method/adjust-node.counter-for-kes


text:
is it possible in future to buy ADA directly?
out of curiosity, is it possible to buy/Withdraw fiat ADA directly from ADA wallet, stack,lend and bypass any existing exchanges to avoid expensive fees ?

Not currently possible for any currency.  All currency conversions require an exchange or broker.  Questions that ask for predictions are also not appropriate as they require speculation rather than facts in most cases.  If they can be answered with facts, they become obsolete over time.

I’m voting to close this question because the questions about the future of Cardano can't be effectively addressed on this site and would be better addressed directly to the Cardano Team on their forum. This site is not operated by the Cardano organization.

LocalBitcoin.com might have some options.


text:
Is it me or is the tx_in table completely unnecessary in dbSync?
If I've understood the dbsync schema properly then the tx_in table is completely unnecessary. The two fields (tx_in_id & redeemer_id) should just be brought into the tx_out table and left null when a UTXO has not yet been consumed. This would be far more intuitive, or am I missing something?

db-sync is insert only. You need to be able to see what the state was at any particular point in time. If it modified rows that wouldn't allow you to do so.

Got it. But for my purposes (analysis) lt seems like can merge the tables without messing up the data. Cool.


text:
How is off-chain code decentralized?
Consider this a follow up to this other question that someone else asked: Where is stored off-chain code?
My question: Without a dapp store how does one deploy a Plutus script in a fully Decentralized manner? Would you have to do what SundaeSwap did and get some node operators to run the off chain code for you?
Or perhaps what happens is a user goes to a dapp developers website , clicks on something like “install dapp to Nami wallet”,then the wallet copies the dapp code from the dapp developers server to the users wallet and they then run the off chain code on their browser ? Is that how it works?

The purpose of a dApp store is for script curation, not script availability. Perhaps "dApp Store" is a bit of a misnomer, because software here isn't being sold in the traditional sense. Instead, it is being submitted to the open source community in a setting where professionals can audit/debug the code and report their findings to the community. This is imperative for decentralization because we can't expect everyone to have the level of expertise necessary to know whether the code they are using is sufficient for their purposes. By having trusted entities validate scripts and sign off on them allows us to outsource the code audit to an entity who has a reputation to maintain.
As far as deploying the actual script, the code is run on the client machine (your computer) and the hash of the operation is posted on chain. This is analogous to how simple transactions work - sending/receiving addresses are not stored on chain for each transaction, only the hashes of TX outputs are stored.

So how does the code get onto the users machine? It sounds like the code will originate from a centralized entity (SundaeSwap servers & SundaeSwap website ?) and then run on users browsers and interact with users wallet as need be?
Have I got that right?

@user1761806 yes, that is one of the ways. It really doesn't matter where the user gets the script from -- he could get it from a friend, a contract deployer, compile from source himself, fetch from ipfs.


text:
"min-ada" bottleneck to Cardano analogous to "gas fee congestion" for Ethereum?
In reference to Min-Ada-Value
Imagine the following scenario:

Alonzo's long anticipated smart contracts finally arrive to the main net
The ERC20 converter is a massive success and ports hundreds of ERC20 tokens over to Cardano
There are a lot of "WhateverSwap" (e.g. SundaeSwap, YaySwap, Minswap, ...) platforms each running a massive amount of swaps
There are a lot of new smart contracts now being used for the former ERC20 tokens
People are sending ADA, native tokens and former ERC20 tokens around like crazy
In Ethiopia, after Cardano + Atala PRISM turned out to be a huge success for the students, the government decided to replace its currency by using Cardano, now every person is paying stuff in ADA
In Tansania, after seing the success in Ethiopia, the government decided to start a pilot project with also thousands of people using Cardano
<your imagination here>...

All this would result in the price of ADA going up, up and up. Now imagine the price of ADA sitting at $14 (conservative estimate). For every transaction, some portion of ADA (currently 1) needs to be sent with it. $14 may still be affordable for most people in the developed countries, but might be a small fortune for some unbanked. So these people would probably become cut off from using Cardano. And even for the developed countries it is not sure if everyone would be happy to pay these fees.
=> My question is: Could Min-Ada ever become a bottleneck for Cardano the same way the present gas fee congestion is a bottleneck for Ethereum?
I know that Min-Ada can and probably will be dynamically adjusted according to the corresponding situation. However, how well thought out is this solution? Could someone explain the mechanics on how this would work?

No, it would not be a bottleneck if Cardano implements babel fees that will enable you to pay (actually arbitrage) your fees in different tokens.
That being said, to keep a decentralized network secure, you always offer something of value for the work of validation blocks. Also, the author of the transaction might not be necessarily be the same party that pays for it.
In the future, most of the transaction will be probably one layer above (for example Hydra) and the final fee will be paid only for a settlement.


text:
Recover a Cardano wallet offline
Is there a way to recover or generate the addresses of my wallet (24 seed) without using external servers (JavaScript)? Just like we do with other blockchains?
Example: https://iancoleman.io/bip39/

My preference is to use a javascript library for this.
For example, use https://github.com/StricaHQ/bip32ed25519 to generate/convert the seed phrase to a private/public key.
Then use a javascript/typescript Tx builder library like Helios https://github.com/Hyperion-BT/helios to extract an address from a public key.  No servers involved.

Do you have a working example combining both libraries?

Yes.  Here is a working example using both libraries to do a multi-signature nft with a front-end browser wallet and an back-end private key.   https://github.com/lley154/helios-examples/blob/main/nft-multisig/pages/api/getSignature.ts

You can do it using cardano-cli and cardano-address (or cardano-wallet instead of cardano-address, with the same parameters) using the script here:
https://gist.github.com/cardano-apexpool/99784308812bdf7aa01446fa95f47fd2
I've been using it a lot in the last year.

@enzo to generate offline addresses from mnemonic, you can use cardano-addresses https://github.com/input-output-hk/cardano-addresses

Can´t see a working example in JavaScript where I pass a mnemonic and I generate addresses with it.

Yes. I used the Mnemonic Method detailed here:
https://www.coincashew.com/coins/overview-ada/guide-how-to-build-a-haskell-stakepool-node/part-iii-operation/setting-up-payment-and-stake-keys
You'll need cardano-wallet on an air-gapped machine.


text:
Is there a ready to go (boilerplate) project to make request/rpcs to my daedalus (cardano-node)?
Since cardano-rest is deprecated not sure if cardano-graphql is the way to go just to get data from the blockchain. It seems like the setup to start with is very complex for newbies.
I've never used Docker or Graphql, but I have nodejs/JavaScript/JSON/HTTP/RPC skills. What is the lightest set-up to communicate with the Cardano blockchain?

You can use dandeliona APIs as available here provided by Gimbalabs or BlackFrost in case you wanted hosted services. Running docker image for Cardano-graphql is not that involved.

It is if you don't have docker installed. Plus is getting complicated when you start getting errors like this one: https://github.com/input-output-hk/cardano-graphql/issues/508


text:
How to calculate ADA balance at a prior point in time?
I'm trying to calculate the ADA balance at a prior point in time using DB-Sync.
What I did was first work out what the last tx.ID number of the 10th May 22 was, which in my version of the db is 40491540.
So then I wrote this query:
select sum (value) / 1000000 as current_supply from tx_out as tx_outer
inner join stake_address sa on tx_outer.stake_address_id = sa.id
where
    not exists
      ( select tx_out.id from tx_out
       inner join tx_in on tx_out.tx_id = tx_in.tx_out_id and tx_out.index = tx_in.tx_out_index
          where tx_outer.id = tx_out.id and tx_in.tx_in_id < 40491540
      )
and tx_outer.tx_id <=40491540

However this gives me a total circulating ADA balance of 26.bn which I don't this is right - should be more like 33.7bn.
What am I doing wrong?

Ah ok I solved it. I was close. Just had to turn the inner join into a left join
select sum (value) / 1000000 as current_supply from tx_out as tx_outer
left join stake_address sa on tx_outer.stake_address_id = sa.id
where
    not exists
      ( select tx_out.id from tx_out
       inner join tx_in on tx_out.tx_id = tx_in.tx_out_id and tx_out.index = tx_in.tx_out_index
          where tx_outer.id = tx_out.id and tx_in.tx_in_id < 40491540
      )
and tx_outer.tx_id <=40491540

Your query excludes account balances (not sure why you're doing the join to stake_address here).
But if looking for total/circulating supply, you can already get those from dbsync table ada_pots (see example here ).
The supply would only change per epoch - when reserved are unlocked.

Thanks - what do you mean by "excludes account balances"? And join to stake_address is because I wanted to (ultimately) analyze the largest stake_addresses. Sorry should have explained that up top or left out the join. Ada_Pots .. useful to know!

I meant you're only looking up UTxOs, but there are rewards on accounts (that have been distributed from reserves), fundings extracted from treasury, deposits made for accounts, that you wouldnt see in tx_out table


text:
How to calculate Sundaeswap TVL using DB-sync?
I'm trying to do an exercise where I see if I can calculate Sundaeswap TVL using DB-Sync.
Below is what I have managed to pull out from the database so far regarding Sundaeswap.
However for the UTXOs in the tx_out table I would have expected the payment_cred (which is described in the docs as " For a script-locked address, this is the script hash." to match the script hash. However it doesn't so I'm not sure how to determine the total number of UTXOs locked by Sundaeswap.
Link to the transaction below in case you need it

Ok I wasn't able to reconcile the above but I did find that DeFiLlama post the code they use to calculate TVL (see the Check the code button here: https://defillama.com/protocol/sundaeswap)
So using this I was able to discern the addresses different DApps use and so tracking those intead.


text:
Extract the bech32 stake address from a shelly address in javascript
I am looking to get the bech32 stake address from a bech32 shelley address. I think I have to decode the shelley address, take the stake address part and encode it again.
I looked here: https://github.com/cardano-foundation/CIPs/blob/master/CIP-0019/CIP-0019.md#shelley-addresses
But I did not find enough details to do this. Can anyone give me more exact information?
I am using the javascript bech32 library: https://www.npmjs.com/package/bech32

Did you manage to solve this problem? I'm trying to extract the stake address from shelley address using java. any tips would be appreciated tks

Please comment in the comment area only

I do not think it is possible to achive this in plain bech32, you need to convert it to hex and than back to bech32 to get retrieve the bech32 stake address.
First you decode the bech32 shelley address
For example converting the address addr1qxdvcswn0exwc2vjfr6u6f6qndfhmk94xjrt5tztpelyk4yg83zn9d4vrrtzs98lcl5u5q6mv7ngmg829xxvy3g5ydls7c76wu
gives us
019acc41d37e4cec299248f5cd27409b537dd8b53486ba2c4b0e7e4b54883c4532b6ac18d62814ffc7e9ca035b67a68da0ea298cc24514237f
Now, the Stake part of the address is the last 56 bytes of it, which gives us 883c4532b6ac18d62814ffc7e9ca035b67a68da0ea298cc24514237f.
Converting this to a bech32, we will retrieve the associated stake key stake1uxyrc3fjk6kp343gznlu06w2qddk0f5d5r4znrxzg52zxlclk0hlq.
Just a reminder that the address can be mangled, so the owner of the stake rights might not be the same person as the owner of the payment funds.

Thanks this is what I tried. The problem I had was that the bech32 library I am using restricts the length of the encoded data to 90 characters. I found the limit can be changed so I can decode the address now.

Just a side-note to Marek's answer, don't forget to append the prefix to the stake part!
In this case e1:
e1883c4532b6ac18d62814ffc7e9ca035b67a68da0ea298cc24514237f

See: Bech32 encoding stake address from Shelley address in JavaScript returning wrong value


text:
What is the relationship between addresses and stake addresses?
Can anyone tell me if an address can change its stake address? If so when does this happen?
Is there a good place to read about how the addresses and the stake address are related?

Usually, the Shelley address contains the staking address inside (delegation part), so it is not possible to change it. But they are other types of addresses.
One of the best resources to learn about Cardano's addresses is CIP19: Cardano Addresses.

So, technically yes, that is possible. For example the stake part of an address can be changed and then funds sent to that address will continue to be staked in the original wallet (the original wallet still gets the stake rewards). That is how staking will be enabled while funds are in a smart contract. Andrew Westberg has a good video on it (he really should be answering this question).

I do not think you could be staking and use the funds in a contract (I think you mean a mangled address) as the staking within the contact will be managed by the script output.

I can't really argue because I'm not exactly sure on how it works. But I know the plan is to enable staking while your ADA is in a smart contract. Otherwise the network's security is reduced if a large amount of ADA is moved out of staking wallets and into contracts (like DeFi pools for example).

Correct, but this is done by staking the smart contact itself. You are also correct the main reason is PoS security.


text:
Building and Signing Transactions
I'm learning about Cardano. In reading how to set up a node for staking, I came across Building and Signing Transactions. Would someone kindly provide more context when building and signing should take place and by whom? The document showed manual CLI commands for those two procedures. Does that mean if you are administering a staking pool, someone has to build and sign the transactions manually? I don't believe that to be the case as it would take too long.

Pool operators do use the CLI directly, or have some shell scripts to streamline the transaction building steps. There are also several different suites of pool management scripts that automatically build the transactions required, in addition to many other features built on top of calls to cardano-cli.
As a pool operator, administration transactions often require special flags to cardano-cli which wallet software doesn't support. Specifically, pool operators must do these 3 functions:

Register the pool, which involves 2-3 transactions
Every 65 days, renew KES (Key Evolving Signature)
Other pool updates, like changes to fees, relays, and metadata

"A transaction is a binding between inputs and outputs". This is true of all Cardano transactions, but the pool management actions above also include metadata. Some of the metadata fields are special/reserved and passed as flags to the CLI, and some metadata is supplied as user-defined JSON.
The stake pool setup documentation walks through the setup & KES management in much more detail.

Thank you, Ben, for taking the time to answer. Would you mind elaborating on what a transaction from a pool operator perspective is?

Added to my answer. I'll keep the body of the answer as operator-specific, but I will add that most regular users of Cardano don't need the CLI, it's suited for more complicated transactions (like asset minting) and developers.

I appreciate the updated answer, Ben!


text:
How does a stake pool node certify a block for the block chain?
How does a stake pool node certify a block for the blockchain? What part is done manually by a human pool operator and what part is done by a machine through automation?
Say Peter pays Paul $10 ADA. A pool is selected to process that transaction. What happens next?

In Cardano, time is segmented into 5 day epochs and 1 second slots.
As users publish transactions on the network, pools distribute the transactions to their peers and store valid transactions locally in a queue, known as the mempool.
In each slot, one or more validators (pools) may be selected to forge a block. That block will contain transactions from the mempool, up to max block size.
Validators are able to independently check if they are elected as the slot leader. From the Ourobouros Praos paper:

only a slot leader is aware that it is indeed a leader for a given slot; this assignment is unknown to all the other stakeholders—including other slot leaders of the same slot—until the other stakeholders receive a valid block from this slot leader

Blocks are signed by a validator with their operational key and includes the validator's operational certificate. The certificate is composed of the public portion of the operational key, certificate issue number, beginning KES period, and a cold key signature as defined in the ledger spec.
Once the new block is distributed to the network, each other validator can verify that the new block is valid, and that the publisher was eligible to forge a block in that slot.
All of this happens automatically as part of the cardano-node software. Operators only need to update their certificate periodically.
The proof of this distributed random selection process is a bit much for this answer, as is the proof for how the network selects a longest chain and handles soft forks, but worth reading up on if you're interested in this topic!

Thank you kindly for the detailed and easy to understand answer.


text:
How can I get rewards into payment address?
I have stake pool paymentwithstake.addr which is a composition of payment.addr with stake.addr.
I can query stake.addr for the balance using the following command:
cardano-cli query stake-address-info --mainnet --address $(cat stake.addr)

From the outcome, I can see there is available rewardAccountBalance.
The question is:
How can I move reward to my payment.addr aka transform in a UTXO?

The process of moving your rewards (account balance system) to your payment address (UTXO balance system) is called reward withdrawal.
As per withdraw-rewards.md:
Check the balance of the rewards address:
cardano-cli query stake-address-info \
--mainnet \
--address $(cat stake.addr)

[
    {
        "address": "stake_test1urxx5h9mhey1234566ek6uxqgtlkpvteqjqgaleddevpggfggxw",
        "delegation": "pool1ljq292q5xwz8t3ehmaw3c5p9xpr123456dnrxd40004ns6dy8v0",
        "rewardAccountBalance": 550000000
    }
]

Query the payment address balance
You'll withdraw rewards into a payment.addr wich will pay for the transaction fees.
cardano-cli query utxo --mainnet --address $(cat payment.addr)

                           TxHash                                 TxIx         Amount
----------------------------------------------------------------------------------------
a82f8d2a85cde39118a894306ad7a85ba40af221406064a56bdd9b3c61153527     1         194054070 lovelace

Draft the withdraw transaction to transfer the rewards to a payment.addr
cardano-cli transaction build-raw \
--tx-in a82f8d2a85cde39118a894306ad7a85ba40af221406064a56bdd9b3c61153527#1 \
--tx-out $(cat payment.addr)+0 \
--withdrawal $(cat stake.addr)+0 \
--invalid-hereafter 0 \
--fee 0 \
--out-file withdraw_rewards.draft

Calculate transaction fees
cardano-cli transaction calculate-min-fee \
--tx-body-file withdraw_rewards.draft  \
--tx-in-count 1 \
--tx-out-count 1 \
--witness-count 2 \
--byron-witness-count 0 \
--mainnet \
--protocol-params-file protocol.json

171089

Build the raw transaction.
expr 194054070 - 171089 + 550000000
743882981

cardano-cli transaction build-raw \
--tx-in a82f8d2a85cde39118a894306ad7a85ba40af221406064a56bdd9b3c61153527#1 \
--tx-out $(cat payment.addr)+743882981 \
--withdrawal $(cat stake.addr)+550000000 \
--invalid-hereafter 12345678 \
--fee 171089 \
--out-file withdraw_rewards.raw

Sign and submit the transactions
cardano-cli transaction sign \
--tx-body-file withdraw_rewards.raw  \
--signing-key-file payment.skey \
--signing-key-file stake.skey \
--mainnet \
--out-file withdraw_rewards.signed

cardano-cli transaction submit \
--tx-file withdraw_rewards.signed \
--mainnet


text:
When can I move Daedalus` data files to another location?
I have an intentionally small /home partition and a large data partition on Linux. When can I move move Daedalus' data files to my data partition.
I ran out of room on /home and had to move a bunch of stuff elsewhere that I did not want to move.
A long time ago, I tried doing it with symlinks, but that does not work.
I think CH mentioned wanting to add this in one of his AMAs.

Link works. I had shared the immutable folder among three PCs.

2022 Daedalus 5.1.0
Yes this was a big problem. Daedalus just ate up my SSD while I have a mostly free 2TB HDD sitting doing nothing.
It turned out to be very simple though. Here are the steps for Ubuntu based systems;

Make sure that Daedalus is not running.

Copy the ~/.local/share/Daedalus directory somewhere in your harddisk. In my case I copied it to /mnt/P300/Daedalus.

To back up, I renamed the original like ~/.local/share/Daedalus_

Create a symlink in ~/.local/share to point to /mnt/P300/Daedalus like
ln -s /mnt/P300/Daedalus ~/.local/share/Daedalus

We are almost finished. Open ~/.local/bin/daedalus-mainnet with an editor. There are two lines starting with exec. In both of them add -m /mnt:/mnt before -m /home:/home. In my case /mnt is where my HDD is mounted. You should first check the mountpoint of your HDD. Perhaps you need to add -m /media:/media or whatever your mountpoint is.

Finally open ~/.local/share/Daedalus/mainnet/namespaceHelper. (now this file is in fact in the HDD since you have already linked at step 4) with an editor and repeat exactly what we did in step 5.

Say some prayers.

Now you are probably OK and when run, Daedalus should start working on the HDD copy.

Make sure it finalizes replaying the ledger and synching the blockchain.
Make sure everything works just fine.

You may now delete the backup ~/.local/share/Daedalus_ from your SSD.

I still can't try this until I get a new more powerful notebook, but it looks like it will work. Thanks for all the details. I will probably need this in the future.

I use symlinks with Daeadalus all the time. I typically don't symlink the entire Daedalus directory. In my case, state-cardano is a separate zfs volume on my system:
ls -hal ~/.local/share/Daedalus/
total 7.5K
drwxr-xr-x  3 sam users  7 Aug  6 15:25 .
drwxr-xr-x 36 sam users 37 Oct  1 21:23 ..
lrwxrwxrwx  1 sam users 39 Apr 13  2018 devnet -> /home/sam/state-cardano/daedalus-devnet
lrwxrwxrwx  1 sam users 40 Mar 30  2018 mainnet -> /home/sam/state-cardano/daedalus-mainnet
lrwxrwxrwx  1 sam users 40 Feb 17  2021 mainnet_flight -> /home/sam/state-cardano/daedalus-mainnet
drwxr-xr-x  7 sam users  9 Aug  6 15:29 shelley_qa
lrwxrwxrwx  1 sam users 40 Mar 22  2019 testnet -> /home/sam/state-cardano/daedalus-testnet

Finally got around to trying this, but I'm missing something. I created /media/dataspace/data/Cardano and moved (using cp -a) /home/bigbird/.local/share/Daedalus/mainnet/ there and replaced the original with a symlink. When I start Daedalus, I get mkdir: cannot create directory '/home/bigbird/.local/share/Daedalus/mainnet': File exists

I gave up on Daedalus until I get a new notebook. It won't run on mine any more.


text:
Not in scope: data constructor ‘PayToPubKey’ - Fixing the Week 1 Pioneers Exercise
So in week 3 of the Plutus Pioneers program, the Plutus build changed which meant code in weeks 1 and 2 would no longer work. From what I can find, no one has published an updated set of code for weeks 1 and 2 that work with the latest build. I had a go myself and made some progress but I'm stumped by these two errors:
Compilation Error, Line 169, Column 13 (jump)
 error:
    Not in scope: data constructor ‘PayToPubKey’
    |
169 |             PayToPubKey   -> traceError "wrong output type"
    |             ^^^^^^^^^^^
Compilation Error, Line 170, Column 13 (jump)
 error:
    Not in scope: data constructor ‘PayToScript’

Any suggestions on how to fix?

The updated code for this looks like this:
ownOutput   :: TxOut
outputDatum :: AuctionDatum
(ownOutput, outputDatum) = case getContinuingOutputs ctx of
    [o] -> case txOutDatumHash o of
        Nothing   -> traceError "wrong output type"
        Just h -> case findDatum h info of
            Nothing        -> traceError "datum not found"
            Just (Datum d) ->  case PlutusTx.fromData d of
                Just ad' -> (o, ad')
                Nothing  -> traceError "error decoding data"
    _   -> traceError "expected exactly one continuing output"

The TxOutInfo type has now been replaced with TxOut which combines the data for a public key address and a script address. A public key address will not have a Datum, hence the Maybe.
data TxOut = TxOut {
  txOutAddress   :: Address,
  txOutValue     :: Value,
  txOutDatumHash :: Maybe DatumHash
}

The updated code for week 1 is now available in iteration 2 of the program, currently in the main branch of the Plutus Pioneer Program repo.

authors: Παύλος Τσότρας


text:
Will there be a web-based Daedalus wallet?
Will there be a web version of the official Daedalus wallet? It is possible to build one for the Cardano community?

No.
Daedalus is a full-node wallet, which means it runs cardano-node (no web version) and downloads a copy of the blockchain onto your computer. With a blockchain size of 10GB and growing, it doesn't really make sense for Daedalus to run in a full web browser.
Yoroi is the official web/light wallet, available as a chrome extension, iOS, or Android app. https://yoroi-wallet.com/


text:
Will there be token burn at any point in time in future?
Will there be token burn at any point in time in future ?

Does this answer your question? Ways to burn tokens?

I’m voting to close this question because the questions about the future of Cardano can't be effectively addressed on this site and would be better addressed directly to the Cardano Team on their forum. This site is not operated by the Cardano organization. This site is a place to ask questions about how Cardano works and to ask for help using it.

Decreasing the supply of ADA by burning tokens is a method to artificially raise the value of the remaining supply. It has been repeatedly stated that all ADA has an owner/purpose and supply will not be reduced by burning ADA.
ADA relies on use and utility to increase its value.

You can burn your ADA by making an address with no valid private/public keys if you want to, and send coins to it.
There appears to be no rational reason to do such things though, what motivation is there to do such things.

If you are referring to native tokens, that all depends on the minting policy. If you are referring to ADA, then no. Charles has answered this question many times in AMAs.

The concept of Token burning is funny and Stupid. Think about it. You bought it and you want to artificially pump your bags by burning the supply. If you really believe ADA is a SOV and real money why would we want to burn it? Any serious coin should not do a coin burn. ADA will never ever do a burn or reduce the supply! Our max supply is 45 billion and that will remain. Nothing more, nothing less


text:
Are there plans to keep the blockchain/node size small enough to maintain decentralisation?
One issue bitcoiners like to mention is node size in relation to decentralisation. Currently we are at like 10gb, I saw that the max growth is apparently 100gb a year. Are there any plans for reducing this? Or do we think technological improvements will be fast enough in the hard drive space that 100gb a year is fine? I agree with the importance of making it available to the average person to run a node.

I assume with "blockchain/node size" you mean the growing size of the immutable ledger database. The current growth rate is pretty linear. In the last 100 days it grew from 7 up to 10.5 GB

So we see a growth rate of about 1 GB per month, which would result in a 12 GB per year.
Keep in mind the ledger DB folder now contains every UTXO action since Nov-2017, not just since Shelley-Mainnet launch in Aug-2020.
New capabilities like Metadata or additional activities from native Tokens, NFTs and soon Smart-Contracts may increase the growth rate a bit.
So existing Hard drives with 2-12 TeraByte capacity should provide plenty of space for the next years.


text:
Is there a Browser-based wallet for Cardano?
Will we have a Cardano Browser Wallet?
Something like Metamask on Ethereum.

We have Yoroi Web extensión for Chrome, Firefox and Edge.
www.yoroi-wallet.com

I wouldn't recommend yoroi. It's not very actively being developed/ enhanced.
Check out Eternl.io (formerly CCVault.io) or Nami (very simple) or soon Lace.io

would not recommend as i could not found preprod or prevew network support for testnet

It's called Yoroi. It's a browser extension like Metamask.

Would not recommend as I could not found preprod or preview network support for testing and development

There is something similar, though it's more a "web wallet", not a browser plugin wallet like Metamask.
Checkout AdaLite

GeroWallet was launched a couple of weeks ago and it works exactly like Yoroi.

Eternl (https://eternl.io/), previously known as ccvault.io, provides browser extension (DApp connector & DApp Browser) for Chrome, Edge, Brave and Opera browser.

DApp Browser: users can connect their wallets to DApps listed in Eternl's DApp Browser.
Supports different testnet networks or other supported Cardano based networks.
TxBuilder feature: it allows you to add multiple outputs to a transaction and choose which utxos you want to spend. It also has support for custom json metadata.
Dark Mode.

The team consists of developers of community stake pools [TITAN] TITANstaking and [AHL] AHLNET.

Here’s a growing list:
Yoroi (legacy, by Emurgo)
Nami (by BERRY stake pool, supports testnet)
ccvault.io (coming soon for browser extension)
Flint (new but nice, by dc_Spark / Sebastian)
Gero (nice UI)

There is Yoroi, developed bei Emurgo, which also has a PC program and also a mobile app.

Yoroi is the famous one for ADA browser wallets.


text:
Mallet IELE Compiler crashes without Uncaught Error
I was able to get mallet running with the command ./mallet iele -d .
I created a simple contract that works in Remix but when I try to compile the contract using iele I get a Uncaught 'Compiler error: 0\nundefined'
The contract below
pragma solidity ^0.4.0;

contract Inbox {

    string public message;

    function Inbox(string initialMessage) public {
        message = initialMessage;
    }

    function setMessage(string newMessage) public returns(string) {
        message = newMessage;
    }

}

Just a guess: Your setMessage function should return a string but it doesn't return anything.

I tried to get it running  as well, but I IELE its still in R&D.
I recommend following this tutorial instead.
https://youtu.be/p3ee19mJUOA


text:
Will I be able to stake ada from coinbase?
Will I be able to stake ada from coinbase or will I need to transfer it to another wallet.

This question should not be here, for many reasons. It's not really related to ADA, but to Coinbase, it's contingent to the current state of things (which can change easily), it's not technical at all...

Currently Coinbase does not support staking ADA tokens. Implementation of ADA staking within Coinbase is something you would need to take up with Coinbase.

Coinbase doesn't support staking ADA, but Kraken does. You can stake ADA directly into their pool for a 4-6% earnings. See their May 4th 2021 announcement.
Otherwise, you can stake on Daedalus wallet, in any of the available pools. You can search for available pools inside Daedalus wallet itself, although you may prefer to complement with more information available from Pool.io.

Please avoid staking from exchanges. It centralizes the distribution of ADA and also gives the exchange full control of your assets.
To help yourself and the network, delegate directly from your wallet to single staking pool operators. That way you retain full control of your assets, help the network decentralize and help smaller pool operators to grow.

Is this a weakness of Proof of Stake? Inevitably, all of the major exchanges will offer the ability to stake in the future, and a large portion of people will stake their ADA on exchanges out of convenience. Is there any "game theory" Cardano can put in place to discourage this?

I can't think of any way. They would have to have a method to differentiate between a single pool operator and an exchange owned pool. I can't think of any way of prohibiting an exchange from creating a normal staking node like any single individual.

my understanding is the staking rewards diminish with size, thus encouraging smaller pools. But i guess this may still not be enough to prevent the big boys from offering their lower performing but super easy to use staking pools


text:
Is there any way to cancel pending transaction in CCvault or any cardano wallets
Hi i was swapping in sundaeswap and price went too far but my transaction is still pending in ccvault so can i cancel or remove pending transaction in ccvault before it goes to order and cancelling order with another fees.

I'd also like to know, I've just found out an address I've sent to is a scam address. How can I stop it?

You could try spending the same utxo the first transaction did and see if that one gets adopted in a block. If it does, that would make that one null and void. Also worth checking TTL on initial tx. It might already have failed and ccvault doesn't have TTL checking in it (I'm not aware of their design, just speculation on why it didn't get added to a block).


text:
What will the ERC20 converter use as an exchange rate?
Will it convert tokens based on ADA/ETH pair price at the moment of conversion? If so, which exchange will it use for knowing the rate of exchange?

Are you sure the ERC-20 converter can be used to swap tokens? My understanding is that it can be used to move the same token between the Ethereum network and the Cardano network.

I'm not sure, I only assumed. Good point. But then how would an ERC20 token benefit from the Cardano network advantages? This would give rise to many other questions.

For one thing, the ERC-20 could be an escape valve from the high gas fees on the Ethereum network if similar smart contracts on Cardano cost less to use.

I assume that a good solution would be to provide an oracle that calculates the average price coming from different exchanges.

Sounds like a great idea to me. Practical and appropriate Oracle application indeed. Though it would mean that the converter cannot function until it gets data feed from an Oracle first.


text:
Is there a way to calculate the intrinsic value of the ADA token?
I've been trying to wrap my mind around this problem.
How would one be able to semi-accurately (I know it's impossible to accurately do this) find the intrinsic value of a crypto asset. The only thing I can come up with is its utility.
Assets like bitcoin have the most basic utility of transferring perceived value from A to B not matter where A or B are via the internet, no middlemen involved, totally permissionless.
But then assets like ada must have more value than that because they can do the same transfer of value, faster and cheaper, and they are also required to access an ecosystem of dapps and virtually limitless applications.
How can we valuate such a token?
Has anyone been able to come up with a formula that's somewhat objective?

It is not a cardano question, or even a cryptocurrency question, but actually a question about economics. It seems to me that the idea of an intrinsic value is baseless. Value, like beauty, is in the eye of people and not in the things themselves.

Agreed, it's not specific to Cardano but it applies to it as much as to any other thing people consider valuable.

Agreed, not a Cardano question but an economics question, voting to close it.

Personally I don't see a problem with us allowing questions that are not "directly" related to Cardano (most SE sites will allow tangentially related questions too), but the community seems to have decided on this one and I'm outnumbered. I recommend you consider asking this on Economics.SE or PersonalFInance.SE or one of the many other sites (first check if it's in scope and check for a "duplicate" question).

Thanks, appreciate you trying anyway.


text:
Catalyst voting power not including staking rewards?
Why did my voting power not include all of my staking rewards during Fund3 or Fund4 voting?
My catalyst app shows less voting power than what my Daedalus wallet has in balance (and had in balance on the June 11th 2021 snapshot).
The difference it is roughly the staking rewards I accrued during the Shelley mainnet.

Looks like it does not at this time. If you use Yoroi and move the rewards over from the reward key to the main wallet that is one work around. The other would be to have a tx on Daedalus as that seems to consolidate from the staking key as well to the main wallet.
However, I'm not sure about future versions of catalyst which could change how this functions and perhaps not need to do the above.

To confirm (18 months later) - this is still the way the catalyst app works. I'm not sure why it does not take the "unspent" staking rewards into account, it would seem like a pretty sensible idea for it to include them. However, Daedalus users will need to make a transaction to claim the staking rewards into the main wallet.
You could, for example, send a couple of Ada to Coinbase, Binance, etc. You can always send them back if you want to. You'll notice the wallet balance in Daedalus will update and the "unspent rewards" will change to 0.

It's not clear how quickly the Catalyst app will refresh the wallet balance though - I assume it doesn't refresh on a regular basis but I have no doubt that the snapshot will be correct when it takes place.

The most simple way to move the staking rewards to your wallet in Daedalus would be to send some ADA to your own wallet. No need to send them to a third party.

@eddex you mean send from your wallet to the same wallet you're sending from? For some reason I assumed you couldn't send to the same wallet you're sending from but thinking about it I can't see why not

Exactly. You go to "receive", copy your address, go to "send", paste your address and send e.g. 1 ADA to your own address.


text:
How can we verify the 45B ada cap cannot be exceeded?
Is there a particular place in code that forbids exceeding this market cap? Should we be constantly keeping an eye on it after IOHK hands off the project to the community? Or is it somehow imbued in the chain's cryptography?

ADA can not be minted due to the parameter name of ADA in ledger and minting transaction validation being followed in Cardano.
In Detail.
Assets in Cardano is called as "Values" in eUTXO. Values can be ADA or any other Native tokens. In this respect, other user minted tokens also have equal status.  Tokens can be minted. Minting of ADA is not possible due to cleaver name settings. ADA was only minted in Genisis transaction and any additional minting is not possible. The reason is as follows.
Value is a Map of CurrencySymbol to a Map of Token Name to Integer. Every asset class is represented by Currency Symbol and Token Name. We cal also say that Asset Class is represented as a combination of CurrencySymbol and Token Name.
The ADA has a Currency Symbol and Token Symbol as empty Byte strings in the Ledger.
Transactions cannot create new assets. In the transaction, the input value has to be equal to the output value plus transaction fees.
We need a minting policy script to mint or burn tokens. The Hash of the minting script is the Currency Symbol.
Since no script Hashes to empty byte string, there is no way a minting transaction that mints ADA can be created.
The implementation in the Plutus repository and has been explained in a much better way in Plutus Pioneer Lecture #5 at around 15 minutes.
https://youtu.be/6VbhY162GQA


text:
Will there ever be a fiat on-off ramp in the official wallets?
Will we ever have to and from fiat conversion available in the wallet? This would go a very long way in adopting and using Cardano. Currently, using exchanges is a rip-off in fees and  a headache in KYC-AML rules, plus maximum daily/weekly withdrawal limits are the worst.
If we could easily convert ADA to/from USD and EUR, that would be a game changer for many people.
I suppose second best thing would be a trusted, high liquidity DEX that offers fiat on/off ramps.

Please refer to this question: Will Daedalus have a Fiat payment gateway?
In short: There's no official information on the topic yet, but a DEX related solution might be implemented some time in the future.


text:
Free failed transactions or DoS protection? Which is it?
I've been hearing that in Cardano transaction fees are highly predictable (in contrast to Eth gas fees) and that failed transactions don't pay fees. This is in direct contradiction to the transaction fee equation in the official docs ( https://docs.cardano.org/explore-cardano/fee-structure ) which includes a minimal fee (a) to prevent DoS attacks.
So which is true? Are failed transactions free or do they always have to pay a min fee?
Edit: please elaborate how the system works in these cases for anybody who is reading to understand.

On the Cardano blockchain there are two stages where a transaction can fail.
In the first stage, there are some integrity checks that are run. Also the node checks if the UTxO-inputs of the transaction exist and are free to be spend. No scripts are run at this stage. If the validation fails, no fees are collected.
In the second stage, scripts are executed. If one of them fails, fees are collected. For this purpose, the transaction includes a collateral-UTxO.
In summary, no fees are collected for unpredictable failures and fees are collected for predictable failures. This protects against DoS with scripts that are expensive to execute and fail.
That being said, there can never be a complete protection against DoS in an open network. If the system is flooded by a huge amount of stage-1-invalid transactions, I guess that the Cardano distributed system would get into trouble. But I also think, that this type of attack are probably difficult and expensive to execute.
There is a nice article explaining the topic here:
https://iohk.io/en/blog/posts/2021/09/07/no-surprises-transaction-validation-part-2/

Thank you for the answer and the reference link. The approach makes sense in many ways.

From what I understand nodes pull transactions when they are ready to process them, they are not pushed into the network, so this is an additional layer of DoS protection.


text:
Is there any kind of help for people who want to start a stake pool?
I would like to set up a stake pool but I have seen that with less than 800k - 1 million ADA it is not profitable. I would like to know if there is any kind of help for those modest pools that want to start with this type of structure to overcome the first months of life and cover the costs of servers until marketing and advertising do their job. Thank you very much.

I’m voting to close this question because it feels more like a discussion - if you have questions on how to start a stake pool, ask that. This site is a great resource for learning about Cardano but it's not intended to be used to find others to pool up with.

You can apply for support from the Cardano Foundation here. https://iohk.io/en/blog/posts/2021/04/01/announcing-a-new-round-of-community-stake-pool-delegation/
These happen quarterly, there's no guarantee that you'll get it, but it's worth a shot, especially if the mission and vision of your stakepool aligns with that of the foundation.
Edit.
It seems the form is closed, but I'd suggest keeping an eye out for the next round of delegations.

Indeed if you do not have a good amount of delegated ADAs in your pool you will not be able to create blocks with which you will not receive rewards. In fact, some pools have left the cardano network because it did not pay them to keep BP and Relays without the possibility of receiving any reward after months. It is a task that you should take as a business, look for people who want to delegate their ADAs in your pool and make your economic and time investment. Good luck!