text:
Does the testnet faucet still exist? How to create testnet ADA?
We are learning how to work with the cardano wallet cli in pursuit of building our product. We're just getting started. We would like to work in the testnet because we have a lot to learn and we don't want to burn real ada while we learn it.
So, we have brought up the wallet like so:
NETWORK=testnet docker-compose up
This uses the iohk docker-compose found here:
https://github.com/input-output-hk/cardano-wallet
Now, when we hit the information endpoint we get:
docker run --network host --rm inputoutput/cardano-wallet network information

Ok.
{
    "node_era": "byron",
    "node_tip": {
        "height": {
            "quantity": 201726,
            "unit": "block"
        },
        "time": "2019-09-09T18:49:36Z",
        "epoch_number": 9,
        "absolute_slot_number": 202768,
        "slot_number": 8368
    },
    "sync_progress": {
        "status": "syncing",
        "progress": {
            "quantity": 7.09,
            "unit": "percent"
        }
    }
}

So far as we can tell this is all normal. However, we're not sure how to proceed as we have no testnet ada. We found mention of a 'testnet faucet' but can't find any actual documentation on how to use it. How to folks go about creating ada for use on the testnet?

You can request tAda from the test faucet here. By adding an address without an API key you will receive 1000 tAda. You could also request an API key from IOHK to have a bespoke amount of tAda/Testcoin if required. Once you're finished with your tAda you should return them to this address (which you can see on the official documentation page too).
addr_test1qqr585tvlc7ylnqvz8pyqwauzrdu0mxag3m7q56grgmgu7sxu2hyfhlkwuxupa9d5085eunq2qywy7hvmvej456flknswgndm3


text:
Re-Implementing Policy Hashing in Python
As the title says, I want to to reimplement the hashing part of a policy script in Python 3.
I have already made a post over at forums.cardano.org, and someone has pointed me to the right direction of serializing to CBOR according to the CDDL specs.
Here's the relevant part of the CDDL specifications:
native_script =
  [ script_pubkey
  // script_all
  // script_any
  // script_n_of_k
  // invalid_before
     ; Timelock validity intervals are half-open intervals [a, b).
     ; This field specifies the left (included) endpoint a.
  // invalid_hereafter
     ; Timelock validity intervals are half-open intervals [a, b).
     ; This field specifies the right (excluded) endpoint b.
  ]

script_pubkey = (0, addr_keyhash)
script_all = (1, [ * native_script ])
script_any = (2, [ * native_script ])
script_n_of_k = (3, n: uint, [ * native_script ])
invalid_before = (4, uint)
invalid_hereafter = (5, uint)

CBOR and CDDL are both new to me, so I'm not sure if I am doing it right.
According to the above specification, my script
{
   "type":"all",
   "scripts":[
      {
         "keyHash":"37c19eca0d623d804bfeb8951bf1eb0f7fe193deeb71793985dbd25e",
         "type":"sig"
      },
      {
         "type":"before",
         "slot":32241869
      }
   ]
}

would evaluate to:
native_script = [1, [[0, $hash28], [5, uint]]]
Is this correct? Do I need to use any cbor tags for serializing?
Here is my attempt so far (I've tried many variations already, but this feels like the most correct one):
import hashlib
from cbor2 import dumps, loads, shareable_encoder, CBORTag

class Sig:
        def __init__(self, hash, slot):
                self.hash=hash
                self.slot=slot

def default_encoder(encoder,value):
        encoder.encode([1, [[0, value.hash.encode()], [5, value.slot]]])

obj=Sig("37c19eca0d623d804bfeb8951bf1eb0f7fe193deeb71793985dbd25e", 32241869)

serialized = dumps(obj, default=default_encoder, value_sharing=False)
print(serialized.hex())
m=hashlib.blake2b(digest_size=28)
m.update(serialized)
print(m.digest().hex())

result = loads(serialized)
print(result)

Needless to say, the code does not calculate me the same policy id as
cardano-cli transaction policyid --script-file test.script does.
I am using the library cbor2, which seems the best maintained one for python. Also, I use blake2b with digest_size set to 28 bytes since the ledger specs say blake2b_224 is used for multisig scripts. I am however also not sure if the other parameters in the hash function need to be set or not. My haskell skills are also not the best, so trying to look up in the original source code didn't get me very far, and I've tried so now for several hours :-)
If anyone could help me, it'd be very appreciated.

It seems I was close, but the str.encode() function was not the correct one to use.
Also a zero byte needs to be prepended to the data to be hashed. Thanks to user bwbush from the cardano forum for helping me out, couldn't have done this without his help!
Here's the final solution:
import hashlib
from cbor2 import dumps, loads, shareable_encoder, CBORTag

class Sig:
        def __init__(self, hash, slot):
                self.hash=hash
                self.slot=slot

def default_encoder(encoder,value):
        encoder.encode([1, [[0, bytes.fromhex(value.hash)], [5, value.slot]]])

obj=Sig("37c19eca0d623d804bfeb8951bf1eb0f7fe193deeb71793985dbd25e", 32241869 + i)

serialized = bytes.fromhex("00") + dumps(obj, default=default_encoder, value_sharing=False)

m=hashlib.blake2b(digest_size=28)
m.update(serialized)

print(m.hexdigest())

source: Stack Exchange

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

sort: votes


text:
Is there an equivalent to the Wallet Connect protocol in the Cardano ecosystem?
With the Alonzo update approaching, many teams seem to be working on DeFi projects that will go out along the Smart Contracts feature. On Ethereum, most DeFi projects use the Wallet Connect open protocol to communicate with wallet apps, but on Cardano it appears there is no such open protocol.
Is there any team working on an open Wallet communication protocol such as the ones present in the Ethereum ecosystem? If not, does it mean each Wallet App will need to come up with its own?

There is no open standard published right now, but work is ongoing to create one.
Emurgo is working on porting the EIP-0012 Ergo standard that the Yoroi Ergo dApp connector is using to Cardano. Have a look at the CIP-Dapp-Connector pull request.

It is September 2023 now. Does a standard exist yet?

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


text:
Are there any plans to have a bridge between the Cardano and Cosmos blockchains?
Are there any plans to have a bridge between the Cardano and Cosmos blockchains? Cosmos is working on the gravity-bridge which is a bridge between Ethereum and Cosmos so I assume there must be some emerging composability Cardano <-> Eth <-> Cosmos however the gas fees for this would be crazy.
Would Cardano's ERC20 converter let you go directly between Cardano and Cosmos because they both support ERC20 tokens?

Should one of the answers be marked as accepted?

The Cosmos Blockchain and Atom token are not based on ERC-20, they support their transfer, so there is no prospect that the Cardano ERC-20 converter could be used directly.
No mention has been made of a Cardano-Cosmos bridge that I am aware of.

I believe every project is driven by a motive. ERC-20 converter makes sense because there are a lot of tokens that are struggling on ETH and would want to migrate. Sorry I have not done enough research on Cosmos. Although I like it based on what I know. But what would be a driving factor or a need for such a bridge between Cardano and Cosmos? May be that will help answer your question better.

In short, no. The ERC-20 converter is meant only for ERC-20 tokens, which exist solely on the Ethereum blockchain.
I can only speak for myself here, but knowing how strongly the Cardano community believes in decentralization, I highly doubt there is any will within the Cardano community to create a bridge with a centralized blockchain ecosystem.
Binance smart chain, for example, has 21 (last I checked..) nodes in TOTAL.
I do agree that there will be a "multi-chain future", but if a bridge were to be made it would likely be an effort on Cosmos behalf, not ours. I could be wrong however, if there is enough will to make it happen, anyone who knows plutus could design a smart contract to work as a bridge. However, I myself have zero interest in such a project as I am focused solely on Plutus dApps.

Cosmos is a framework that allows for decentralised blockchains. If I create a separate Cardano blockchain with a different network ID I could argue that's a centralised ecosystem too, as I control the only node.

There isn't a bridge, but I think we could benefit from one. As far as I know, there currently isn't a working decentralized hosting service on Cardano, like Akash on Cosmos. NuNet is in alpha, but I'm not sure when it'll be at the stage where Akash is presently.
I'm going to run into this issue later this year, while developing a decentralized no-code platform for building workflows. Should be fun


text:
Plutus Contracts Delegation
Is there or will there be such a thing where delegators can stake to a smart contract itself, rather than a pool?

No, as the smart contract cannot produce blocks.
However, funds within a smart contact can be delegated to a pool.


text:
Calculate timestamp from slot
Is it possible to calculate a timestamp from a slot no? Since one slot is one second it should be pretty easy. But...
The current slot now (Tue 18 May 2021 05:46:04 PM CEST) is 29786450.
In mainnet-shelley-genesis.json i can see systemStart  "2017-09-23T21:44:51Z"
Which is acually 1506203091 as unix timestamp.
If i calculate 1506203091 + 29786450 i get 1535989541 which is Sep 3, 2018, 5:45:41 PM something in 2018.
Is there a simple formular? It seems that the actual start date must be something like June 7, 2020 but i cannot find anything abount this date.

You did not account for Byron, where one slot was 20 seconds.
To make it easier, take the start time of epoch 209 which is the Shelley hardfork and started at 1596491091 unix time on slot 4924800.
Therefore to calculate the time of the current slot, you might try something like: 1596491091 + (current_slot - 4924800).

thank you, is this timestamp documented anywhere?

Not directly documented, it's on chain, I used blockfrost to retrieve it: https://cardano-mainnet.blockfrost.io/api/v0/epochs/209 (need blockfrost.io token).

Hi i cannot accept your answer, because if i calculate 1596491091+29786450=1626277541 => 14.07.2021 - 17:45:41 which is far away from Tue 18 May what am i doing wrong?

Oh right, the epoch 209 started on slot 4924800. So you need to do: 1596491091+(current_slot - 4924800), I have edited my answer to mention this.

looks good, thank you

Hi, I'm trying to do the same thing in testnet. What unix-time/slot should I use  for testnet ? Thanks in advance.

Note this answer could change if a hard fork changes parameters.
The Shelly unix time is the start time of the Shelly era and the Shelly slot is the corresponding slot. We use these values to ignore the Bryon era (with odd slot value).
Calculate a slot: (returns the Cardano slot)
UNIX_TARGET_TIME - 1596491091+ 4924800

Check a slot: (returns unix timestamp)
1596491091 + (SLOT - 4924800)

Python example:
from datetime import datetime

SHELLY_UNIX = 1596491091
SHELLY_SLOT = 4924800

def getSlotFromUnixTime(ut):
    return ut - SHELLY_UNIX + SHELLY_SLOT

def getUTCEstimateFromSlot(slot):
    ts = SHELLY_UNIX + (slot - SHELLY_SLOT)
    print(datetime.utcfromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S'))

source code: https://github.com/pixel-pool/PythonCardanoSlotsScript

Calculating a timestamp from a slot number is risky!
Theoretically, the slot duration could be changed by a hard fork for example because of performance reasons (as has already happened). So it's probably best to use an oracle for now.
But because time is used so frequently, it would probably be best if Cardano would support a more reliable native solution that avoids oracle fees.

ok thank you i thought slotnumbers were a reliable timestamp

That is very unlikely. This is the reason that the coefficient number was introduced. This parameter will be used to tune the network pace, not the slot number. The reason for the change in Shelley was this exact bad design, that is now fixed.

Also, Cardano will likely lean into having to use an oracle, as evidenced by their explicit relying on a random global oracle for Ouroboros Chronos, and their overall trend towards distributed systems, not just distributed payment channels.


text:
ERC-20 converter transaction history
When Ethereum projects move over to Cardano via the erc20 converter, will their existing transaction history be maintained on the Cardano blockchain?

Not directly, as the token minted on the Cardano blockchain will be a new asset.
If such an use case is needed, one might use an oracle to see it or metadata to record it at the minting time.


text:
How long does it take to sync a node or a Daedalus wallet? What factors does it depend on?
How long does it take to sync (download the blockchain) to a Daedalus Wallet or node. What factors does this depend on (download bandwidth, size of blockchain, upload bandwidth of the source (node))?

It all depends on your hardware, mostly CPU and network connection (yours and your peers), but on most newer hardware you should be able to sync it within a day right now.

As you also asked for a wallet, also note that after your local full node fetched and verified all blocks from the network, your wallet software (Daedalus) may has to restore an existing wallet, and so walk through the whole UTXO history (all blocks)
The more wallets you restore/update the same time the longer it will take

Also can be factor that how many relay nodes the wallet connects to. Right now by default that is only one node - the IOHK server. and that can sometimes not enough since it can be overloaded because lot of wallets can connect to that server simultaneously.
This limitation will be solved by the p2p node discovery will be introduced later this year..
btw, here is a workaround how to define more relays for the wallet:
https://forum.cardano.org/t/workaround-to-fix-daedalus-connecting-to-network-and-syncing-issue/59780?u=laplasz

Note that IOHK is running several nodes and you are not connecting to only one.

@MarekMahut-StakeNuts the topology file of the wallet contains only 1 address, so the node will establish a connection only with that address.

That one addresses resolves to a lot of different nodes. Also, cardano-node topology specifies the valency of this address. In other words, it specifies to how many nodes it should connect to from the specified hostname.

the valency is 1 for the default hostname. Yes, it can be different IP, but only 1 connection will established.

On 1st November 2021, I synced Daedalus Mainnet wallet for approximately 9 hours, and, on 2nd November 2021, Daedalus Testnet wallet for 1 hour.

Daedalus is a full cardano-node exe with a pretty GUI.
When you first start it up, it will connect to nodes defined in topology file, default relays-new.cardano-mainnet.iohk.io
So the syncing performance depends on various factors:

Your bandwidth and your peer's bandwidth
Your CPU performance
Your RAM (every peer in your topology will consume RAM)
Network status (it can be slower when operations occur on the ledger)

Remember that you can add some of your favorite peers in the topology, but not too much to not overload RAM.


text:
Is there a timetable of dates for Project Catalyst phases/cycles?
I am looking for the most reliable and official way to find:

Next date Project Catalyst starts a new cycle
Dates for the phases in the current cycle.

I guess this is what you are looking for
https://cardanocataly.st/funds/

As you can find here there is a link to IdeaScale portal and link to Telegram chat group in which they announce all new events (Crowdcast, Fund cycles, etc.).
Basically every 6 weeks we have a fund round but sometimes because of technical or other reasons there are delays (as with Fund 4).
You can also subscribe to the email newsletter to receive the latest updates or to check in Cardano forum.

I am looking for a resource that can simply be looked at anytime to get the dates.  The sources you list depend on active monitoring or scrolling back through announcements to determine the current dates.

This is the current situation. Once there are other resources I will update the answer.

Here you can also find more information about the different events via Crowdcast: https://www.crowdcast.io/iohk


text:
What is the Cardano Stiftung?
I have seen this mentioned a few times and have no idea what it is.
I get the impression that it is referring to the combination of the Cardano Foundation, IO Global and Emurgo.

These are synonyms. Stiftung is German for foundation. The Cardano Foundation is located in Zug, Switzerland - a German-speaking part of the country.
The twitter handle of the (now verified) Cardano Foundation is CardanoStiftung: https://twitter.com/CardanoStiftung.


text:
Are there any API's I can integrate with to accept Cardano as a merchant?
I run a small tourism startup and I'm looking for an API I can integrate with to accept Cardano on our website. Does anything like this exist? Sadly, neither Coinbase Commerce nor Bitpay are currently supporting Cardano.

To answer my own question, you can currently use https://nowpayments.io/,  https://adapay.finance/, or to roll your own solution https://blockfrost.io/.
There's also an ongoing petition to get Cardano added to BitPay.


text:
Can we expect to see already existing stablecoins on Cardano?
I know there is a new stablecoin (AgeUSD) that is supposed to be released on the Cardano blockchain, but I haven't heard anything about having other stablecoins, like Tether (USDT), be added to the Cardano blockchain. Is this something we can hope to see, or is the creation of AgeUSD going to make the addition of Tether not necessary?

As far as I know, the Liquity team is interested to have their protocol deployed on Cardano too. But it is too early to tell.


text:
Is there a minimum amount of ADA I can send in a transaction?
Can I send 1 lovelace (0.000001 ADA) to another address or is there a minimum amount I need to send?
Of course there will also be the transaction fee of (currently) ~0.16 ADA, so such a transaction would not make much sense in most cases. Still I'm curious if it would work.

There is a minimum UTxO transaction size of 1 ADA not including fees. That means the absolute minimum transaction is 1 ADA + fees.

Is there any information why this is the case? This might become a bit of a problem in case the price keeps rising.

It is to reduce dust/lots of small UTxOs and goes back to when ADA was $0.02. I've seen people mention plans to make this value change dynamically, or to have a vote on changing it. You can find more information here https://cardano-ledger.readthedocs.io/en/latest/explanations/min-utxo.html

I am really curious about upcoming changes to all parameters that go back to when ada was rather cheap. Minimum transaction size and especially transaction cost are two very important examples and it will be interesting to see how a change or vote will actually look like.

Is 'gas' a thing in Cardano? I think only Ethereum has 'gas'. Like Bitcoin, Cardano just has tx fees.

There is an additional amount of minimum ADA for a UTxO if that UTxO will contain native assets, based on how many unique policies are present. This may be what the answer refers to as 'gas', or they could mean the tx fees, but it would be good to clarify. 'Gas' is not a term used in the Cardano documentation

@EddySchauman-Haigh that link doesn't work - where can I find the 1 ADA + fees minimum docs?

Seems like a tx-fee cash grab. Good for the network validators, bad for users. I understand if a transaction should have a minimum in total but having a minimum per output in a tx only decreases the utility of the chain.. i.e. no micro-transactions and multi-asset development isn't cost-effective. Cardano shouldn't focus on layer-1 problems and should instead think about actual layer-2 utility, imo

A configurable network parameter called minimum_utxo_value is responsible for this. As the ADA price rises, the quantity field, expressed in lovelaces, will get lower and lower. Today, 21st October 2021, this value is 0.999978 ADA.
"minimum_utxo_value": {
    "quantity": 999978,
    "unit": "lovelace"
}

In order to see Cardano network's parameters, you need to execute a network command of the cardano-wallet utility (you must first run cardano-node and server).
cardano-wallet network parameters

In addition to fees (txFeePerByte + txFeeFixed) as shown in the protocol parameters below, you can see that there is as well a minUTxOValue field that specifies the lowest UTxO output.
Therefore, a transaction cannot contain less than txFeePerByte + txFeeFixed + minUTxOValue. These three parameters can be changed once governance is active.
Protocol parameters
    "txFeePerByte": 44,
    "minUTxOValue": 1000000,
    "stakePoolDeposit": 500000000,
    "decentralization": 0,
    "poolRetireMaxEpoch": 18,
    "extraPraosEntropy": null,
    "stakePoolTargetNum": 500,
    "maxBlockBodySize": 65536,
    "maxTxSize": 16384,
    "treasuryCut": 0.2,
    "minPoolCost": 340000000,
    "maxBlockHeaderSize": 1100,
    "protocolVersion": {
        "minor": 0,
        "major": 4
    },
    "txFeeFixed": 155381,
    "stakeAddressDeposit": 2000000,
    "monetaryExpansion": 3.0e-3,
    "poolPledgeInfluence": 0.3


text:
Why do we need parameterized contracts? Can't we just use datum?
While writing validation as:
mkValidator :: SomeContractParam -> SomeDatum -> () -> ScriptContext -> Bool

Could't we pass the same thing to Datum instead of using Contract Parameter?

Yes. It's important to have both options though.
Remember that the script address is derived from a hash of the compiled script code. So, if you parameterize parts of the script, the script address will be different with each parameter.
An example Lars gives in the PPP is an NFT. If you parameterize the forging policy to take a specific UTxO, and that script consumes that UTxO, you guarantee that there is only one instance of that policy. Only the person who owned that UTxO could possibly create that token, thus guaranteeing the creation only happens once.
If you had the same UTxO field in the datum, any instantiator of the script could specify some UTxO they own and the script address would be the same. Since the Currency Symbol is in fact the Script Address, any caller could create duplicates of the token and those tokens would be fungible.

Are you proposing using SomeDatum' = (SomeContractParam, SomeDatum) in lieu of SomeDatum as the actual datum to use so that you can drop the SomeContractParam mkValidator argument?
If so, then here is a problem. It is easy to find all the UTXOs at an address (including script address), by using utxoAt, so when you have different script addresses associated with different SomeContractParam values, utxoAt will separate out the UTXOs for you by the SomeContractParam. If you use (SomeContractParam, SomeDatum) as the actual datum and one script address for handling all the different SomeContractParam values, you can't easily segregate the UTXOs by SomeContractParam especially when the blockchain stores only DatumHash and not Datum. So e.g. you can't easily specify "spend UTXOs from among those that match a certain SomeContractParam" -- you would have to lookup the datum of all the UTXOs somehow.
Furthermore you would have to include the datum in the ScriptLookups submitted for the transaction in order for the validator to get the SomeContractParam value from the datum, resulting in needing to encode the transaction request with more bytes.


text:
How does the ERC20 converter actually work?
Since Ethereum & Cardano are distinct networks, when the ERC20 converter moves tokens between them in either direction ensuring conservation of token (the process does not destroy or create tokens), what is actually happening? Is the ERC20 converter a centralized process that operates on both networks or something more decentralized and trustless? If it's not a centralized process, I would be very interested to know how conservation of tokens is maintained considering that the two networks do not directly interact with each other.

From the IOHK blog post: Bringing ERC20 to Cardano

Our ERC20 converter is a tool that will allow issuing organizations
and their users to handle ERC20 token migration to Cardano. It is
designed for token issuers (organizations that wish to enable the
migration of their tokens to Cardano), and their users (token holders)
to use the tool to move their ERC20 tokens to the Cardano network.
Users can convert their Ethereum tokens in just a few clicks, and when
moved across, these tokens will be ‘translated’ into a special native
token on Cardano that has the same value and works just like an ERC20.
Additionally, if the user wishes to do so at a later stage, they can
move their tokens back to the source network by burning them on
Cardano. Two-way convertibility is baked in.

After logging into the ERC20 converter, Users must authenticate their source account via Metamask and provide their Daedelus address for token delivery.  Tokens are then migrated to to the Cardano address.  All operations on the migrated token are visible on both Cardano explorer and Etherscan
Conversion is token specific and adding a token for conversion requires partnership to add a token to the list of tokens available for conversion.

OK, but that still doesn't explain how the conversion actually happens on a blockchain level. Metamask is just the UI. How does the conversion atomically remove an ERC20 token from Ethereum and put a matching native token on Cardano? Is it done by a central program that interacts with both blockchains? If not, how?

It's the best answer I could come up with, not the best answer there is.  As I understand it, the Ethereum ecosystem sees it as having a Cardano address and all the ERC-20 properties.  The Cardano ecosystem sees it as a native token.  I suspect the burn process transfers it back to an Ethereum address but I couldn't confirm these assumptions.

The answer is EVM. Ethereum Virtual Machine. You should definitely look into how they work.
It works the same way centralized exchanges like Binance and CryptoCom work.
The coins value is intrinsically already a part of the system and the coin itself is a native token on the Cardano network regardless if its ERC-20 or not.
By using the EVM technology they can convert coins instead of wrap them by having a bridge between both networks and having a version of both ADA on ERC-20 and ETH natively on Cardanos network. Liquidity providing is how you know your coin is still your coin and because it's on the blockchain its verified by the entire network that the transaction took place for garunteed no duplication.


text:
What is an Initial Stake-pool Offering (ISO)?
The decentralized exchange Sundaeswap is planning an initial stake pool offering (ISO) on Cardano.
How does it work and what are the differences/advantages over an ICO?

There is a blog post that describes it quite well: https://sundaeswap-finance.medium.com/sundaeswaps-upcoming-initial-stake-pool-offering-iso-48fade1900a
Basically they will create a Cardano stake pool and you can delegate your ADA to this pool from your Yoroi or Daedalus wallet. The pool will take 50% - 100% margin fee (to fund the SundaeSwap developers). This means you will get less ADA as rewards from the pool. To compensate for this, they will send you some of their new SundaeSwap tokens.

EDIT: There is a more in depth blog post here.

EDIT 2: On 11-JUL-2021 there was an update from the SundaeSwap team.
You can read it here: https://www.sundaeswap.finance/posts/iso-update-3
They changed it to a 0% margin fee model that only lasts for 5 epochs. It will be launched together with the DEX shortly after the Alonzo launch on mainnet.

"...the ISO funding model is distinct, and does not represent the sale of a security." do they have a layer backing up this claim? I see that people will do this because they think that their tokens will be more valuable in the future and that will be treated as security. Or am I missing something?
--- edit
Or the "trick" is that one is paying in the future rewards and not "money" that one has "at the moment". Sill would be nice to see some layer opinion about it :)

Looks like they are planing to show this legal framework: https://www.sundaeswap.finance/posts/iso-update-3


text:
How do nodes access the validator code?
As far as I know, script address is the hash of the validator script. (Or has the hash of the validator script. I don't know which). So when a node wants to validate that address, It needs to run the validator script. So how does the node access the script?

Provided answer to a similar question here https://cardano.stackexchange.com/a/9610/1275

A validator script is compiled into Plutus Core by the Plutus Tx compiler. (It's actually a bit more complicated: see https://iohk.io/en/blog/posts/2021/02/02/plutus-tx-compiling-haskell-into-plutus-core/)
This compiled script is shipped within the transaction.
Hashing the validation script ensures that funds potentially located at a script address can only be consumed by transactions that include the exact same script.

Someone managed to write some code which retrieves the scripts from the chain https://forum.cardano.org/t/proving-a-particular-policy-script-constraint-i-e-before/57443/11


text:
How does the price of BTC impact the price of ADA?
With the value of ADA being an important incentive to participate in the blockchain, and a stable value being an important indicator for the health of the Cardano ecosystem, how can the 1:1 mirrored short term price movements with BTC be explained?

Bitcoin is a proof of work blockchain that one may expect to lose in value with less climate-impacting proof of stake blockchains like ADA gaining popularity. Without an obvious connection between these two, many people could draw false conclusions from price developments observed in ADA (or other coins, for that matter)
While differences in individual market development can be observed in longer time-frames (which are NOT topic of this question), there seem to be correlations between the price development of BTC and the price development of ADA.
How can this be explained?

The prices are not always correlated (just look at the last couple months). When they are its because the drop in BTC reflects negative sentiment in the crypto market as a whole. Also, trading algorithms (bots) probably trigger on BTC fluctuations as well.

I was talking about short term changes, as emphasized. I have added some screenshots to show what I mean. Of course, when looking at the long term development, ADA is overall more solid, which represents the solid foundation and better outlook. But where does this obvious behavior as seen in m screenshots come from? A crashing PoW blockchain should not impact other PoS blockchains in such a way. I would expect the opposite behavior. A negative crypto sentiment would only show slower changes, and not these 1:1 changes. My question remains, there must be a connection that is not obvious to me.

This question has no clear-cut fact-based answer.  It is a matter of opinion and market speculation.

@gRebel, how is this opinion based and market speculation? I am looking for a clear-cut fact-based answer and already got the first replies. I don't want to know what influences the prices in general. I want to know, how it comes that the BTC movements are mirrored 1:1 on ADA. (Ignoring independent movement on ADA which can be seen over longer periods of measurement)

There are many algorithmic trading bots that take advantage of arbitrage between different exchanges & token pairs.
In your example, the price of BTC/USD is decreasing. If the ADA/BTC price does not change, then the ADA/USD price will decrease by the same percentage. This is because arbitrage bots find opportunities where the implied price ADA/USD / ADA/BTC is different from the market price of BTC/USD, and buy/sell all 3 pairs quickly to capture that inefficiency as profit.
tl;dr In order for the price of ADA/USD to remain the same, ADA/BTC would need to increase at the same rate that BTC/USD is decreasing.

Is ADA/BTC not determined by ADA-XXX-BTC with XXX being some fiat? With BTC/USD going down I would expect ADA/BTC to go up and ADA/USD to remain the same.

Too late for an edit: I read up on arbitrage. With ADA/fiat, ADA/BTC and BTC/fiat being exchanged with independent rates, this arbitrage trading is very likely the reason for this market movements. This is probably the connection that was not obvious to me. I really underestimated the impact of these trading bots! That being said, your answer is what I was looking for! Thank you!


text:
How to validate transaction where number of tokens are generated based on the value locked in a contract?
As far as my understanding token with some amount can be forged by using this constraints.
Constraints.mustForgeValue SomeValue

And ada can be locked into smart contract using mustPayToTheScript if i am not wrong.
So how to validate this transaction where some ada can be deposited to the contract and contract forges the equivalent amount of tokens according to the amount of ada locked in smart contract.

Yes, Constraints.mustForgeValue and Constraints.mustPayToTheScript are used to define/create a transaction that forges tokens or locks tokens in your script respectively (https://youtu.be/6VbhY162GQA?t=1720).
There are multiple script types that validate different aspects of a transaction.
If you want to spend funds locked in a script(address) you need a validator script (Plutus.V1.Ledger.Scripts.Validator) that will validate any transaction consuming the UTXOs locked in that script. To lock funds in a script you need to transfer funds to that script, thus creating a new UTXO that is owned by the script.
If you want to forge tokens in a transaction you need a minting policy script (Plutus.V1.Ledger.Scripts.MonetaryPolicy) which validates that the forged tokens adhere to the specified policy. Minting policy scripts don't have a Datum and Redeemer available, because the transaction is not consuming a UTXO locked in the minting policy. I don't think sending funds to a minting policy makes sense or is even possible.
In your case you might want to have two scripts:

MonetaryPolicy: validates the minting transaction
Validator: A script that manages funds created from minting

The minting policy then has to make sure that the adequate amount of ada is being transferred to the fund-managing-script when validating the minting transaction.
When creating the minting transaction you can use Constraints.mustPayToOtherScript to send funds to the script.


text:
How will dapps handle cardano inflation from staking rewards?
Let's say I would like to lock up some ADA in a smart contract for about 3 months. How will this compete with ~5% APR from staking rewards? Do all dApps need to provide a minimum ~5% APR just to keep up with inflation?

There are many ways how to handle this and it's really up to the dApp creator.
But, keep in mind, that the smart contact can delegate their ADA too and earn rewards on it as well. I can see some dApps redistributing this rewards back to the users in the future.

Ah I see, I didnt know that smart contract had delegation enabled


text:
Relay Node vs Block-Producer Node
This might be a novice question, but please bear with me :)
I'm working towards becoming an SPO and have a question regarding setting up the two types of nodes:

I have a Raspberry Pi 4 and an AWS, which should I (ideally) configure to be the relay node and which, the BP?

Regards

Welcome to the site! Questions sometimes get closed though for "needing more focus" if there's more than one question in one post. I recommend you ask two separate questions.

You would probably want to use the AWS node as relay. This way you don't have to distribute the IP address of the Raspberry Pi in the Cardano network. (I assume you want to run the Raspberry from your home).
You also need to figure out if you have a static IP where you setup the Raspberry or if you get a dynamic IP from your ISP. If you get a dynamic IP, you need to make sure you either update it in your relay node every time it changes or you need to setup some sort of dynDNS service.

The minimum RAM requirements are 8gb. You may think that the Raspberry may fall short in the short term. If you use it as a Relay you can disable the Tracemenpool to save resources.

You might like to make this a comment once you have enough rep!

Rasberry for Block producers and Cloud for Relays, as the Relays consumes more resources.


text:
Relay Node & Block-Producing Node, which one requires more Hard Disk capacity?
As a follow-up to this questions
Say, I have a SSD of 2TB, which of the two nodes do I have to connect it to? BP or Relay Node?

Both nodes need to download the Cardano blockchain and therefore both nodes need some disk space. Currently the space needed is ~25GB.

The following graph shows the growth of the DB folder during last 100 days

It grew from 7 to 10.5 GB
In addition it depends on your logging settings and retention policy how much additional space is needed.

Also, cardano-node might not clean up forks it has seen in the past, so it might different from a fresh sync.


text:
Is the length (in characters) of a token policy id always the same?
Let's say I have the following native token unit d5e6bf0500378d4f0da4e8dde6becec7621cd8cbf5cbb9b87013d4cc537061636542756433323639 that consists of the policy id d5e6bf0500378d4f0da4e8dde6becec7621cd8cbf5cbb9b87013d4cc and asset name 537061636542756433323639.
The asset name is a HEX representation of the name. Therefore it can vary in length.
But the policy id is some sort of a hash of the policy, so I'd assume the length of the string is always the same. Is this correct?
What I want to achieve is to split the asset name and the policy id e.g. like this:
'd5e6bf0500378d4f0da4e8dde6becec7621cd8cbf5cbb9b87013d4cc537061636542756433323639'.substring(56)
> "537061636542756433323639"

The policyId is the hash of the policy script. It is a blake2b-224 hash resulting in 28 bytes and a hex length of 56 chars. So, your code will always work and is the right way to do it.
Find the spec defining the scriptHash here, note that the scriptHash is of type hash28 denoting the hash length.
Also, the assetName can be of any length between 0-32 bytes. Something to keep a note of in your application, this also means that there can be a token without assetName. Find the assetName length spec here

Yes, the policy ID is indeed defined as a ScriptHash in the specifications. Its length is 28 bytes.

Thanks for the answer. Coud you provide a link to the specification you mentioned?

https://github.com/input-output-hk/cardano-ledger-specs/blob/683bef2e40cbd10339452c9f2009867c855baf1a/shelley-ma/shelley-ma-test/cddl-files/shelley-ma.cddl#L251


text:
Could the CF (15 million) and IOG (3 million) funds be split between more small pools?
There are a lot of small pools out there that find it hard to get the minimum stake to ensure at least one block per epoch.
As you may know, CF and IOG have rounds of funding every three months: CF delegates 15 million ADA and IOG 3 million.
The minimum amount of stake to get one block per epoch is about 1 million ADA.
So my question is, will CF or IOG ever consider delegating just one million to many more pools, thus helping more pools achieve their social goals?

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.

Yes, they could.
I think this question should be directed to these parties.

Yes, that question should not be posted on SE. Voted for closing it.


text:
NFT Royalties before smart contracts
I want to receive royalties every time my NFT is sold. Since there is still no smart contract yet, is it pointless to mint my NFT right now?
Is it possible to add the royalty functionality after minting the NFT? Or must it be during the minting process?

If by NFT you mean a locked native token, it is not possible to add smart contact functionalities to it later, unless you somehow remint a new one under a smart contact and somehow burn the old NFT (which might not be possible as its policy is locked).

Theoretically, you could mint some NFTs now and lock them later in a smart contract that tracks which wallet has the rights to which NFTs.This is a classical account-based model implemented on a smart contract.
To lock the NFTs in a contract you have to be able to access them. So if you distribute them now, you have to convince the receivers to hand them back to you or to lock them in the contract by themselves. Otherwise, they could bypass your fees.
Maybe you can also just declare that all NFTs not locked in the contract after a specific date will lose their value. But it depends on your implementation if that is possible and you will probably lose reputation.

It’s not pointless to mint Native Assets(a.k.a. NFTs) even in the absence of smart contract backed royalties. I think keeping the asset policy unlocked for the future should be able to let you attribute future traits/capabilities to existing Native Assets even without having to have holders to return them for burning/reminting. Like an OTA update. This all theory of course. Hopefully the other brilliant developers will be able to figure out how.

Currently there is a CIP open that proposes how the royalties should be done on Cardano.


text:
How is inflation offsetting staking rewards?
I'm wondering how much staking rewards offset the circulating supply inflation rate right now.
We know that annual staking rewards are around 5.5%, but the only metrics I could find about annual inflation rate are here:
https://datastudio.google.com/u/0/reporting/3136c55b-635e-4f46-8e4b-b8ab54f2d460/page/azvBC
So it's around 2% per year.
Which means that people who don't stake actually lose 2% (if we're ignoring coin price appreciation) per year, while people who do stake gain 5.5% - 2% = 3.5% per year.
Does anyone have more information about this?
Edit: I also found this but I'm not sure if it is valid data: https://pastebin.com/raw/a7x2Gu2g

Each epoch .22 % of the remaining pool are distributed as rewards (therefore .22 % of a slowly declining pool) . So there will be a smooth reduction of inflation. This is unlike Bitcoin where inflation rate only adjusts every four years (when it gets cut in half). Although I have not done the math, I've heard that the .22 % rate was chosen so that the rate of inflation will effectively be the same as Bitcoin (i.e. four years from now it will be  about half what it is today.)

Can I have a source for the .22% value you mentioned?

Mr D - https://forum.cardano.org/t/ada-non-inflationary-policy/49736

Perfect, thanks!

Cardano's staking rewards are a fairly consistent 5.5%
Annual inflation of fiat currencies varies by time and country.  Unless or until the volatility of ADA drops dramatically it will have far more impact on offsetting fiat inflation than staking rewards.
It is a bit like asking how is inflation in Australia offsetting inflation in the USA.

Cardano’s monetary policy addresses two issues:

The necessity to offer rewards for people who participate in the network

Funding the treasury

Rewards
The expansion and future improvement of the Cardano blockchain will be
greatly influenced by its community, who need to be incentivized
through rewards to participate in Cardano’s development.
Staking rewards for delegators and stake pool operators come from two
sources:

Transaction fees - fees from every transaction from all blocks
produced during every epoch go into a virtual ‘pot’. A fixed
percentage (ρ) of the remaining ada reserves is added to that pot.

Monetary expansion - a certain percentage (τ) of the pot is sent to
the treasury, and the rest is used as epoch rewards.

This system is designed to ensure that the portion of rewards taken
from the reserves is high at the beginning, when transaction numbers
are still relatively low. This incentivizes early adopters to move
quickly to benefit from high initial rewards. Over time, and as the
number of transactions increases, additional fees will compensate for
smaller reserves.
This mechanism also ensures that available rewards are predictable and
do not vary dramatically. Instead, rewards change gradually. The fixed
percentage taken from remaining reserves every epoch guarantees a
smooth exponential decline.

Yes, I know, which is why I mentioned that I'm ignoring coin price appreciation. So assuming Cardano is an isolated system and ignoring anything else in the markets, how does its staking rewards offset its inflation rate? Does anyone have more info on how inflation rate will evolve as circulating supply gets closer to total supply of 45B?

Added quote from Cardano's Monetary policy docs.  Click on link to read full document.


text:
As I front-end developer, how should I start learning more about blockchain and should I start with Plutus?
I'm currently a front-end dev - HTML, Javascript, CSS, PhP. I'd like to get into blockchain, but I don't know where to start. Any advice? Should I start by learning Plutus? If so, where should I start? Are there any online tutorials?

Smart contracts on Cardano are actually developed using Haskell which is then compiled into Plutus Core by the Plutus Tx compiler. Plutus Core is a very low-level programming language and programming wouldn't be fun.
The best place to start learning is to participate in the Plutus pioneers program.
More Haskell resources:
If you are not familiar with Haskell, grab a book such as Learn You a Haskell for Great Good!, as it will be very helpful.
If you want to focus on the Haskell features required for programming smart contracts, have a look at the Mongolia class recordings: Haskell and Crypto Mongolia 2020
Also see this YouTube playlist: Haskell for Imperative Programmers

Have a look at the Plutus Pioneer Program:
https://youtube.com/playlist?list=PLnPTB0CuBOBypVDf1oGcsvnJGJg8h-LII

As a dev myself, I'd suggest you wait another year or two for the libraries and tools to stabilize and become more straightforward. Right now it can be a headache just to get a local dev environment running.
That being said, you can start using the Plutus and Marlowe Playgrounds to start hands-on learning about smart contract code.
https://playground.plutus.iohkdev.io/
https://alpha.marlowe.iohkdev.io/

To add onto what has already been provided, if you want to try and learn more of the theory of Haskell and Haskell like languages (Category Theory and Type Theory), I'd recommend the fantastic courses by Bartosz Milewski:

Category Theory for Programmers Textbook
Category Theory for Programmers Part 1 Video Lectures
Category Theory for Programmers Part 2 Video Lectures
Category Theory for Programmers Part 3 Video Lectures

This series is a bit dry but it is extraordinarily helpful in understanding how to structure your code so that you can let the language do 90% of the work for you.

A good start to learn Plutus is at https://playground.plutus.iohkdev.io/tutorial/index.html

The general idea from a frontend perspective is that you write the onchain and the offchain part of the contract in Plutus. You can then compile what they call the PAP ( Plutus Application Backend ) which will provide api endpoints to interact with your contract from the frontend.

I recommend the fantastic book Haskell Programming from first principles by Christopher Allen and Julie Moronuki. In my opinion this is a great resource to start for someone completely new to pure functional programming.
After learning the basics of Haskell, I recommend participating in the Plutus Pioneer Program. The lectures are openly available on YouTube. There will also be a second iteration of the course later this year.

I'm also a Javascript developer. I would recommend the path that I made. I started with PureScript through PureScript book (other alternative is FP Made Easier), which is a language that compiles to JavaScript and is very beginner friendly. That way you can pratice Haskell-like code right now. When you feel confident in PureScript you can move to Haskell and begin the Plutus Pioneer Program, the differences between Haskell and PureScript are minimal.

As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.


text:
What companies and institutions accept ADA as payment?
It would be good to have a central database of all known merchants that accept ADA for transactions.
I've seen a few small businesses posted on r/Cardano that I went 'good for them', and made me wonder of a place where you could check for people and businesses accepting ADA as a method of payment.
Note: IIRC, Shopify allows for ADA payments, not natively, but through an app in Shopify's marketplace.

This shouldn't be posted as a question here, Stack Exchange is not a place to make proposals, but a place to resolve doubts, and what you want is not an answer.

I’m voting to close this question because the answers will be changing every few days

I do not know of such a list, but it would be very cool if someone started such a list within a repository, similar to essential Cardano.

That's a good one, didn't know about it, thanks.


text:
adaPerUTxOWord not found on testnet-shelley-genesis.json
Run cardano-node 1.27.0 testnet error, adaPerUTxOWord not found on testnet-shelley-genesis.json
cardano-node  run --database-path ~/cnode-testnet/db --socket-path ~/cnode-testnet/sockets/node.socket --port 3001 --config ~/cnode-testnet/config/testnet-config.json  --topology ~/cnode-testnet/config/testnet-topology.json

    Error decoding genesis at: /home/qi.mou/cnode-testnet/config/testnet-shelley-genesis.json Error: Error in $: key "adaPerUTxOWord" not found

    cardano-node --version
    cardano-node 1.27.0 - linux-x86_64 - ghc-8.10
    git rev 17096c3fe7a52264906ff92ed245ded2344b3d00

after I add "adaPerUTxOWord":0 to testnet-shelley-genesis.json, it still doesn't work.

Can you paste the output of cardano-node --version?

cardano-node 1.27.0 - linux-x86_64 - ghc-8.10
git rev 17096c3fe7a52264906ff92ed245ded2344b3d00

It looks like you may be building the master branch, try checking out tag 1.27.0, cabal clean and then rebuild. The correct git rev for 1.27.0 is 8fe46140a52810b6ca456be01d652ca08fe730bf

It appears that the config files over at https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/index.html is a bit behind some of the pre-alonzo work in 1.27.0.
Per discussions over at https://github.com/input-output-hk/cardano-node/issues/2725, the *-shelley-genesis.json should now have these additional values:
{
  ...
  "securityParam": 2160,
  "adaPerUTxOWord": 0,
  "executionPrices": {
    "prMem": 1,
    "prSteps": 1
  },
  "maxTxExUnits": {
    "exUnitsMem": 1,
    "exUnitsSteps": 1
  },
  "maxBlockExUnits": {
    "exUnitsMem": 1,
    "exUnitsSteps": 1
  },
  "maxValueSize": 1000,
  "costModel": "example/shelley/alonzo/costmodel.json",
  "collateralPercentage": 100,
  "maxCollateralInputs": 1
}

Make sure you download official genesis file from the build system of cardano-node.

Looking at the official configurations, "adaPerUTxOWord" exists on the mainnet version of shelleyGenesis, but not on the testnet, as the question points out.

I download genesis file from official website, but adaPerUTxOWord not exists on the testnet file.


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:
How and when we will be able to use Catalyst for our own projects to vote?
I know that voting project Catalyst is still under development and it will be most probably in this state till end of 2025 but can we expect to vote on our own projects inside Cardano ecosystem and also outside Cardano (using only the infrastructure)?
If this is possible how this will gona happen and when?

You can already vote using the Catalyst mobile app if you have ADA in a wallet you control.
That said, it's still in a kind of beta phase that depends on the Ideascale platform.
In the end, there will probably be a voting section inside the Daedalus and Yoroi wallets and we will no longer need Ideascale for the voting process.
It is unknown yet how long it will take to build this and finish Voltaire era.


text:
Node.js - Plutus/Haskell Wrapper
Do you think a Node.js/JavaScript Wrapper for the Plutus programming language (I think it was Haskell?) is possible? This would bring millions of developers onto the Cardano ecosystem and their smart contracts.
I'm not that deep in the blockchain world, so I'm just wondering if this is technically possible.

Technically it should be possible once the IELE virtual machine is finished. Currently it is still under R&D.
Once complete, we should be able to run code from any platform/framework inside the virtual machine if the appropriate conversion tools are also built.

If my understanding is right, this works only for sidechains. Please correct me if I'm wrong.

I'm not sure. Maybe someone else can confirm.

Theoretically, you could develop a new compiler that compiles from a different language into Plutus Core (see Plutus Tx: compiling Haskell into Plutus Core).
Additionally, you would need a different (not Haskell-based) client that could create transactions and publish them to the blockchain. But also a simple wrapper that is still based on Haskell but would wrap foreign Plutus Core code could also work.

Project catalyst has a few guys building a Ouroborus Networking package for JavaScript.. it’s coming.
https://twitter.com/cardanomint/status/1397223641222369285?s=21

The choice of Haskell based Plutus was deliberate to create a "Formally verifiable Secure" smart contract.
A smart contract becomes useless once bugs are discovered in some layer every year. To be recognised as a dependable platform with a larger scope and mainstream adaptation Formal methods supported by math were a critical requirement.
Therefore, there is a school of thought that developers who can learn and write "Secure Contract" will be more valuable and dependable. However, for fun applications where security is not a major constraint wrapper are also being developed. As it can be appreciated I guess Plutus is being prioritised to bring in "Secure" Contract.


text:
eUTXO transaction model Vs Account Based Transaction Model
What are the benefits of Cardano's eUTXO transaction model compared to Ethereum's account-based transaction model? Are there any significant differences?

There is a nice blog post bu IOG: Cardano’s Extended UTXO accounting model – built to support multi-assets and smart contracts that discusses the difference between two models.
For a more in depth comparison, I recommend the UTxO- vs account-based smart contract blockchain programming paradigms paper.
To sum UTXO up:

A UTXO is the output of a previous transaction, which can be spent in
the future
UTXO chains have no accounts. Instead, coins are stored as
a list of UTXOs, and transactions are created by consuming existing
UTXOs and producing new ones in their place
Balance is the sum of
UTXOs controlled by a given address
UTXOs resemble cash in that they
use ‘change’, and are indivisible (UTXOs are used whole)

To sum up the Account/Balance model:

This accounting model resembles how a bank operates
Users have accounts that hold their coin balance
It is possible to spent partial balances
The concept of change does not apply

Link only answers are often subject to rot into dead links with time. Maybe you could edit to briefly list the most important points according to you.

I hope a scientific paper will not rot in time :) but I moved the points to the answer.

It already happened with scientific parpers: publisher reorganizing the structure of publishing site. Then link to papers were falling in the void of a 404 error.

Oh, I hope arXiv never disappears, but you are right - I uploaded the paper to IPFS :) and moved the main points to the post.

Something I'd note about the EUTxO model is that state machines for smart contracts and state channels can be embedded in the UTxO themselves. This significantly changes the way a smart contract model would operate on the network. From my understanding, while with balance based smart contracts you can have two smart contracts interact with each other, that isn't possible with EUTxO smart contracts. Instead with EUTxO you would compose the smart contracts together and they'd operate as one unified contract for 1 Tx instead.

The EUTXO model also makes it much easier to scale. Charles talks about that in this great video -- the take-away here is that Cardano will be much easier to scale than Ethereum.

I am sure there is a lot of documentation around it. But just to scratch the surface:

Both are not same at all.
ETH fees is charged even for failed transactions. But in eUTXO, your fees is collected only if your transaction succeeds. This alone is huge.
Smart contracts developed in eUTXO model are much more dependable, reliable than the account model.
I am sure you already know that ETH only went with account model because they could not think of a way to make smart contracts work with the Bitcoin's UTXO model.

But it is a really interesting comparing both Account and UTXO. Links are there above in some other comments.

this is indeed a great answer! tks!


text:
What prevents a bad user to provide a wrong signature to a transaction?
What prevents a bad user to provide a wrong PubKeyHash and sign it with a different signature in the Signed.hs example from the Plutus Pioneer Program NFT lecture?
Policy:
Policy:mkPolicy :: PubKeyHash -> ScriptContext -> Bool
mkPolicy pkh ctx = txSignedBy (scriptContextTxInfo ctx) pkh

Wallet-Code:
pkh <- pubKeyHash <$> Contract.ownPubKey
...
lookups = Constraints.monetaryPolicy $ policy pkh

Couldn't he just use a different pkh and change the transaction signature to mint the token?
What prevents that?
Update:
My question seems to lead people in the wrong directions, so to clarify:
I'm wondering how a transaction is actually signed and why that can't be manipulated.

I think your question will be clearer if you don't require readers to watch a video that is > 1 hour to get the necessary context. You could include the necessary context in your question and make references to the video unnecessary.

The video is actually not that important. It just provides a good example for signature checking. As already multiple times stated: I'm just wondering why signatures can't be manipulated and how that is working. But thanks for your feedback. :)

I don't know the specifics, but I believe under the hood the corresponding private key is used to sign the transaction and the public key is used for verification. So you cannot use any other public key, since you do not know the corresponding private key.

I'm no cryptographic expert. That answer goes in the right direction. Would be great if someone could extend it.
I suspect that a private key is sent around because then it could be stolen, right?

The 'txSignedBy (scriptContextTxInfo ctx) pkh' takes the given PubKeyHash and checks the  txInfoSignatories.
If the provided PubKeyHash is in the signatory, it will validate. The only way for that specific PubKeyHash to be in the signatory is if it is the original creator of the validation script. So only the original creator can validate this contract.
Check this github out, it is super helpful.
https://github.com/input-output-hk/plutus/blob/d958880388c285e369abaeabea28952a78703441/plutus-ledger-api/src/Plutus/V1/Ledger/Contexts.hs

I know all that already. What prevents somebody to provide a wrong transaction signature?

The policy can indeed be used by anyone to mint their tokens. However the actual minting policy script is dependent on the PubKeyHash, i.e. mkPolicy isn't the minting policy but mkPolicy pkh is. So for each PubKeyHash you get a different minting policy script and therefore a different CurrencySymbol. So with your PubKeyHash you will only be able to mint tokens for your CurrencySymbol because the minting policy will only validate those transactions.
As for the txInfoSignatories in TxInfo in ScriptContext, this is what the docs say about it:

Signatures provided with the transaction, attested that they all signed the tx

I'm assuming that checking the transaction signatures won't be done by the Plutus code itself once it's been integrated into the Cardano node. That is because validating transaction signatures is a very basic check that every blockchain node has to do anyways.

The first part is clear to me. It is well explained in the lecture.
I'm relatively sure that the signature will be checked within the Plutus Core code on-chain since it is compiled to that.

I'm wondering how a transaction is actually signed and why that can't be manipulated.

Transactions are signed using the signers private key. It is then legitimized by taking the signed transaction and the public key of the signer, and doing some cryptographic magic to determine if signer of the transaction also had access to the private key behind the public key. Watch this video https://www.youtube.com/watch?v=xIDL_akeras

If you want to know how it's done in Plutus right now check out validateTransaction (https://github.com/input-output-hk/plutus/blob/master/plutus-ledger/src/Ledger/Index.hs#L168) and follow checkValidInputs -> checkMatch -> signedBy (https://github.com/input-output-hk/plutus/blob/master/plutus-ledger-api/src/Plutus/V1/Ledger/Crypto.hs#L127).
Keep in mind that once Alonzo goes live Plutus will be integrated to the Cardano node (github.com/input-output-hk/cardano-node) which provides the actual executable. So far when working with Plutus we are just using a blockchain Emulator.


text:
Referencing onchain contract as 3rd party
In solidity and EVM, it is possible to reference external contracts by providing the address and interface to the contract:
  address ckAddress =  0x06012c8cf97BEaD5deAe237070F9587f8E7A266d;
  KittyInterface kittyContract = KittyInterface(ckAddress);

In Plutus, however, the onchain code are referenced with
    ledgerTx <- submitTxConstraints inst tx

where inst is the ScriptInstance of the validator code. Is there some example that shows how to reference a 3rd party smart contract with exposed API? Or is the original source code always necessary to reference the correct instance?

Please clarify "Or is the original source code always necessary to reference the correct instance?".

In short:
In my understanding, the actual smart contracts are always shipped with the transaction, so you need all code that you want to execute. Merely the script hash ensures that actually the right script code is shipped with the transaction. And this hash will also be the location (the public key address) of potential funds or information.
In long:
A good example is given in the oracle lecture of the Plutus Pioneer Program:
from Swap.hs:
swapInst :: Oracle -> Scripts.ScriptInstance Swapping
swapInst oracle = Scripts.validator @Swapping
    ($$(PlutusTx.compile [|| mkSwapValidator ||])
        `PlutusTx.applyCode` PlutusTx.liftCode oracle
        `PlutusTx.applyCode` PlutusTx.liftCode (oracleAddress oracle))
    $$(PlutusTx.compile [|| wrap ||])
  where
    wrap = Scripts.wrapValidator @PubKeyHash @()

Here the oracle contract is passed to swap contract as a parameter. If somebody wants to use it, he has to provide an instance:
    h3 <- activateContractWallet (Wallet 3) $ swap oracle

And as far as I understand the code, this is only possible if you have access to the source code. But please correct me if I'm wrong.
The oracle API is used in the sense that there are multiple possibilities for valid redeemers, which define the endpoints: data OracleRedeemer = Update | Use
Later somebody can

search for the oracle (this is in a sense library code coming from the oracle provider):

findOracle :: forall w s. HasBlockchainActions s => Oracle -> Contract w s Text (Maybe (TxOutRef, TxOutTx, Integer))
findOracle oracle = do
    utxos <- Map.filter f <$> utxoAt (oracleAddress oracle)
    return $ case Map.toList utxos of
        [(oref, o)] -> do
            x <- oracleValue (txOutTxOut o) $ \dh -> Map.lookup dh $ txData $ txOutTxTx o
            return (oref, o, x)
        _           -> Nothing
  where
    f :: TxOutTx -> Bool
    f o = assetClassValueOf (txOutValue $ txOutTxOut o) (oracleAsset oracle) == 1

use it by providing the right redeemer for the wanted endpoint (in this case "Use", see "Redeemer"):

useSwap :: forall w s. HasBlockchainActions s => Oracle -> Contract w s Text ()
useSwap oracle = do
    funds <- ownFunds
    let amt = assetClassValueOf funds $ oAsset oracle
    logInfo @String $ "available assets: " ++ show amt

    m <- findOracle oracle
    case m of
        Nothing           -> logInfo @String "oracle not found"
        Just (oref, o, x) -> do
            logInfo @String $ "found oracle, exchange rate " ++ show x
            pkh   <- pubKeyHash <$> Contract.ownPubKey
            swaps <- findSwaps oracle (/= pkh)
            case find (f amt x) swaps of
                Nothing                -> logInfo @String "no suitable swap found"
                Just (oref', o', pkh') -> do
                    let v       = txOutValue (txOutTxOut o) <> lovelaceValueOf (oFee oracle)
                        p       = assetClassValue (oAsset oracle) $ price (lovelaces $ txOutValue $ txOutTxOut o') x
                        lookups = Constraints.otherScript (swapValidator oracle)                     <>
                                  Constraints.otherScript (oracleValidator oracle)                   <>
                                  Constraints.unspentOutputs (Map.fromList [(oref, o), (oref', o')])
                        tx      = Constraints.mustSpendScriptOutput oref  (Redeemer $ PlutusTx.toData Use) <>
                                  Constraints.mustSpendScriptOutput oref' (Redeemer $ PlutusTx.toData ())  <>
                                  Constraints.mustPayToOtherScript
                                    (validatorHash $ oracleValidator oracle)
                                    (Datum $ PlutusTx.toData x)
                                    v                                                                      <>
                                  Constraints.mustPayToPubKey pkh' p
                    ledgerTx <- submitTxConstraintsWith @Swapping lookups tx
                    awaitTxConfirmed $ txId ledgerTx
                    logInfo @String $ "made swap with price " ++ show (Value.flattenValue p)
  where
    getPrice :: Integer -> TxOutTx -> Integer
    getPrice x o = price (lovelaces $ txOutValue $ txOutTxOut o) x

    f :: Integer -> Integer -> (TxOutRef, TxOutTx, PubKeyHash) -> Bool
    f amt x (_, o, _) = getPrice x o <= amt

So I suspect that you always need the third-party code. But that would actually be a good thing since you want to make sure anyway that the third party can't fool you.
Additionally, I don't see a way how it could be possible to execute another contract without the code since it isn't stored on the blockchain itself. The blockchain just stores the hash of the code (the public key address) and all funds (eUTxOs) located at that address.

Johannes is correct. One will need the source code of the contracts in order to interface with it.
Source: https://github.com/Emurgo/Emurgo-Research/blob/master/smart-contracts/Unlocking%20The%20Potential%20Of%20The%20UTXO%20Model.md


text:
What improvements will Basho bring?
I assume it will be a precursor to Hydra, but I haven't heard it talked about very much.

You can learn more about the Basho phase at the Cardano Roadmap, but I will briefly summarize what it says.
The Basho phase is focused on improvements to scalability and interoperability, this will improve the performance of the Cardano network as it grows and transaction volumes increase. One important core development this phase will bring is the implementation of sidechains, which are new blockchains that are interoperable with the main chain. Basho will also allow for parallel accounting styles, meaning that while the main chain uses the UTXO model, a sidechain could use account-based models giving the ability to support and switch between the two models.
I hope my brief summary helps, but you should definitely look at the road map for more information.

Scalability! In simple terms, it brings "continuously improving" scalability! That means by design we will be more and more scalable as we grow. The exact opposite of Bitcoin. Currently Cardano has around 1000 TPS. What Hydra brings to table is making each SPO a node of Hydra. That means each SPO would be capable of 1000 TPS. That means the more Stake pools, the more throughput for Cardano after Hydra. With an example of say 1000 stake pools (very conservative since we already have 2000 plus), Cardano's throughput would be 1 Million TPS (1000 * 1000).


text:
How can I make an item traceable on the Cardano blockchain?
We would like to be able to identify an item on the blockchain for traceability and assign specific transactions against it to maintain a chain of custody.
Can anyone lead me in the direction I need to research this type of application?
Many thanks

Can you please elaborate a bit more on what are you trying to achieve? Maybe provide an example.

We want to trace a number of phone devices based on the IMEI or some other fixed identifier on the device and then assign metadata to these devices like if any internal components were added during repair for example. We would also like to assign ownership to them so they can “belong” to an entity. Just wondering how something like this can be achieved

You could make an NFT for each phone. You can attach metadata about the phone when you mint the NFTs. Whoever has the wallet that owns the NFT owns the phone. How you enforce the state of the ownership expressed on the blockchain in the real world is another story. If you need to modify the metadata, you could mint a new token with new metadata and burn the old token.

Hi Joshua, thanks for your comment. I’m fairly new to this and I’m looking for do a proof of concept on this soon and this is an interesting way to do it. Ownership of the token is the area I’m interested in and how that is generally done.
I need to dig into the development on this so any pointers to docs etc would be interesting at this point.
Thank you for your input.

Note that on a blockchain everything is traceable by default, excepted when counter-measures are taken.

When I hear the word "traceability" with respect to Plutus, a StateMachine comes to mind.
With a StateMachine, one address is maintained all through the lifetime of one instance of the state machine.
Each State can contain an arbitrary amount/type of elements as state data; and you can make use of the transition function to perform operations in each state

Thanks. I hope to lean more about this soon

I think what you're driving at is a native app that can be installed on the device. Internally it would create its own, private "wallet" (which really is nothing more than a private key). The app itself would present a UI where you can record maintenance tickets. "Saving" a ticket would be a Cardano blockchain transaction, with metadata, and signed with the private key.
There could also be a management app that holds the private-key-device pairs and additionally could work with device maintenance history.
One of the more difficult problems is securely managing the keys. If you loose a key then it's the end of the road for its transaction thread. If you leak a key then misdeeds could ensue.

Yea, that's exactly what I think I need to do but not hold the details on the device itself. And yes, the holding of the wallet and the private keys would be the issue here.
Is there a way to look at this by using a digital identity of some sort that would be tied to the transactions on the blockchain as repairs etc are done. But would that be a single wallet or do I need a separate wallet for each device?
I've signed up for the Emurgo developer course in August so hopefully I'll be able to convey my thoughts more clearly then.

Basically, I need a controlling actor to have the devices all tied together via transactions and for those transactions to be details about changes to the device. Would need to give control to other actors to query these devices on demand but without giving access to all the devices.

Anyone can query the blockchain at any time; it's public record. You don't need anything particularly special to simply following the chain of transactions. Perhaps what you're also getting at is you want to encrypt the attached metadata; the onus of which is upon your implementation.


text:
What role will WMT have within the ecosystem short term, but more so in the coming 5-10 years?
I would love a clearer picture of the integration of the world mobile token.
As well as short/long term plans, or specific goals that you guys might have?
Are there rivals/competitors in this niche? Including within the ADA ecosystem? I haven't seen one, if there are any, I'd love to see how they compare to each other. Please explain simply

This is not really the right place for the type of question you are asking.  Perhaps you and your friend can change it to fit in with the guidelines for asking

It may be better to ask the same question in one of the Cardano forums


text:
How can I withdraw ADA from delegation to a pool?
I am shown the following screen when I go to withdraw my ADA from a delegation.

It reads as if I deregister I will stop receiving rewards. Does that apply to the last few epochs where rewards have been earned, but not received as well?

Yes, it does. At the moment you deregister your stake key, you will get your deposit back and at that moment, you are no longer able to receive rewards. All your rewards will go to the treasury.

Delegating, undelegating, deregistering
When you delegate for the first time, only 2 Ada is "locked up." The rest of your Ada can be spent at any time you choose. So if you're simply wanting to "cash out," you do not have to deregister to access your money.
If you decide your time in the Cardano community is complete and you truly want to divorce yourself of alllll your Ada under the sun, then you may deregister, and get that 2 Ada back as well.
With rewards payments lagging by two epochs, your best path is to

withdraw all your ada
wait for the passing of two epochs so outstanding rewards can come in,
finally deregister and get your 2 Ada back along with some trailing rewards

If I had asked the question myself, this would be my accepted answer.

No, you will not receive rewards if your stake is deregistered.

This is not true! When you deregister your stake, it will no longer receive rewards. Please modify your response, as people will lose their rewards because of it.

Thank you for the clarification.


text:
General approach for allowing multiple smart contract transactions per block
In some applications, multiple users interact with the same smart contract and may want to do it at about the same time. Such interaction involves updating the state of the smart contract as embodied in the UTXOs of the smart contract address. One example application is a DEX.
Because all the users interact with the same smart contract, potentially spending existing UTXOs and creating new ones, potentially only one user can succeed in each block and the other users have their transactions rejected due to double-spending the UTXOs, limiting the throughput of the application.
Is there a general approach for dealing with this kind of situation to allow more transactions for a smart contract to succeed in each block?

Not as far as I know. The current model is limited to one state change (transaction) per block per smart contact.
However, depending on the specific smart contact and its use case, I can see people using a centralized entity (or a group of users) post transition proposals and then have an incentive to bundle all of those up into one that actually modifies the global state. Not ideal, but this is the price to pay to have a state-full smart contact design.

According to Lars Brünjes concurrent state machines are being researched https://twitter.com/LarsBrunjes/status/1390331642103877633?s=19

This has been bugging me for a while now. I'm not as worried about it as I was before though. Here are some thoughts:
Lars says there are ways around the problem:

Of course there are ways around. You need to parallelize. In an auction contract, for example, you can have several UTxO's instead of just one.

This seems fine to me. Of course there is still a chance of collision. A collision isn't the end of the world, but you could make as many UTxOs as you want to minimize the worry. You can also do things off-chain to pseudo-randomly choose a UTxO (with the modulo of your hashed redeemer, for example).
Back of napkin estimates
If you look at something like Uniswap, which has on the order of ~100K transactions/day and ~50 Liquidity pools. Cardano has 4320 blocks/day, so that would be an average of around .5 tx/block/lp (obviously some pools are much more popular). But having somewhere between 10-100 UTxO/pool should be plenty.
How does it work?
EDIT: This actually still has problems. I can't think of how you would determine the rates without including all the UTxOs in a txn--which defeats the purpose. Hmm, still need to think things through.
For a Uniswap, the way it could work is the sum of all the datums on liquidity pool NFT UTxOs in a pool equal the total liquidity for that pool. Anyone adding or removing from the pool can modify any number of the UTxOs, but for the sake of fees they would tend to modify the minimum number necessary to add/remove from the pool. For pools with a lot of collisions, there might even be a way to incentivize participants to open new pools or even add more UTxOs to existing pools perhaps? The factory token would just need to keep track of how many liquidity NFTs are floating around for each pool.

Theoretically, you can just create multiple eUTxOs to reduce collisions. But that isn't an ideal solution. For example, an oracle would have to maintain a lot of different eUTxOs and create new ones to update the oracle value. This would cause a lot of transaction fees for the oracle provider, linearly increasing by count.
Additionally, I'm wondering How can an oracle guarantee certain update rates respectively uptime?

Please see my article "Scaling with UTXOs." I outline several different approaches. These include buffering, state sharding / replication, and using transactions which do not consume UTXOs.
https://journal.platonic.systems/p/scaling-with-utxos

One possible solution for this is that instead of letting the users of your dapp compete for a single UTxO you let them publish a "request for transaction" and then let an open bot network compete to aggregate and execute these transactions into a single block. If your dapp relies on a single state stored in a single UTxO then only one bot will be able to consume that UTxO but you can design your smart contracts in a way that will allow the winning bot to execute multiple "request for transaction" together with consuming the state UTxO. If these "request for transaction" contain a bounty then bots will be incentivized to execute as many "request for transaction" as possible and it doesn't matter which bot wins since all bots will try to execute all transactions.
Variations of this solution are described in the following blog posts:
https://medium.com/meld-labs/concurrent-deterministic-batching-on-the-utxo-ledger-99040f809706
https://medium.com/minswap/introducing-laminar-an-eutxo-scaling-protocol-for-accounting-style-smart-contract-d1ac8847dde8


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

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

I'd like to complement @JohannesSirsch answer.
One of the most important aspects of any network, when working with smart contracts, is the ability of the script to see the "event horizon":

In Bitcoin, all the script sees is the Redeemer that contains all the logic necessary to verify Tx.
In Ethereum, the script sees the whole blockchain, and that's not good regarding security.
In Cardano, the script sees all the Tx-ins and Tx-outs, including Redeemer.

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


text:
Can the value of the NFTs be added to the stake size of the pool?
Many small stake pools struggle with increasing their stake. The stake could be increased by adding the value of all the NFTS held in wallets by both delegators and operators. How do we determine value? Once we have smart contracts, value will be the last sold price of the NFT, recorded in the Blockchain.

If the value of NFTs (their purchase price or last traded value) were to be added to staking then both the ADA used to purchase them and the NFT would counted.  This would make it possible to double your staking rewards by selling an NFT to yourself or a collaborator.
It would also affect the Cardano monetary policy.
Stake pool operation is a serious undertaking and gathering enough stake to establish a viable pool is part of that challenge.

There is also the appreciation of value of existing NFTs based on new traded prices... basically impossible to know what "total staked value" would be at any given time when counting NFTs. Many opportunities for adversarial behavior. "Affect the monetary policy" is an understatement, it would need a complete rewrite!

I completely agree with the remarks. Just an idea: is there a possibility the NFT to be 'locked' somehow (under another smart contract) within the stake pool and it's last sold value (written in the smart contract) to be added to the stake? By 'locked' I mean not to be traded in any way, or if traded its recorded value to be deducted from the stake.

Only ADA coins are participating in staking and securing the network. NFTs will not be part of stake for stake pools.


text:
Using cardano-cli with a Daedalus wallet
I want to be able to use a wallet that I have on Daedalus, but to mint some tokens. The README on cardano-cli is outdated, and obviously not working and couldn't find an up-to-date instructions to import mnemonic seed using cardano-cli.
From https://github.com/input-output-hk/cardano-cli/blob/master/USAGE.md:

Recovering a Daedalus wallet
For various reasons the CLI does not allow to create Daedalus
compatible wallet. But it is possible to recover a wallet created on
the Daedalus application.
cardano-cli wallet recover --daedalus-seed --derivation-scheme=v1
--mnemonics-length=12 --wallet-scheme=random_index_2levels MyDaedalusWallet
And that's it, you will your daedalus wallet recovered here. No need to transfer the funds to another address yet (and therefor save some transaction fees).

cardano-wallet doesn't seem to have any of those options, or at least, a resemblance of those steps

What is your motivation for using Daedalus keys, rather than creating a new keys/address with cardano-cli for minting?

ease-of-use when sending the tokens :)

Good point, but you could send the newly minted tokens to your Daedalus addresses from the cli. Working with Daedalus keys on command line does not sound like fun, or at worst a security risk

You can use the cardano-address cli tool

exactly what I was looking for. too bad the official docs is like a maze of outdated links


text:
do you need to know Haskell to code in marlowe
I'm interested to play with Marlowe in a textual way.
when I read this tutorial or read some code examples here, it seems to me that I have to be knowledgeable about Haskell's basics, mainly variables and functions, to be able to write Marlowe code.
is my assumption right?
ps: I'm not interested by blocky or js

Yes, you would need to know some Haskell basics to edit your Marlowe contracts if you don't want to use Blockly or JS.

If you don't want to use blocky or js (Marlowe is built assuming you will), then your best bet is to try to learn Plutus and write your contracts using that. The plutus Pioneer Program is a great place to get guided help learning how to write smart contracts using Plutus. Plutus makes Haskell a tad bit more accessible. And you can learn Haskell with Cardano and smart contracts in mind.
If you reallllly don't want anything to do with Haskell, then just hang tight, IELE will let you use your very own favorite programming language (Java, C#, Rust, javascript, any really many more) to write smart contracts.

Great answer in that it looks past the specific wording of the question and identifies the reason behind it.


text:
is it possible to build a cardano multicurrency dApp wallet?
Will there be a cardano dapp built for multicurrency wallet, like Exodus and Guarda, that's desktop based, but built on cardano?

From my understanding Exodus and Guarda are not dapps, which makes your question tricky to answer. I'm going to try and answer some questions that may be related to what you are asking and hope it helps.
First, Cardano is available on many of these multicurrency wallets so if your question related to have ADA or and Cardano tokens added to these wallets then it already is in place. ADA is supported on Exodus for example and I assume they will integrate support for other Cardano-based tokens once they are released.
Next, if your question relates to the dapp support that Exodus has, in particular compound, then I think this is certainly possible down the line. I can certainly see Exodus integrating support for a Cardano-based DeFi dapp given it has enough community support and usage.

Thanks! I was thinking more of a blockchain multicurrency wallet. Is that possible?

Do you mean a wallet that can hold multiple tokens besides ADA?
If so, both Yoroi and Daedalus already support that.

Yes, like can I send bitcoin, litecoin, ethereum, polygon, tezos on daedalus or yoroi wallets?

No, for that you need a wallet like Exodus.


text:
Why is there a 45 Billion coin cap for ADA?
Why is there a coin cap of 45B and not for example 45M or 21M or 45.8B? What's the reasoning behind that?

Hey, welcome to the Cardano StackExchange community! I submitted an edit for your title, mostly just to remove the very serious question part. You never need to put that into a StackExchange question title since all questions on StackExchange are expected to be serious questions.

This was an arbitrary decision and can only result in opinion-based responses. Please see this page for details: https://cardano.stackexchange.com/help/dont-ask

It is a fact rather than an opinion that it was a relatively arbitrary decision.  I doubt it was so arbitrary that the cap could have been set at 100.  Maybe my answer is acceptable.

Thanks for the edit; I cannot accept an arbitrary decision as an answer. Doesn't make sense to me have in the source code "magic numbers" :)

It is something that is starting to concern me. They should consider a dam. It stays at 34 billion for 10 years, Then increases a billion each year until 45. This would allow investors to not have to fight the tide of inflation for many years. Just a thought.

One reason for billions of ADA rather than millions may have been to encourage adoption. Psychologically, people are more likely to buy something when it is perceived as "cheap", and with a large supply of coins, the value of 1 ADA is likely to stay lower, longer (in fiat exchange rates). It also allows people to own whole numbers of tokens, and larger amounts, both psychologically rewarding.
This is my own speculation, @gRebel shared the only official source I have seen.

Yup it's why you see these crappy tokens on the BSC set their supply to 1,000,000,000,000 then proceed to burn half.

Might be a good argument! Thanks for the answer :)

It could be an explanation. Especially the beginners are more interested to buy cheap coins.

Charles Hoskinson stated that it is a fairly arbitrary number in one of his AMAs.
He jokingly explained,

It's because 44 999 999 999 was not enough, and 45 000 000 001 was too much.

With 1 Million Lovelaces per ADA, there is plenty to go around for the foreseeable future.

Hmm!! that's not acceptable for a guy that says the source code is truth. I simply don't believe him! xD Just in this part :)

A link to the AMA having this will be appreciated

Cardano is not aiming to simply be a store of value. Utility is key for the project. The goal isn't necessarily to drive the price up into the thousands of dollars.
Also, give the scale of the goals of the project, only having a few million coins wouldn't be condusive to driving adoption.

That is also a proper comment, makes sense too!
Low coin value make see ADA as utility not store of value.

A simple and rational explanation for this lies in the plane of demography. Now the planet Earth is a home for about 8 billion people. Based on this figure, in the future, everyone could potentially have 5-6 whole ADAs, not fractions of it, like many Bitcoin holders have. Psychologically, this is much more pleasant for the holder.

It could have been inspired by Bitcoin. A possible reason for 21 million Bitcoin is that Satoshi used a signed 32-bit integer as a reference for the supply. The possible number of values in a signed 32-bit integer (2^32) is between -2,147,483,647 and 2,147,483,647.  Divide the latter by 100 (for US cents in a dollar) and it's around 21 million.
With Charles having been in Bitcoin since the early days, it's possible he was familiar with this line of thought and therefore decided to use a similar approach. Except he used an unsigned int which has a value of between 0 and 4,294,967,295. Multiply that by 10 (which could be arbitrary) and you get around 42 billion.
Although this is purely speculative, it possible.
Some references to similar discussions in early days Bitcion.

https://bitcointalk.org/index.php?topic=819656.0%3Ball


text:
How can token metadata be stored onchain?
I was wondering how to link additional (meta)data to a token. Consider a trading card game which allows a user to purchase a booster pack containing cards via smart contract. Those cards should have a TokenName and are linked to the smart contract. But how would I link additional data like datetime of mint, card stats, edition, rarity, .. ?

Do these answers help you? Is there a metadata standard for native assets (talking about fungible tokens first) in Cardano? and Providing metadata to cardano-cli transaction build-raw

Thank you, that clears things up quite a bit :)

The metadata of a native token must be included in the minting transaction.
The token itself only has a Policy Id, an Asset Name and a Fingerprint.
Here's an example of a token, there you can see under the tab "mint transactions" the Tx and the metadata of the NFT: https://cardanoscan.io/token/59fdb627c01bd87326bef5f4df179bcccb2a2f43


text:
How are the key parameters that control Cardano governed?
I am looking to understand the 7 special keys that control all the parameters for cardano. How it's controlled, who gets to control it, and what each parameter means.

Right now it's IOG. Eventually we will be able to vote on changes.

The parameters are controlled by IOG currently. There are a number of keys that govern update proposals. Update proposals are special certificates posted to the chain that can change the parameters. Each update proposal is required to have 5 signatures in order to become active. These signatures have to be in place 1.5 days before the end of the epoch in order for them to become active at the next epoch.
If you do a ledger state dump using cardano-cli, you can view the parameter change proposals and how many signatures they have.
CIP that talks about the process https://github.com/cardano-foundation/CIPs/blob/master/CIP-0009/CIP-0009.md

Do the CIP-9 Updatable Parameters require 5/7 signing keys too? I heard only 4/7 and of course no hardfork. Is this true? Any reference (i'm digging but can't find)? Thanks!


text:
What's happened with Cardano Proof of University Diplomas in Greece?
Storing university diplomas was a novel major usability announcement for Cardano back in 2018. It's been over 3 years if my memory serves me right. The plan was to use an enterprise permissioned version of Cardano or something to that extent.
Did IOG do it?
Did it work?

I personally think this is an excellent and on-topic question. I also remember this project and am curious of its current status. I'm voting to reopen this and started a discussion in the meta forum.


text:
ERC721 Converter?
I've heard that Cardano will be releasing an ERC20 converter. I'm wondering if there are plans for the converter to work with ERC721 tokens as well.
I'm interested in how to make a new NFT token program interoperable between ETH and ADA.
Thanks!

There have not been any plans announced to create an ERC721 converter.  ERC-721 defines some functions with compliance to ERC-20. This makes it easier for existing wallets to display simple token information.  However, they have differing capabilities and attributes.
The Cardano solution for the foreseeable future seems to be issuance of a native token on the Cardano blockchain.
It is likely that the value of creating an ERC721 converter is outweighed by the work required.


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:
What are your favorite resources to explain Cardano to people without a technical background?
Many of us have been in this situation I suppose: You're with some friends/family and you get asked what exactly this "Cryptocurrencies", "Bitcoins" etc. are.
I'm looking for an easy to understand overview of what Cardano is. Something along the lines of what it can be used for, what the benefits and the risks are and what the goal of the project is.
Are there any such resources available? Videos, blog posts, anything that could be understood by someone who has no clue about the topic.

Recommended videos

The philosophy of Cardano short version

The philosophy of Cardano longer version

Charles Hoskinson's whiteboard video for those who are not afraid of 50 mins of words like bandwidth, scaling, replication, etc. is a great intro to the challenges Cardano is designed to solve

How does bitcoin actually work, the best explanation