text:
Can Babel fees be extended to be a protocol level DEX?
With Babel fees one can pay for transactions in native tokens. Could this be extended to where someone could pay for the ADA part of the transaction fee and also provide a swap with a different native asset the of the swap requestors choice? This would mean the ledger itself could act as a DEX with the lowest possible overhead.

I suggest you read the guidelines for asking questions and consider re-writing the question to clarify what you are asking.

@gRebel I'm not sure how to word this better, any suggestions?

I think you may want to consider reversing the order here. The intent behind babel fees from my understanding is to leverage future conversion guarantees, DEXes, and other avenues for guaranteeing liquidity/conversion to ADA rather than to provide it's own mechanism.
We know these mechanisms will exist on chain from third parties so there is little reason for the foundational infrastructure itself to attempt to solve the problem as well. Instead it can leverage the existing solutions (once smart contracts are live) and allow competition and market forces to push for improvements and drive down prices.
It may be possible depending on how the negative values in EUTxO are implemented. The main issue is that as described in the blog post it currently relies on the assumption that transactions are only filled if the block producers can find a way to fill them. This would still likely be relying on conversion guarantees, DEXes, and other avenues for guaranteeing liquidity/conversion. Essentially this means if the block producers can't or won't exchange the tokens themselves, they'll have to use an on chain solution or the protocol will have to be extended so that non block producers can fill the requests. While this change can be done it would be very much non-trivial as it would likely require running an entire second network for negotiating order filling in between block production.
The issues with using this for running a DEX or liquidity system outside of just implementing it so that using it for DEXes would be feasible are that it'd create a lot of unnecessary transactions on-chain (which is inherent to on-chain DEXes) and depending how the system is implemented, it may put significant unnecessary load on the block producers. You'd probably want to run it on a state channel or side chain however both introduce new problems. The state channels would pose issues as joining may end up too expensive and side chains have significantly weaker security guarantees which would place using such a DEX somewhere in-between on chain and using a CEX in terms of security guarantees.
Additionally note that babel fees are in the paper phase at the moment. This means we won't see them on-chain for at least a year or two and the ecosystem may look vastly different than it does now so our assumptions as to how exchanges and liquidity systems operate may have changed significantly (based on the change we've seen in the last year or so).
TLDR: Maybe. We do not know remotely enough about how the system is implemented to know whether it would be feasible or even possible yet. When a paper on the topic is published, we should know enough to reason about the potential however as it stands it could be anywhere between completely feasible and impossible.

I may be off-base here. If so, I'd appreciate someone chiming in to correct me.

"guaranteeing liquidity/conversion to ADA" I'm wondering if it could be extended to letting there be liquidity/conversation to native tokens. That would always be more efficient than a dapp DEX because there would be no smart contract gas fee

This is under the assumption that Babel fees won't require smart contracts. They are essentially a method of deferring that conversion until later. The pool owners and delegators can elect to either take the tokens as rewards or exercise what effectively amounts to a future between the tokens and ADA. I suspect the exercising deadline will be on the epoch edge and which tokens will be exercised or not will be decided by either the stake pool operator or during delegation. In this supposed implementation this just means that those contracts are executing later not that they aren't executing.

The blog post states Babel fees do not use Smart Contracts, instead I believe you issue a UTXO with a negative value

I just reread the article and you are correct. I would caution however that since the concept has yet to reach the paper phase, it will likely change significantly and I suspect we will see far more restrictions on it than we see now. WRT what we know however I believe the answer to your question is maybe but most likely no. It should not be used that way on the main net as that will cause many unnecessary transactions that will lead to ledger bloat. On a state channel or side chain you could possibly use it however it would have a lot of limitations.

The short of it is we don't know enough yet and we won't have remotely close to enough information to accurately judge whether it will be feasible or even possible until a paper comes out. At the moment it is more a thought experiment than anything else and effectively anything is possible and nothing is possible until we see what changes it imposes on the ledger specification.


text:
Difference between "normal key" and "extended key" in cardano-cli address key-gen
With cardano-cli address key-gen, what is the difference between a normal key (obtained with --normal-key) and an extended key (obtained with --extended-key)?

I'll preface with the note that cardano-cli is a legacy project from the Byron era prior to the restructuring of cardano-sl into the modern infrastructure used today. You likely want to use the cardano-address if you can. The Adrestia repo keeps track of the official tools, libraries, and APIs as well as their support for the various eras.
To give a short explanation, the way key generation in Cardano works is as follows:

You create a Recovery or Seed Phrase. This is a deterministic seed that then derives your extended private key. This is the famous 24 word phrase that you store. It derives your xprv key but it does not represent it. This means if you do not have a seed phrase, you can not get one and you'll have to create a new wallet to get it.

You create the Extended Private Key. This is the root key from which all other keys are derived (including the extended public key). This key can either be created from scratch or derived from a seed phrase. If you want your key to be loadable into Daedalus/Yoroi without poking around in the internals and manually editing the SQLite database, you need to start from a seed phrase.

You derive Child Private Keys. These are various keys that serve specific purposes. Examples include the delegation(staking) keys, the various stake pool keys, and spending keys. As the protocol grows, there'll be more of these keys however as long as you have your extended private key or seed phrase, you'll be able to gain access to those with little to no action required.

You derive whatever else from the Child Private Keys. This is where you would derive addresses, stake pool certificates, etc. This is essentially all handled by the node itself and you don't really have to worry about much of this stuff unless you are doing something specific.

So in summary, the seed phrase is the "seed" that creates everything else (and is easy to store/remember), the extended key is your "master key", and the normal key (now called a spending key) derives from the extended key and lets you spend your funds.
Also note that the terminology differs a bit between eras. Byron used a rather different key system so you should generally avoid using it unless you absolutely have to. Icarus established the basis for modern key derivation in the Cardano ecosystem and Shelley has extended upon that (with staking related keys).

The Adrestia repo README lists cardano-wallet among other tools so you seem to be implying that cardano-cli is deprecated and that I should use cardano-wallet instead. I'm trying to mint some native tokens, which I know how to do with cardano-cli. Is minting supported by newer tools like cardano-wallet? A cursory inspection of the cardano-wallet help reveals no minting functionality. If cardano-cli is the only way to mint native tokens, then I'm missing the bridge between how cardano-cli manages keys and addresses and how the newer tools (e.g. cardano-address) do it.

I'll report back after I do a bit of research first. From my understanding cardano-cli kinda supports Shelley and Mary. I think the development of native assets started on cardano-cli and is still being ported over to cardano-wallet. It is ultimately just metadata Tx which cardano-wallet supports. From what I can tell atm it looks like if you want to mint native assets with cardano-wallet, you can do it but it's a manual process. The fields and validation seem to exist in the backend but there doesn't seem to be a cli interface other than the metadata interface exposed at the moment.

source: Stack Exchange

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

sort: votes


text:
Where can I find Cardano's academic research papers?
Where can I find the academic research papers related to Cardano?  I tried Google Scholar with no success.

Just out of curiosity. What search terms did you use on Google Scholar?

IOHK has a list of papers and currently I see 103 of them:
https://iohk.io/en/research/library/

In addition to https://iohk.io/en/research/library/ (as Joshua Chia mentions), you can then utilize Google Scholar to search for a paper's title and/or author names to also get a list of citing articles. I'm surprised you didn't have success with the site. Of course, you can also just search for cardano blockchain to get papers that are not necessarily written by IOG staff.
If Scite.ai would implement a better search and index more databases, I'd recommend them over Google Scholar due to the fact that there's also a sentiment analysis (supporting/contrasting in addition to Goggle's only type: mentioning cites) on citations.
Getting an idea on how other academics approach the paper you are interested in can aid in pre-digesting the Cardano-related papers.

You gotta go to crypto and or other tertiary domain specific archives. https://eprint.iacr.org/complete/ is one that I use myself quite frequently. Just look up IOG scientists if you're looking for Cardano specific papers.

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


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

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

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

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

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

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

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

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


text:
How does Cardano differentiate itself in the DeFi space?
How does Cardano differentiate itself in the DeFi space? What's the fastest way to start experimenting with applications?

Cardano differentiates itself as smart contracts are written in a more functional way than Ethereum Solidity contracts, so you can test Cardano contracts on your local machine, confident that they will run the same on the production network. Also, Cardano has things like Native assets, which simplifies handling of tokens.

At this moment, they are no DeFi applications deployed on Cardano as we're waiting for smart contracts.

This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question. - From Review

Right, hard to answer as Cardano does not differentiate itself in the DeFi space as it is not in DeFi space.

Are there any perceived or hypothetical advantages that are known at the moment based on the properties we know to be true about the behavior of eutxos and plutus?


text:
How is a stakepool rewarded?
Let's assume I run a stake pool, where I have pledged X ADA, have received delegations of Y ADA and have set a 1% fee.
When my pool creates a block, how much ADA is awarded to my pool and how is this amount distributed to me and the delegators, with respect to X and Y?

Let's assume your pool has the below configuration,

Cost - 340 ADA
Margin - 1%
Pledge - 5000 ADA
Delegation from all delegators - 5000 ADA

We will not discuss the reward calculation timing in this question, as it is a topic for another question.
When reward calculation happens, pool performance is calculated. Which in simple terms is how much total stake the pool controls across all pools ie. this pool controls (X+Y) note - pledge + delegation and the number of blocks it should ideally mint based on the stake it controls. Based on the performance, a pool is set to receive some ADA, for this pool let's keep that ADA to be 1000 for 1 block minted.
Now we have,
Total Rewards for the pool and delegators - 1000 ADA
Next, the protocol will calculate pool fees. Pool fees are the fixed cost + margin.
In this case, pool fees are as below
fixed cost + ((reward-cost)*0.01) =
340 + 6.6 ADA
Now we have pool fees =
346.6 ADA
remaining rewards for the delegators =
1000 - 346.6 = 653.4
Next, the protocol will calculate rewards for the delegators from the remaining ADA, which is a straightforward process, each delegator gets rewards as per the share of their stake.
Considering there are 3 delegators including the owner's pledge

owner pledge - 5000 ADA (50%)
delegator 1 - 2500 ADA (25%)
delegator 2 - 2500 ADA (25%)

The reward distribution is as below,
Available Rewards to be distributed = 653.4 (note remaining after pool fees)

owners stake rewards - 326.7 ADA
delegator 1's rewards - 163.35
delegator 2's rewards - 163.35

Now, NOTE that the owner's stake rewards + pool fees are paid to the reward account itself. The owners don't get the stake rewards into their own accounts.
So the pool reward account will get = 326.7 (pledge staking reward) + 346.6 (pool fees) = 673.3
The delegator rewards are paid to the respective staking addresses.
Important to note, if the pool fee is 100%, which means all of the rewards are taken by the pool and nothing is left for the delegators.
Here's an example of a pool running at 100% fees that it produces 0 rewards for the delegators. PRIVATE POOL

Thanks for your response. It makes sense. One final question, how does the pledge affect the reward per block. E.g. all other things being equal, how does the block reward changes, if I pledge X ADA as compared to if I pledge 10*X ADA?

@Cryptovios pledge has an influence on the total rewards a pool is set to receive. In the above scenario, more pledge ADA will increase 1000 ADA to be 1010 ADA JUST an example. How much influence the pledge has is based on the protocol param a0. There are more details about the formula but I think it is a topic out of the scope of this question.

what APY would someone typically get who decides to run the whole pool themselves and just stake the full 64mm?

Is the fixed cost of 340 Ada for each block mined during an epoch, or lump sum at the end of the epoch subtracted once from the total rewards?


text:
Can Marlowe contracts involve native assets?
Can Marlowe contracts involve native assets? For example if I want to issue a bond denominated in USDC

Yes.
Marlowe is essentially a layer over top of Plutus Core and so it can access and/or manipulate anything that Plutus Core based Smart Contracts can access including native assets/tokens. Marlowe is more restrictive than Plutus but only in terms of computation to allow for easier/automated static analysis.
https://docs.cardano.org/en/latest/marlowe/marlowe-lang-guide.html

Just as an added point, native tokens are first class citizens on Cardano, so anything you can do with ADA you should be able to do with native tokens.

While this is true, the only limitation currently is that you cannot pay tx fees with native assets yet. That will be possible some time in the future with Babel fees but not at the moment.


text:
What are the ways of making NFTs unique?
In the week 5 of Plutus Pioneer Program Lars described how to make NFT by spending an UTxO while minting, therefore ensuring the uniqueness of the token.
Are there any other ways of making NFTs unique?
What if I wanted to create let's say, a collection of thousands of unique tokens. Creating as many UTxOs to refer to them further on would incur significant cost in the fees. Are there any cheaper/simpler ways to do it?
PS: Solutions not available in Plutus yet are also welcome as examples.

"What if I wanted to create let's say, a collection of thousands of unique tokens. Creating as many UTxOs to refer to them further on would incur significant cost in the fees."
Are you hoping to have many NFTs created in a single transaction? AFAIK tokens created from the same script will always have the same currency symbol. It might save on fees if you forge them all in one transaction but different scripts.

NFTs have to be minted in some way or the other. In order to mint you will have to run a script with monetary policy for which you have to pay a fee, so might as well use that UTxO.
You can mint multiple NFTs in a single script though. Remember that a Value is identified by its CurrencySymbol and the TokenName. The CurrencySymbol is unique because of the UTxO input and is shared across all NFTs minted in the same contract. You can use a different TokenName for each NFT to ensure uniqueness.

I've been wondering about this. Are two tokens that share a currency symbol but have unique token names effectively as non-fungible as tokens with unique currency symbols?

I believe that is the case.

So, for example, if I wanted to represent land plot ownership by a NFT, I could mint as many of them as transaction size limit permits, spending a single UTxO. The plot ID would be included in the TokenName and people could trade those tokens freely but wouldn't be able to modify the plot ID within the tokens they own?


text:
How to import Yoroi seed phrase to computer using cardano-address for use with cardano-cli?
I'm trying to use cardano-cli to control the addresses controlled by my Yoroi wallet, so I thought the first thing to do is to import the keys and addresses. I did this:
$ # Type the seed phrase for the Yoroi wallet into a file phrase.txt.
$ cat phrase.txt | cardano-address key from-recovery-phrase Shelley > root.prv
$ cat root.prv | cardano-address key child 1852H/1815H/0H/0/0 | cardano-address key public --with-chain-code  | cardano-address address payment --network-tag mainnet

The output is "addr1v..." but in the Yoroi the 0th address is "addr1q...", so they are very different. What am I missing? My ultimate goal is to get the addresses and keys I need to build and sign transactions using cardano-cli, and I'm stuck at even getting the right addresses using cardano-address.

Following the instructions from the cardano-addresses README.md, I was able to generate a "delegated payment address" that matches the 0th address I see in Yoroi. However, cardano-cli transaction sign requires a --signing-key-file, which is normally generated using cardano-cli address key-gen, and I don't know how to get a cardano-cli-style signing key file from the stuff I can get from cardano-address.
I believe cardano-wallet can be used to make payment transactions, but AFAICT only cardano-cli can be used to mint tokens; I don't see anything about minting tokens in the help for cardano-wallet.

Have you checked in Yoroi if the output address "addr1v" is one of your public addresses? Every wallet has many addresses.

IDK how to give Yoroi an address to check whether it is mine, but I have generated a total of 4 addresses in Yoroi and they all start with addr1q and not addr1v. Additionally, I believe the last '0' in 852H/1815H/0H/0/0 is the address index. I suspect the 1q vs 1v has some special significance related to the nature of the address. I suspect that there is some knowledge about different types of addresses, what they are used for, what kinds of prefixes they have and how they relate to one another that I have yet to understand.

addr1v[...] are payment addresses, addr1q[...] are delegated payment addresses: https://github.com/input-output-hk/cardano-addresses#command-line

@eddex You raised a good point. What I was missing is the cardano-address address delegation, which requires the stake verification key to be generated first.

Great that it worked! You could add an answer to this question with the full set of commands so that others can see how you solved it.

I will once I figure out how to generate all the address-related files needed for using cardano-cli to build and sign a transaction. For example, cardano-cli sign requires a --signing-key-file and I need to figure out how to generate that.

You can use cardano-cli to convert an extended signing key to a Shelley-format key (which is what you need in order to sign a transaction).
cardano-cli key convert-cardano-address-key --shelley-payment-key --signing-key-file address.xsk --out-file address.skey

I believe this is the missing piece of information you are after. The steps needed to get address.xsk are the same as those needed to derive the extended verification keys. The answer to this question covers that.
Later edit :
Here are all the steps for getting a signing key usable with cardano-cli from a seed phrase
./cardano-address key from-recovery-phrase Shelley < phrase.prv > root.xsk

# Derive the address signing key
./cardano-address key child 1852H/1815H/0H/0/2 < root.xsk > address.xsk

# Convert the extended signing key to a Shelley-format key
cardano-cli key convert-cardano-address-key --shelley-payment-key --signing-key-file address.xsk --out-file address.skey

# Probably you can need non-extended keys, so if it is the case you can convert with:
cardano-cli address key-gen --verification-key-file extended-address.vkey --signing-key-file address.skey

In my case the address holding funds had this derivation path 1852H/1815H/0H/0/2. In Yoroi you can see the derivation path for an address when you click the ✓ Verify address button.
You can derive any path you need following the steps above.

Is the address.xsk actually the output file from cardano-address key from-recovery-phrase Shelley < phrase.prv > root.xsk? The only .xsk file I can see from the instructions in the README.md is the root.xsk from that command. Does that mean I can't use cardano-cli to control multiple addresses generated from the root.xsk?

No, that is the root signing key. You said you managed to reach the same address as the ones you see in yoroi, so I assumed you derived both the account and the address keys (so a full derivation 1852H/1815H/0H/0/0). You convert an extended address signing key with the command above. I'll edit my answer with a full example once I reach my PC

You can use Daedalus to restore your wallet on the machine and that should create a wallet file with the addresses you need.  Daedalus also contains cardano-cli as its built on cardano-node.
I did not try launching cardano-node / cardano-cli from a Daedalus install though, there may be additional wrinkles to solve.

You have to use some of the other tools in the cardano wallet suite. Get the cardano-wallet from GitHub. Here is an example for how to extract keys and make signing key files.
Basically you need to extract the keys from the seed phrase, and then convert them to CBOR hex, and then create the signing key file which is just a JSON format file.

Cardano cli offers some functions for that
$ cardano-address key from-recovery-phrase Shelley < phrase.prv > root.xsk
root_xsk1hqzfzrgskgnpwskxxrv5khs7ess82ecy8za9l5ef7e0afd2849p3zryje8chk39nxtva0sww5me3pzkej4rvd5cae3q3v8eu7556n6pdrp4fdu8nsglynpmcppxxvfdyzdz5gfq3fefjepxhvqspmuyvmvqg8983

https://github.com/input-output-hk/cardano-addresses#command-line

As an alternative to cardano-address you can use cscli, another open-source CLI tool to derive the cardano-cli compatible skey/vkey files.
Example using a dummy recovery-phrase:
cscli wallet key payment derive --recovery-phrase "walnut decrease buyer wealth eager truth bomb notable twenty" --account-index 0 --address-index 0 --verification-key-file pay_0_0.vkey --signing-key-file pay_0_0.skey

Disclaimer: I am the main developer for cscli so feel free to reach out to me on GitHub if you need help!


text:
How and when do CAs in Catalyst get feedback on their reviews?
Proposers and vCAs had time to flag/review CA reviews. Where nd when do Community Advisors learn about which of their reviews got flagged (critically, but also marked for constructive feedback) and what is the outcome of this process?

Timing dependent questions should not be asked here.  Better to post regarding things that have time and circumstance dependent answers on Reddit.

@gRebel thank you for your suggestion. I didn't know that besides the older Cardano Forums, Telegram groups, Discord, (maybe slack) there's also reddit to monitor.

The vCA's have a google doc (bear with us for now) that we share amongst ourselves for tracking review the reviewers. The CAs remain anonymous while the vCA's do not.
There has been some talk about in the future having a way for CAs to anonymously receive feedback for their reviews that were flagged in order to help guide CAs in the right direction.
I think this would be tremendously valuable, especially as the number of CA's grows almost exponentially in order to keep up with the expanding amount of proposals.
I second that you should simply join the Telegram channel and stay up to date on the latest developments from Project Catalyst, as things are changing very rapidly as we learn what works and discarding what doesn't work very well.

Right now, the catalyst team is busy collecting and cleaning up all the feedback from vCAs. They will announce the outage as soon as they are able to.
Monitor the usual channels for announcements!

Thanks, I'm looking forward to the announcement. It is because I have had no success with the usual channels that I posted this question here. I also thought this may be a good general question to ask, because the documentation outlining the process did not include how and when CAs get notified.


text:
Verify that Token is NFT
I was wondering how it is possible to actually validate if a certain Token is an NFT without having to inspect the code of the script which mints that Token? Only by checking if the current quantity is 1 will certainly not ensure that it won't be possible to mint more of that Token.

You can check the token policy for that. For most NFT projects you can look it up on https://pool.pm
A token policy can look like this:
{
  "scripts": [
    {
      "keyHash": "66833acfcf26d87e56bc829aa7bcef13295d4eee4d8b442175bd67a9",
      "type": "sig"
    },
    {
      "slot": 31882046,
      "type": "before"
    }
  ],
  "type": "all"
}

You can see the "slot": 31882046 and "type": "before" values which means tokens with this policy can only be minted before slot 31882046. To be sure that your NFT is unique, you can check that the quantity is 1 and the current slot of the blockchain is later than the one mentioned in the policy.
This policy is from the following NFT: https://pool.pm/1131301ad4b3cb7deaddbc8f03f77189082a5738c0167e1772233097.CardanoBits1947

How do you check the quantity?

You can see the quantity on https://pool.pm on the asset or on https://cardanoscan.io/ when searching for the policy id. These are just 2 of many options.

How to check quantity using CLI? :)

Hi @sloik, I'd recommend you create a new question for this.

@eddex https://cardano.stackexchange.com/questions/2348/how-to-check-using-cli-that-toke-is-a-nft done :)


text:
Transaction fees and smart contract complexity
I've read here and there, perhaps incorrectly, that the transaction fees depend on the size of the transaction (in bytes). However, with smart contracts, the difficulty to process a transaction is not proportional to its size: for example, there are small SAT-problem that can never be solved in practice, while it is very easy to answer the query "find the first byte of the sequence ab55..." even if the sequence is huge. Obviously, there should be some cost for the size of the transaction as it has to be stored on-chain, but if the cost is only on the size of the transaction, and not on the complexity of the request, then the chosen memory-time trade-offs will be greatly in favor of using time (free) above using memory (costly).
So, what will be the incentive mechanism for fees in cardano?

I think there are multiple things to consider. The data, as you pointed out, needs to be stored and thus incurs a cost. However, at least in haskell, that task of reading the first byte of the sequence is indeed rather simple if the laziness of haskell is utilized. It'll be interesting to see the exact fee formula.

@MatthiasSieber I do not see how haskell makes anything easier in this context. Indeed, you have to store the complete sequence because you have to check the signature. And it is also very easy to check only the first byte of a sequence in any imperative programming language like python or c. So not sure what you meant.

It's true that currently (prior to Plutus release), the only thing influencing the transaction fee for a transaction is its size in bytes.
However the Cardano development team have indicated that it will get more complex when using Plutus smart contracts. Two more factors will come into play:

Number of virtual instructions executed
Maximum memory used during execution

They are still working on the precise definition of what is a virtual instruction (some operations might count as more than 1, but how many exactly is still work in progress).


text:
Does Marlowe Run have the capability to mint NFTs?
I know the easiest way is to mint via https://www.nft-maker.io/ or https://cardano-native-token.com/ but if I want to mint it on my own, is minting in the Terminal the only option?
https://docs.cardano.org/en/latest/native-tokens/getting-started-with-native-tokens.html
I was wondering if Marlowe Run has the feature to mint NFTs in addition to creating smart contracts.

No, it is not planned for Marlowe to have a feature to mint NFTs or native tokens.
However, it will use tokens internally to represent the ownership of a role in contact.

...is minting in the Terminal the only option?

Yes, right now the terminal is the only first party option.
As Marek pointed out, the community may have other ways. https://satran004.medium.com/cardano-client-lib-minting-a-new-native-token-in-java-part-iii-1a94a21cfeeb looks like a good tutorial if you're in the Java programming ecosystem.
If you are not a programmer or terminal guru, I'm pretty sure a web version and/or Daedalus version is mostly likely in the works. The Daedalus version will supposedly allow you to do some ongoing "management" tasks of your minted tokens.
I'm pretty sure they demoed a web page for minting Native Tokens on one of the monthly updates. Charles in one of his AMA also said he wanted to bring that management to both the web, then eventually Daedalus.

I was wondering if Marlowe Run has the feature to mint NFTs...

No, no minting functionality. That tool is specifically for creating smart contracts.

I think this question is specific to Marlowe.

Also, it is not true right now the terminal is the only option to mint NFT. There is tons of libraries already that support this. https://satran004.medium.com/cardano-client-lib-minting-a-new-native-token-in-java-part-iii-1a94a21cfeeb

Thanks for the feedback, considering the question was about a web tool that targets "little to no programming", I was reluctant to provide answers that didn't meet the same standard.


text:
What is the exact implementation of proof of stake in Cardano?
I have a rough idea of what proof of stake does. However, I'd like the exact implementation (not the code) but a high-level description with hopefully some actual number, e.g. how many pools verify the transactions for each block, how is the consensus achieved, etc. If anyone knows or can send a resource with that information, it would be appreciated.

You might want start by checking out the documentation library. Go here and search on page for "Ouroboros".

Here's a roadmap of 5 main Cardano eras. In my opinion Shelley era brought the most significant changes to the Proof-of-Stake mechanism compared to Byron and Goguen eras. Shelley brought stake delegation and incentives scheme designed to reach equilibrium around stake pools.
In addition to the above, during the Shelley era, the Cardano network became 100 times decentralized than, for example, the Bitcoin network.


text:
Is there a maximum amount of ADA I can send in one transaction?
This question is related to one of my previous questions: Is there a minimum amount of ADA I can send in a transaction?
I wonder, if there is a minimum amount of ADA I can send in one transaction, is there a maximum amount too? Or would it theoretically be possible to send all 45B ADA in one transaction (if someone would own all ADA there is)?

The limit amount of output ADA is specified as Word64 which is an 64-bit unsigned integer, therefore the maximum output is 18 446 744 073 709 551 615 lovelaces in the current implementation.
So, sending all 45 billion of ADA is theoretically possible.

Where did you see Word64? I don't think there is a direct artificial limit. See the definition of TxOut and Value. Value uses Integer, which has no limit. https://playground.plutus.iohkdev.io/tutorial/haddock/plutus-ledger-api/html/Plutus-V1-Ledger-Tx.html#t:TxOut https://playground.plutus.iohkdev.io/tutorial/haddock/plutus-ledger-api/html/Plutus-V1-Ledger-Value.html#t:Value


text:
How do I calculate the fingerprint of an asset?
If I have an asset with
policy id: 2697bec9e609932eaaaafb34c8e1ea706549d268166ef60285026b85
asset name: redomgrun
How do I calculate the fingerprint asset107k0vzcplp8rjc3d2y8cew6z2gdhvnqru2uluu?

As per CIP14: User-Facing Asset Fingerprint, we calculate it as:
assetFingerprint := encodeBech32
  ( datapart = hash
    ( algorithm = 'blake2b'
    , digest-length = 20
    , message = policyId | assetName
    )
  , humanReadablePart = 'asset'
  )

Or you can just use an existing library, such as cip14-js by Emurgo.

do you know of any java implementation of it?

See Satya's answer to the question, he could not reply a comment as his user is too new.

A Java implementation will be available in cardano-client-lib next release. (0.2.0)
For now, you can refer to "calculateFingerPrint" method of this class (see here for tests).


text:
Stuck at Creating Keys for Token - cardano-cli address key-gen
I feel like an idiot but I am stuck at creating the keys for a token.
Here is the code:

cardano@transmission:/home/transmission/Documents$ sudo mkdir policy && cd policy

cardano@transmission:/home/transmission/Documents/policy$ cardano-cli address key-gen
--verification-key-file policy.vkey
--signing-key-file policy.skey

Command failed: address key-gen  Error: policy.skey: policy.skey: openBinaryFile: permission denied (Permission denied)

Do you have any idea why I am being denied permission for this command?
Thank you very much!

Ok I am an idiot for asking and answering this,but I am doing it anyways in case somebody stumbles in the same problem.
The folder for the keys needs to be created in the the directory where the node is in. In my case Cardano.

Your "policy" directory is owned by the root user, since you used sudo mkdir policy. No need to use sudo to make directories in your home folder, you can either remove and re-create "policy" without sudo, or change the owner with sudo chown -R <username> <directory>


text:
ERC-20 converter - How will it be possible for someone holding AGI tokens on an exchange to know whether they have ERC-20 AGI or Cardano Native AGI?
When ERC-20 tokens are are converted from Ethereum to Cardano, is it incumbent on the token holder to know that which wallet they can be deposited into?
What happens if say someone holding Eth native AGI tokens tries to deposit unconverted tokens into a Daedalus address or vice versa? How will it be possible for someone holding AGI tokens on an exchange to know whether they have ERC-20 AGI or Cardano Native AGI?

The original Ethereum tokens are known as AGI tokens
The translated tokens that are Cardano tokens are AGIX tokens.  The X at the end of the name differentiates them.


text:
Why are Cardano transaction fees so high?
It's obviously a lot less than Ethereum's, but 0.17 ADA isn't insignificant. What are the main reasons it can't be 0.00017 ADA?
I understand that the parameters are configurable over time, but has it really changed since 1 ADA = $0.10 until now? How exactly have IOHK determined that 0.17 is the right amount for now? If it is because it matches the cost of running the network - where can I see that calculation?

If you have fixed market cap (45 Billion out of which 31 B in circulation) you need to have transaction fees to cover the cost of running the network (Stake Pool Operators and all people who are delegating their coins to the SPOs).
If you don't have fixed market cap you can afford to cover all the costs by fixed/dynamic yearly inflation. But again: someone/something needs to cover the network costs. Nothing is free.
In our case the transaction fee at the moment is adjusted from time to time based on the price of ADA. If ADA goes up then the transaction fee goes down so that can be around 0.2$.
Later once Catalyst is more mature these parameters (including the topic about the fixed market cap) can be discussed and we will be able to vote on it. :)

However, the market cap is fixed but the limit is not reached yet. So in effect the costs are also covered by the issuance of new coins for now...

Yes, totally right. Thank you that you added this additional important information.

Thanks for the answer, added a few more details to the question to be more specific.
I understand that the parameters are configurable over time, but has it really changed since 1 ADA = $0.10 until now? How exactly have IOHK determined that 0.17 is the right amount for now? If it is because it matches the cost of running the network - where can I see that calculation?

As far as I know the parameters are adjusted so that the value of a transaction is to be around 0.2$.
One of the reasons for is DDOS attack and also to cover the cost of the network (over time after all coins are in circulation these fees should cover all the costs of the SPOs and the delegators).
So, yes, I remember that back at the time the trasaction fee was 1 ADA. Then over time based on the current value of ADA they changed that to correspond to ~0.2$ per transaction.

The transaction fee is a network parameter and is subjected to governance in the future. There is a cost for maintaining the network. Currently, there are more than 2500 stake pools that are providing the infrastructure for running Cardano.
Cardano also has a treasury that is powering innovation. Treasury is also paid from the transaction fee.
When the number of transactions goes up, the fees will be brought down as the governing mechanism decides.
Cardano is proof of stake based network, therefore operating cost is very low which will never result in runaway escalation in transaction fees.

Today's fees are high, that's true. But apart from all the well-known features that the Alonzo hard fork brought, there is the beginning of the Hydra embedding. Implementing Hydra with its isomorphic state channels (Layer 2 solution) will not only help to scale the Cardano network towards 1,000,000 Tx/s but will also help to bring down fees to a sustainable level.


text:
What prevents flash loans attacks from occurring on the Cardano network?
Flash loans attacks are current in DeFi space and we saw several ones these last weeks on the Binance smart chain. (Pancake Bunny and Burger swaps)
Mr. Hoskinson said numerous times that if it took years for Cardano to implement smart contracts and DeFi, it was to avoid such attacks and to have a more secure plateform.
My question would therefore be :
Will projects on Cardano be flash-loans-attacksless? If yes how? If not, can we find a way to secure it?
Thanks in advance

While flash loans will exist on Cardano, flash loan attacks will not.
To understand why, let's examine that PancakeBunny attack, https://www.coindesk.com/markets/2021/05/20/flash-loan-attack-causes-defi-token-bunny-to-crash-over-95/

Hacker used PancakeSwap to borrow a large amount of BNB
Hacker used these funds to to manipulate the price of USDT/BNB as well as BUNNY/BNB
Hacker received a large amount of BUNNY tokens
Hacker dumped BUNNY tokens onto the market, causing BUNNY price to crash
Hacker paid back BNB back to PancakeSwap, closing the flash loan

https://twitter.com/PancakeBunnyFin/status/1395173389208334342
This pattern is a common vector for flash loan attacks.  Key to the success of this attack is the ability to chain the execution of multiple smart contracts in series within a single blockchain transaction.
On Cardano, this simply won't be possible by design.

A single blockchain transaction represents activity that occurs simultaneously, not in series
And while Cardano does support chaining smart contracts, they must be chained over a series of transactions not a single transaction

So how would flash loans on Cardano work?  One option would be to write a validator script that implements the following rule: allow this UTXO to be spent so long as it is spent back into the same script address plus interest.
By design, the number of cases where this will be useful will be far more limited than on some other blockchains.

what are your thoughts on this article?https://medium.com/@khajepour.amirhossein/the-curse-of-flash-loan-in-cardano-62969dd0ea88

Flash loans generally exploit financial protocol vulnerabilities to manipulate the prices and exploit the system. For example, In the 2020 attack on Fulcrum built using bZx protocol, attackers used borrowed Ether to manipulate the price of sUSD( a stable coin); naturally, the price of the stable coin should have remained stable to prevent the attack. Smart contract writers should have anticipated the instability of stable coin prices under unusual market conditions. Formal verification methods would have identified this hidden issue.
Theoretically, these higher protocols are influenced by the underlying blockchain technology, which results in unreliable smart contract state estimation.
Cardano has brought the "Formal Methods" paradigm in creating smart contracts, enabling precise estimation of smart contracts behaviors provably. Moreover, Plutus is designed with such care to enable this technology. The potential of this mathematical precision has not yet been realized in the current ETH-dominated DeFi. In short, Cardano will prevent this type of protocol attacks by enabling smart contract writers to predict what can go wrong in which setting.

EDIT nov-02-2021: I misspoke earlier, details at the bottom.
Cardano is not intrinsically flashloan-attackless. Functional programming and formal verification help you a lot with the distance between spec and implementation, but do not give you anything with the distance between reality and spec. Reality (edge cases, attackers, things you failed to foresee) will be what gets you if your devs didn't let a simple bug through. Any proof engineer will tell you that false sense of security is a risk introduced by formal verification
It's tricky because we only use one word: "exploit" - when what we mean is either exploits at the software implementation level or exploits at the mechanism design level, but not both. The literature is infused with ambiguity, one must read diligently if they want to disambiguate this.
If you make progress on this, charge someone a lot of money.
EDIT: Cardano is in fact intrinsically flashloan-attackless at this time, but it is not because of "formal verification", it's because there are no multi-step yet atomic transactions. Flashloans, by definition, are an atomic transaction where an uncollateralized loan happens in the first step and it gets repaid in the last step. No multi-step yet atomic transactions, no flashloans, no flashloan attacks.

As long as you understand what formal verification can do, and can't do, I don't see why this should give a "false sense of security". And of course there will be buggy smart-contracts on cardano as well.


text:
How to derive addresses from a key exported from Yoroi
I’d like to code a small crypto portfolio app using python. So to track my ADA, I need to scan the addresses of my wallet.
I found Yorois feature to export a “key” and conveniently, it also states the derivation path. Unfortunately, I’m a noob with regard to key derivation and I’m a little confused by the encoding of the key, since it does not seem to come in a base58 format like BTC extended public keys.
So to have a common testing ground, I created a test wallet and this is the "key" that Yoroi gives me, when I go to Options=>Wallet=>Export Wallet=>Export:
95e74df114717de17ebfb24c05f9fd1c8019bb6f1de117eec10a43670a692866b837a4a5f51d62f3dc3d630d075c8e39e5294323ba146c386c48123aeef5438a
So how would I go about generating addresses from this key using python libraries or the cardano-addresses tool?
I already watched Cardano: NerdOut - Key Derivation by Andrew Westberg. Unfortunately, the public key used by Andrew was exported using Daedalus and not Yoroi and uses a different encoding.
So there are a two more specific questions, that may help with the solution of this problem:

Did I grasp it correctly, that the key given by Yoroi just needs to be converted using bech32 and a xpub prefix, to generate a “standard” xpub key (e.g. bech32 xpub <<< yoroikey using the bech32 tool)?
Reading further info, I learned that Cardano does not use standard BIP-44, but BIP-44-Ed25519. But is this even relevant for the address derivation using a xpub key? At least, looking at an example for Byron addresses, it does not look that way, since the ed25519 library is just used at the very beginning of the derivation.

Thanks.
EDIT: Added key for testing purposes.

+1 but it's better to ask 1 question per post. I recommend splitting it up so that this doesn't get closed as "needs more focus".

Thanks for the hint. I thought about splitting up the question. However, that would introduce a lot of redundancy, since all the questions are part of the ultimate question that's in the title. Also, I don't necessarily care about the answers to the more specific questions, if there is an easier solution to the general question.

You could put a link to the first question in the 2nd one.

After a bit of fiddling (see What encoding is used for Yorois Wallet export? and Why is there a small difference between addresses derived by the cardano-address tool and Yoroi?) I found a solution using the cardano-addresses tool and the bech32 tool.
Starting from a key exported from Yoroi (for this demonstration let's assume that this key is in a file root_yoroi_raw.pub):
# Encode the public key:
./bech32 acct_xvk < root_yoroi_raw.pub > root_yoroi.pub

# Derive the stake key:
cat root_yoroi.pub | ./cardano-address key child 2/0 > stake.xvk

# Generate first Yoroi address:
cat root_yoroi.pub | ./cardano-address key child 0/0 | ./cardano-address address payment --network-tag mainnet > payment1.addr
./cardano-address address delegation $(cat stake.xvk) < payment1.addr > payment-delegated1.addr
cat payment-delegated1.addr

# Generate second Yoroi address:
cat root_yoroi.pub | ./cardano-address key child 0/1 | ./cardano-address address payment --network-tag mainnet > payment2.addr
./cardano-address address delegation $(cat stake.xvk) < payment2.addr > payment-delegated2.addr
cat payment-delegated2.addr

Just FYI, the bech32 and cardano-address tools are part of the cardano-wallet suite. If you download the cardano-wallet release you get all the tools plus some others https://github.com/input-output-hk/cardano-wallet.

@nalyd88 Thanks for the hint! That could definitively come in handy.

I would suggest you leave Yoroi out of it. You have a seed phrase that can generate your wallet private keys. So, use the cardano-wallet tools to generate your keys, derive addressed, etc. You can do this in bash or call the cardano-wallet executables from a Python script.

Thanks for the suggestion. However, that is no option for me, since I want to create a watch-only wallet. I'm using a Ledger Nano S, and therefore the seed phrase/private key should not be stored anywhere else.

You can use the cardano-node CLI to get the balance for an address. But you will have to have all the addresses that your wallet uses (since they automatically generate new ones for anonymity). There is not a way to just export a key and watch all the funds in the entire wallet. Cardano uses HD wallets so you need the private root key to derive all the addresses. Except for the stake key, that is unique and can be used to find all the addresses that belong to the wallet but doing so it non-trivial.

Thanks for your help. However, I'm not sure whether what you are saying is correct. I think that knowledge of the extended public key associated with the wallet would allow me to derive all public keys and therefore addresses associated with the wallet. That is also supported by the hint that Yoroi gives during the export:
"Below you can find your wallet's public key information. Public keys allow seeing the wallet history for the wallet, but does not allow to spend or move the funds in any way (private key is not included)"

Yeah you are right. After the 1835H/1815H/0H path you can get a public key that will allow you to generate addresses. I didn't think that Yoroi was outputting that key though. I figured it was the public key associated with the full derivation path e.g., 1835H/1815H/0H/0/1.


text:
How can I accessing Yoroi keys from a script?
Is it possible to access yoroi private keys from the outside? For example, to write a script that does something with them?

Yoroi doesn't need to be involved. You can access your keys using the cardano-wallet suite of tools. You just need your seed phrase.
Yoroi and other wallets are just interfaces to the blockchain. The private keys on the chain are the same. Using the command line tools developed my IOG is basically what the wallets are doing behind the scenes.

Just to clarify, Yoroi does not use cardano-wallet, since it's a frontend JS app it relies on a WASM compilation of cardano-serialization-lib (rust).

The point is that the wallet software (e.g., Yoroi) is just a window into the blockchain. You can use the cardano-wallet to make scripts to interface with your ADA just like Yoroi or Daedalus (just need the seed phrase). If they are using Rust, JS, etc. to write their scripts then the cardano-serialization-lib may be useful.

@nalyd88 can you add those informations to your answer? Then I will accept it. I think it is important to have answers as complete as possible.


text:
Will I receive rewards for all epochs when I switch my stake pool?
I am currently delegating my ADA to stake pool A. I want to switch to stake pool B. What exactly happens with my rewards when I do this?
Will there be an interruption in the reward payout or will I still get rewards for every epoch?

You will continue to get rewards every epoch. Cardano works on epoch "snapshots" that occur every 5 days. It takes 3 epochs to get paid the rewards from a snapshot. This means that if you change stake pools, it will take 3 epochs (from the first snapshot that the change is effective) to receive rewards from the other pool. However, the other two epochs you will still get rewards because the snapshots with your ADA in the old pool will be paying out.
The only time you stop getting rewards is when you stop delegating your ADA and that is included in a snapshot. After the snapshot with your wallet undelegated, you will get the remaining rewards for the next two epochs and rewards will stop on the third epoch.


text:
How can I go about creating an Asset Fingerprint in Java?
I'm trying to implement the asset fingerprint in java.
So i'm importing these dependencies
<dependency>
    <groupId>org.bitcoinj</groupId>
    <artifactId>bitcoinj-core</artifactId>
    <version>0.15.10</version>
</dependency>
<dependency>
    <groupId>com.github.alphazero</groupId>
    <artifactId>Blake2b</artifactId>
    <version>bbf094983c</version>
</dependency>

And coded this as specified here: https://github.com/cardano-foundation/CIPs/pull/64
public static void main(String[] args) throws DecoderException {
    final String policyId = "2697bec9e609932eaaaafb34c8e1ea706549d268166ef60285026b85";
    final String assetName = "redomgrun";

    byte[] policyIdBytes = Hex.decodeHex(policyId);
    byte[] assetNameBytes = assetName.getBytes();

    Digest blakeDigest = Blake2b.Digest.newInstance(20);
    byte[] blakeHash = blakeDigest.digest(ArrayUtils.addAll(policyIdBytes, assetNameBytes));
    String bechString = Bech32.encode("asset", blakeHash);
    System.out.println(bechString);
}

But blake produces bytes like this
[127, -84, -10, 11, 1, -8, 78 ...

Which lead to String index out of range: 127 at bech encoding.
What am i doing wrong?

You have to first convert blakeHash bytes from 8 bits to 5 bits unsigned integer and then call Bech32.encode().
Sample code:
public static void main(String[] args) throws DecoderException {
    ...
    byte[] blakeHash = blakeDigest.digest(ArrayUtils.addAll(policyIdBytes, assetNameBytes));

    List<Integer> words = convertBits(blakeHash, 8, 5, false);
    byte[] bytes = new byte[words.size()];
    for(int i=0; i < words.size(); i++) {
        bytes[i] = words.get(i).byteValue();
    }

    String bechString = Bech32.encode("asset", bytes);
    System.out.println(bechString);
}

private static List<Integer> convertBits(byte[] data, int fromWidth, int toWidth, boolean pad) {
    int acc = 0;
    int bits = 0;
    int maxv = (1 << toWidth) - 1;
    List<Integer> ret = new ArrayList<>();

    for (int i = 0; i < data.length; i++) {
        int value = data[i] & 0xff;
        if (value < 0 || value >> fromWidth != 0) {
            return null;
        }
        acc = (acc << fromWidth) | value;
        bits += fromWidth;
        while (bits >= toWidth) {
            bits -= toWidth;
            ret.add((acc >> bits) & maxv);
        }
    }

    if (pad) {
        if (bits > 0) {
            ret.add((acc << (toWidth - bits)) & maxv);
        } else if (bits >= fromWidth || ((acc << (toWidth - bits)) & maxv) != 0) {
            return null;
        }
    }
    return ret;
}

thanks, that works, do you know of any apache etc. lib to do the conversion?


text:
What encoding is used for Yorois Wallet export?
Yoroi has a feature to export a wallet as a “key” (Options=>Wallet=>Export Wallet=>Export). I guess that it is the public root key, since the description says:

The below you can find your wallet's public key information.
Public keys allow seeing the wallet history for the wallet, but does not allow to spend or move the funds in any way (private key is not included)

For testing purposes I created a test wallet and this is the "key" that Yoroi gives me:
95e74df114717de17ebfb24c05f9fd1c8019bb6f1de117eec10a43670a692866b837a4a5f51d62f3dc3d630d075c8e39e5294323ba146c386c48123aeef5438a
So my question is: How is this key encoded? It does not have any default prefix and seems to be quite long.
I guess that, e.g. for use with the cardano-addresses tool, the key maybe just needs to be converted using the bech32 tool, correct? If so, then what prefix must be used?
Thanks.
PS: This question is part of a bigger question, which I split up into sub-questions, as recommended in the original question.

After a lot of trial and error, I figured it out myself.
TLDR
The "key" that results from the Yoroi export indeed needs to be encoded with bech32, using the prefix acct_xvk.
Demonstration/Proof
To test this, we need multiple things:

The seed phrase of our test wallet (for this demonstration we store it in the file phrase.prv): maximum vacuum toe conduct jazz tray romance crawl fossil wisdom disease crazy mountain bird discover
The "key" exported by Yoroi (for this demonstration we store it in the file root_yoroi_raw.pub): 95e74df114717de17ebfb24c05f9fd1c8019bb6f1de117eec10a43670a692866b837a4a5f51d62f3dc3d630d075c8e39e5294323ba146c386c48123aeef5438a
The bech32 tool.
The cardano-addresses tool.

We can now test, whether we can get the same results using our seed phrase and the exported key:
./cardano-address key from-recovery-phrase Shelley < phrase.prv > root.xsk
cat root.xsk | ./cardano-address key child 1852H/1815H/0H | ./cardano-address key public --with-chain-code > root.xvk

./bech32 acct_xvk < root_yoroi_raw.pub > root_yoroi.pub

cat root.xvk
cat root_yoroi.pub

This gives the following result:
acct_xvk1jhn5mug5w977zl4lkfxqt70arjqpnwm0rhs30mkppfpkwznf9pntsday5h636chnms7kxrg8tj8rneffgv3m59rv8pkysy36am658zsh2qnm6
acct_xvk1jhn5mug5w977zl4lkfxqt70arjqpnwm0rhs30mkppfpkwznf9pntsday5h636chnms7kxrg8tj8rneffgv3m59rv8pkysy36am658zsh2qnm6

This means, that the key exported by Yoroi, when being bech32 encoded with the prefix acct_xvk matches the extended public root key that can be derived from the seed phrase.


text:
Why is there a small difference between addresses derived by the cardano-address tool and Yoroi?
Let's consider a Yoroi test wallet with the following seed phrase:
maximum vacuum toe conduct jazz tray romance crawl fossil wisdom disease crazy mountain bird discover
The first address generated by Yoroi is then:
addr1q96a42g6ajjhu5gfw8gch2w0vflfxkqw53pxyufgacscal5f0vdmnq834g9upwe2g0cfzwemmwvfnyawg89g8xeqx4kstanhan
However, if I derive the first address using the cardano-addresses tool like this (where phrase.prv holds the seed phrase):
./cardano-address key from-recovery-phrase Shelley < phrase.prv > root.xsk
cat root.xsk | ./cardano-address key child 1852H/1815H/0H | ./cardano-address key public --with-chain-code > root.xvk
cat root.xvk | ./cardano-address key child 0/0 | ./cardano-address  address payment --network-tag mainnet

I get the following address: addr1v96a42g6ajjhu5gfw8gch2w0vflfxkqw53pxyufgacscals656txx
For direct comparison:
addr1q96a42g6ajjhu5gfw8gch2w0vflfxkqw53pxyufgacscal5f0vdmnq834g9upwe2g0cfzwemmwvfnyawg89g8xeqx4kstanhan
addr1v96a42g6ajjhu5gfw8gch2w0vflfxkqw53pxyufgacscals656txx
So the first part of the addresses is identical (except for the first letter after the prefix), but there seems to be missing something. What am I doing wrong?
Thanks.

There is indeed missing a part of the address: the delegation part. For more information, please refer to this partially duplicate question and CIP-0019.
To derive Yoroi addresses from a seed phrase using the cardano-addresses tool:
./cardano-address key from-recovery-phrase Shelley < phrase.prv > root.xsk
cat root.xsk | ./cardano-address key child 1852H/1815H/0H | ./cardano-address key public --with-chain-code > root.xvk

# Derive the stake key.
cat root.xvk | ./cardano-address key child 2/0 > stake.xvk

# Only the index of the payment address is incremented to yield the next Yoroi address:

# First address
cat root.xvk | ./cardano-address key child 0/0 | ./cardano-address address payment --network-tag mainnet > payment.addr
./cardano-address address delegation $(cat stake.xvk) < payment.addr > payment-delegated.addr

# Second address
cat root.xvk | ./cardano-address key child 0/1 | ./cardano-address address payment --network-tag mainnet > payment.addr
./cardano-address address delegation $(cat stake.xvk) < payment.addr > payment-delegated.addr

# Third address
cat root.xvk | ./cardano-address key child 0/2 | ./cardano-address address payment --network-tag mainnet > payment.addr
./cardano-address address delegation $(cat stake.xvk) < payment.addr > payment-delegated.addr


text:
How to stake a smart contract's money?
Is it possible to delegate the money locked in a smart contract? And how? Using what haskell instructions?

Please rephrase into a toplevel question.

@daedalusdaemon sorry but what is a toplevel question?

I meant the Title question.

A shelley address has two parts: payment part and staking part. For each of these parts, you have its specific private key and whoever holds it, has the ability to manage that part. So, you have an address where the payment part if managed by the smart contact, but the staking part is managed by you. This video might be helpful https://www.youtube.com/watch?v=NjPf_b9UQNs
So, a Shelley payment addresses that is used by scripts can still delegate to an associated stake key. When you create the locked output, you decide the staking.

Can you share some documentation or examples of what this might look like?

I think a good documentation for how addresses are working is https://github.com/cardano-foundation/CIPs/blob/master/CIP-0019/CIP-0019.md. Basically, as an example, you make a payment address that is used in the contract script, but where the payment address uses your stake address, so you own the stake rights.

What do you mean by a "shelley payment address that use scripts"?

Sorry, that is typo, a payment address used by scripts.

@MarekMahut-StakeNuts So just to clarify, you mean any address used by a smart-contract? Because, you know, I could write a script on my laptop that uses my address and obviously I can do whatever I want with this address. Or did you mean something more precise?

A shelley address has two parts: payment part and staking part. For each of these parts, you have its specific private key and whoever holds it, has the ability to manage that part. So, you have an address where the payment part if managed by the smart contact, but the staking part is managed by you. This video might be helpful https://www.youtube.com/watch?v=NjPf_b9UQNs

@MarekMahut-StakeNuts: I edited your answer to add this comment.


text:
Will the Cardano Rust project eventually allow you to write Smart Contracts?
Discovered this: https://cardanorust.iohk.io/
Looks great. Any rough sense on when Cardano Rust will support smart contracts? Is it being worked on now? Would be amazing.

No, the project in question is a toolbox that has been used in the Byron era of Cardano and could be considered outdated right now.
When someone implements the Cardano node in Rust, it will have to have the support for Smart Contract to match the ledger specification.

The last commit was Feb. 4th, 2020. So, no it's not being worked on—at least not recently. See the Github repo here.


text:
When will all 45 billion coins be in circulation?
I cannot find any accurate information with what speed and based on what formula the coins which are not in circulation will be in circulation and when (approximately) all coins will be in circulation.

The formula is quite complex, but at a high level it's an exponential decay like Bitcoin.
Up to 0.3% of the remaining reserves may be mined at each epoch (5 days), however it depends on various factors such as how many blocks were mined, so currently the average is closer to 0.2% per epoch.
At 0.2% per epoch, that corresponds to 13.59% of remaining reserves mined every year:
1 - (1 - 0.002)^(365/5) = 0.1359

So assuming 0.2% per epoch, it would take roughly 16 years (from genesis) for 90% of the supply to be in circulation, and 32 years for 99% to be in circulation.

So each year the percentage of minted coins is less because the transactions are more (they cover the rewards for the SPOs and the delegators)?

This is just what's coming from the reserve, transaction fees are in addition to that and are independent AFAIK.


text:
Stake Pool Operator - offering financial services?
Is there any chance that stake pool operators could be considered to be offering financial services?
If so, does anyone know whether there is a need to register with any entity or follow any specific rules (examples in different countries would be useful)?
I'm trying to decide whether to run a Cardano stake pool as an individual or as one activity within a technology company that offers IT services.

This is a great question. I think it could be interpreted either way but this is how we have interpreted it.
Our interpretation is no, as a SPO we are not providing a financial service any more than miners would be considered providing a financial service to the Bitcoin blockchain. We operate nodes that make blocks; our service is to the decentralized Cardano chain (technically you could say we are providing a service to anyone that sends a transaction that is included in one of our blocks, but there would be no way to know who that is). Delegators essentially "vote" on which stake pool they trust to make blocks. If they vote on a good pool, the Cardano protocol pays them rewards. They are not paid by the stake pool. The key difference here from a POW mining pool is the pool itself doesn't collect all the rewards first and then distribute them, i.e., we aren't accruing profits for delegators and distributing them. The Cardano network handles all of that.
I'd love to get anyone's thoughts on this. Thanks!

Playing the devil's advocate, you somehow collect the rewards first as you are creating the blocks and thus collecting the fees for your delegators. But I'm no lawyer.

Actually no, the rewards are not paid at time of block production. It's two epochs later after they have been calculated. At that time the protocol pays them out to everyone directly and not to us.

Looking into this for a friend. I think technically the pool operator is not running a financial service. The naming of the staking seems also wrong in ADA this way. This is just signaling. The only real stake is what the pool operator puts up as a collateral. So the pool operator is not taking deposits, custody, is not acting as a fiduciary or controller. I am still unsere as to where the rewards come from. I looked at the blocks in a block explorer (first on google) and did not find the coinbase transaction. I am a very long term Bitcoin guy however (BSV) and the block and fee rewards may work differently in ADA. Are they distributed "later"? If yes that could be interesting point to consider separately.
Nonetheless in many jurisdictions rulings are often not by the only exactly defined stuff. Often it matters if a "quasi" situation is created. In my jurisdiction the highest judges actually read protocols of parliamentary sessions of when the law was defined in order to judge if a new case will "quasi" fit this old intentions or not.  In that view you could even go as far as to categorize ADA as a collective investment scheme. That owners of ADA can earn tokens by not actually doing anything (again they are not staking, right, they are not risking coins) like e.g. building blocks. In every crypto there are different levels of degrees of this. If you e.g. care mostly about laser eyes till 100k and zero about utility, you may much easier be seen as this compared to a project that actually tries to build utility and scale. The lines are never as black and white. But on the surface it truly looks like the pool operator does not touch money or make any contractual promises about money (directly) to the "staker". So AML regulations may not apply here. They mostly seem to apply at the initial purchases of ADA for participants. However there is also liability to consider. Could a big "staker" try and hold the pool liable for a downtime?

I think there would certainly be tax benefits to running it as a business. In the U.S., staking income is taxed as regular income. It looks like this:
Income—->Taxes—>Expenses
I’m also looking at running a stake pool as a business in order to reduce the tax bite, which would look like this:
Income—>Expenses—>Taxes
I’ll try to report back what I learn after talking to my accountant this week.

I found this topic very interesting especially as I consider the proper business operating license for a stake pool.
However, in looking at how the protocol actually works, it seems pretty clear that the stake pool only has one customer, the protocol itself, and has no financial relationships with the delegators.
Thus the stake pool can’t be considered a money processing business, nor can it be responsible for KYC on delegators.
I wrote a detailed article about the topic on Medium.
https://medium.com/@mikerogero/should-stake-pool-operators-do-kyc-follow-the-money-bf0d7e789b31


text:
Is the Ouroboros Praos protocol proprietary?
The slots and epochs section of the Cardano Stake Pool Course states that the Ouroboros Praos protocol is proprietary.
Is this correct and, if so, is there a reason why this central part of the implementation needs to be proprietary?

Great catch! I have no idea how the word "proprietary" found its way in there. It's wrong, of course. I've just merged your pull request. BTW we moved this old course to the new developer portal that is being built. A lot of things are already improved, but if someone wants to contribute to the SPO category, please get in touch with me.

@adatainment I'd be interested in contributing.  Also - it would be good to see whether Chris Moreton's fork of plutus-pioneer-program can be merged, he is doing a great job of documenting the lectures: https://plutus-pioneer-program.readthedocs.io/en/latest/

That is not correct!
The ledger specifications are licensed under Apache License 2.0 and the paper is also open to public.

To be fair, the source states "The Cardano blockchain uses the proprietary Ouroboros Praos protocol to facilitate consensus on the chain."

Yes, the source is wrong. Or probably the wording is wrong.

I've created an issue here to get the source corrected

And the CF merged it right away! CF rocks.


text:
Will cardano halving happen to increase the demand of it?
Compared to ETH and BTC, Cardano's total supply is higher. Given this, how will ADA ever reach $1000. Will a Cardano halving happen and lead to increased demand of ADA?

I'm not sure if ADA will ever hit a thousand (less alone thousands of USD). Maybe at some point there won't be even USD? Cardano has a fixed supply of 45 billion, but it is still deflationary and just doesn't become more and more. The demand - hopefully - will be driven by utility.

Welcome to the community.
Rewards get reduced by up to 0.3% every epoch (5 days).
I'd suggest calculating your market cap projection. 1000 USD / current price (1.64 USD) would give us a 609.7x market cap (compared to our current market cap)
Cardano's value comes from the utility it provides, and the demand for ADA will increase with the applications built upon it, the identities managed with it, and the services governed by it. It is still, by nature, deflationary.

No. There will be no reduction of the supply of ADA in the future to increase its value or demand. Total supply is fixed and yes its greater than that of BTC and ETH. All this means is that the individual coins are worth less themselves. You should consider the total market cap.
Consider this, is there is more Satoshies than ADA? You can always use a bigger or smaller unit. You need to look at the market cap as a whole to do a comparison.

Supply, in the context of the question refers to the rewards given out to people staking and not to the total number of ADA. So, yes, the supply will decrease. As the other answer points out, the supply of ADA set aside for rewards decreases by .3 % per epoch. So Cardano does not have halvings like bitcoin where rewards get cut once every four years but rather there is a constant, gradual decrease in rewards which result in  staking rewards four years from now  being about one half what they are today.

There is no hidden pool of Ada, and the treasury should be used to back projects and support the growth of the ecosystem. Furthermore, to my knowledge, no new Ada are currently being minted.
Fees paid to stake-pool are charged at the point of transaction. As supply is currently constrained, it seems likely that as adoption increases and the demand for Ada increases, the price of Ada will also increase. As the cost of Ada increases, the value of the fees produced by staking will also become more valuable incentivizing more staking and a further reduction in supply, which should increase the value of Ada further. This will continue until fees are inhibiting the growth of the ecosystem and we have reached the Voltaire Era. Then, we will vote to lower fees, which will temporarily decrease the value of Ada as an appreciating asset but increase the value of Ada as a currency and Cardano as an ecosystem.


text:
Is it possible to make multiple transactions atomic?
A concrete example would be flash loans, where you could borrow some value from a lending script, do something interesting with it, and return the borrowed amount to the script with a fee, all in one transaction.
Intuitively this feels like it would need to be multiple transactions with separate outputs, but the lending script needs to verify that it is receiving sufficient value in return before it will ever lend anything.
How might this be modeled in Plutus to work?

Transactions on Cardano can be made up of many state changes. The transaction as a whole is atomic and a state change in the transaction will only be performed if all the changes can be performed.
For something like flash loans, as @Marek-Mahut points out, instead of having multiple transactions imperatively executed, each transaction just includes the before and after state. Flash loans are no longer needed in Cardano's model.
You could have a contract that allows you to redeem some ADA as long as you replace it with some interest in the same transaction--which is the equivalent of a flash-loan--but why would you ever do that? Plutus validators don't check that they're getting paid, they check that the state after redemption will be valid. The flash loan no longer serve the purpose of unlocking liquidity inside contracts. That comes for free with the EUTxO model.
tl;dr: All transactions on Cardano are made up of atomic state changes. This allows for what would be atomic sets of transactions on other blockchains.

Flash loans are not possible within the eUTXO model as each transaction is a single state transition, where a typical flash loan consist of two state transitions within a single transaction.
In my opinion, this is one of the most interesting security/safety features of the eUTXO model.

That "two state transitions within a single transaction" is what I mean by "atomic." Yeah.
The safety here sounds comforting, but in describing the EUTxO model, Lars suggested that anything on Ethereum would be theoretically possible on Cardano--maybe I read too much into it. I'm far from understanding the limitations of the EUTxO model, but Haskell has ways of modelling this safely with the STM monad. I'd hope in the future Plutus could be extented to allow it.

Yes, it was mentioned already that Lars called it a flash loan by mistake in one of the presentations, but he meant smart contract composability - similar, but a different concept.


text:
How to know if a transaction (tx) succeed or failed after awaitTxConfirmed?
How to know if a transaction (tx) succeed or fail after awaitTxConfirmed? Is there any function to get a tx on-chain by TxId?

awaitTxConfirmed is actually part of the off-chain code, so your computer is checking the chain to see if the transaction has become part of the ledger.
Sadly, right now awaitTxConfirmed does not know that a transaction has failed and if it did fail, your smart contact would be blocked, unless you introduce a logic to time out if your transaction is not included in the ledger for some amount of blocks for example.
However, I know the plutus team is working to solve this and we might have this functionality soon in Plutus.


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

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

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

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

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

BIP39 wordlist contains 2048 words. If you use a 24-word phrase, you'll get 2048²⁴ possible combinations, or 2^264. This is an insultingly huge number.
For hackers, trying to brute force to determine even your 15-word seed phrase, 2^165 possible combinations is also a huge number. Have you ever seen at least 2^160 ? This is a number of possible bitcoin addresses.
1,461,501,637,330,902,918,203,684,832,716,283,019,655,932,542,976

I'm sure a 15-word recovery phrase is enough for today. The 24-word seed phrase is invented with the future in mind (don't forget about quantum equipment).
Read my Medium story for details.
P.S.
For Shelley-era Daedalus wallet you must use 24-word seed, for Yoroi – 15-word seed.
For Byron-era Daedalus legacy wallet you must use 12-word seed, for Yoroi – 15-word seed.
For Cardano-cli Shelley-era wallet you can use 15, 18, 21 or 24-word seed.
The latest version of Yoroi has an ability to recover 24-word-based Daedalus wallet.


text:
How are Staking rewards calculated?
I remember that initially the percentage of rewards for delegators was around 5.12% visiting Cardano Calculator. Now they are approximately 4.6083%.
How this is calculated?
Will the percentage decrease over the years?

As explained in the docs, rewards come from:

Transaction fees (increases in time if adoption and network traffic increases)
Monetary expansion (decreases in time)

The sum of these is denoted by R and the share of rewards that a given pool gets is given by:

where: R - total available rewards for this epoch
a0 - pledge influence factor (can be between 0 and infinity)
z0 - relative pool saturation size, i.e. 0.5% based on a number of
desired pools (k=200)
σ - stake delegated to the pool (including stake pledged by the owners
and stake delegated by others)
σ’ = min(σ, z0) - as σ, but capped at z0
s - stake pledged by the owners
s’ = min(s, z0) - as s, but capped at z0

About monetary expansion and issuance, you may check this section of the docs.
Essentially, every epoch, a fixed fraction ρ is taken from the ADA reserves and is added into R. From the docs:

Calculating the ‘reserve half life’ (that is, the time that it takes for half of the reserve to be used up) visualizes the impact of choosing a specific value of ρ over another. This was the subject of much discussion, and eventually, the value assigned was 0.3%. The reason why is that mathematical projections showed that a ρ (the fixed percentage of ada going into the virtual pot every epoch) value of 0.3% would mean a reserve half-life of four to five years. In simple terms, just half of the remaining reserve would be used every four to five years.

Based on that information can we say that this percentage of 4.6% annual return will be approximately the same or over the years this can decrease substantially?
I am asking because based on that information I will be able to better plan the future of a foundation which will funded from the rewards.

At best, you can define different scenarios under different assumptions. Perhaps a simple lower bound could be established assuming that R is mainly given by monetary expansion and ignore transaction fees. In that case, rewards should decrease by 50% every 4-5 years. But a more general analysis should also consider projections on network growth. I'll leave that work to you ;)

Charles mentioned that over the time the idea is the rewards to be ensured by the transactions fees when we have billion of transactions.
I just wanted to see if there is something else to this question (like the formula above).

That's correct. By network growth I mean more transactions and hence more fees. You would need to evaluate different scenarios to get a better idea.

The link to the formula is not available anymore. It can now be found here:
https://testnets.cardano.org/en/testnets/cardano/get-started/pledging-and-rewards/


text:
How many static IPs does one require to run a stake pool?
Do you require 3 static IPs to run a stake pool?

1 for each relay (x2)
1 for a block producing node

Or, can I do 1 static IP, and have all these hostnames point to it:

relay1.domain.com
relay2.domain.com
bpn.domain.com

I've read that it is not recommended to use a Dynamic DNS provider service as there is some downtime between when your IP address changes and when it is updated by the DDNS provider.
I'm assuming that you can specify hostnames in place of IP addresses because someone did mention that DDNS can work, but isn't recommended.*

I am debating running this on hardware at home vs GCP, so any advice will be greatly appreciated. TIA

Do you require 3 static IPs to run a stake pool?

It depends. All your nodes needs a static addresses to talk to each other; this can be IP or dns. If going the IP route, it is best that the block producer IP is local and not public. The relay nodes will need to have public IP addresses.

1 public for each relay (2 public static IPs all together)
for a block producing node (one private static IP)

Now if reserving static IP is tricky, then you can also get away with just domain name resolutions if you use a dns service that propagates ip changes quickly. What you don't want is for your nodes to be cut out from the network while is creating a block.

I'm assuming that you can specify hostnames in place of IP addresses because someone did mention that DDNS can work, but isn't recommended.*

DDNS can work but isn't recommended since those service are often very slow or buggy when it comes to updating dns records. Also, I think DDNS will be more problematic if the upcoming P2P and gossip protocols has any kind of caching layer.

Can you explain why you need 2 public static IPs for each relay? Also, the block-producer IP must be public, otherwise how the relays can see it?

You need 2 altogether, 1 for each; I updated my answer. Your block producer should talk to your relay via a private or local network. Since your block-producer has sensitive information, you don't want the out getting in while still allowing all the things already in to talk to each other.

It's not a requirement to have static public IPs for each relay - you can easily share a single IP address and have them on different ports (assuming you have the ability to forward these on, for ex. using NAT).

You need to ensure that if your pool creates a block, that this is properly propagated to the rest of the network. So, your pool needs to be connected to the Cardano network at this specific time.
When your IP changes and the DDNS updates this record, it take take up to 5 minutes or more to propagate this DNS change to the rest of the internet. Your peers will probably detect that your IP is down and will try to reconnect.
So, to answer your question: it depends. Can you ensure the change of IP is made in a way that does not break your connection to the network or that it does so not when your block creation is scheduled?
I would say, it is possible, but not sure if it is worth to put in the effort. Can you buy a static IP from your ISP?

Thanks Marek! My question was more to the number of static IPs required for this endeavor - i.e. do all 3 machines (2 relays + 1 block producing node) require 1 static IP each? I will edit my question so this is clearer :)

You do not need a static public IP address for each node. You can easily run multiple relays on a single public IP address using different ports (eg. behind NAT/port forwarding).
Eg.
1.2.3.4 port 3001 -> relay 1
1.2.3.4 port 3002 -> relay 2

You could then point all of the hostnames to that IP but you must use the port numbers when connecting/listing them on-chain. Unlike with HTTP where multiple hostnames can run on a single IP/port (using the HOST header), that's not the case here.
Of course to do this, you'd need to be able to forward the ports from the device with that IP so this may depend on your exact setup (but a home router likely can do this with its port forwarding - I did exactly this with my first testnet pool, having two relays running at home).
Your relays/producer will still need some static internal IP address/hostname that they can connect to each other on (since they will need to be listed in each others topology files).


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

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

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


text:
Getting started developing cardano-node
I encountered a bug in cardano-node recently and since I know Haskell - I thought to myself, why not try and fix it?
I've done the following:

Build from source per https://github.com/input-output-hk/cardano-node/blob/master/doc/getting-started/install.md/
Install ghcid through stack
However, when running ghcid -c "cabal repl exe:cardano-node --reorder-goals" as per documentation results in the following error:

$ ghcid -c "cabal repl exe:cardano-node --reorder-goals"
Loading cabal repl exe:cardano-node --reorder-goals ...
Warning: Requested index-state 2021-04-30T00:00:00Z is newer than
'hackage.haskell.org'! Falling back to older state (2021-04-29T23:07:55Z).
Resolving dependencies...
Build profile: -w ghc-8.10.4 -O1
In order, the following will be built (use -v for more details):
 - cardano-node-1.27.0 (exe:cardano-node) (ephemeral targets)
Preprocessing executable 'cardano-node' for cardano-node-1.27.0..
GHCi, version 8.10.4: https://www.haskell.org/ghc/  :? for help
*** Exception: The following packages were specified via -package or -package-id flags,
but were not needed for compilation:
  - text-1.2.4.1
  - optparse-applicative-0.16.1.0
  - cardano-prelude-0.1.0.0
  - cardano-node-1.27.0
  - cardano-config-0.1.0.0

No files loaded, GHCi is not working properly.
Command: cabal repl exe:cardano-node --reorder-goals

Update: I guess for local development, I can probably work around this by setting
package cardano-node
  ghc-options: -Wwarn

in cabal.project, but that seems undesirable. It's been over 8 years since I've last used Haskell & Cabal, so I'm still figuring it all out again heh. But I guess something is slightly misconfigured?
Output when setting -Wwarn for cardano-node:
[1 of 2] Compiling Paths_cardano_node ( /home/weebl/git/cardano-node/dist-newstyle/build/x86_64-linux/ghc-8.10.4/cardano-node-1.27.0/x/cardano-node/build/cardano-node/autogen/Paths_cardano_node.hs, interpreted )
[2 of 2] Compiling Main             ( app/cardano-node.hs, interpreted )
Ok, two modules loaded.

All good (2 modules, at 04:45:39)

If anyone knows which steps I'm missing, please let me know.
GHC 8.10.4
Cabal 3.4.0.0
ghcid v0.8.7
OS: Ubuntu 21.04 x86-64
Thanks in advance!

until somebody more knowledgeable in this matter chimes in; you could try running this in a nix-shell (NixOS)

Try to give the guild cntools build script a look
https://github.com/cardano-community/guild-operators/blob/master/scripts/cnode-helper-scripts/cabal-build-all.sh
It probably contains all the information about
the initial setup (try ghcup), the cabal.project file, submodules ecc


text:
What are relay nodes?
I just started out with Cardano and blockchain and I read in an article somewhere that said that each stake pool must run at least one block-producing node and one relay node. The block-producing node holds the keys and certificates necessary to issue blocks, but it is not directly connected to the network.
As far as I understand, the blocks are produced by the pools and each of certain pools are assigned for different slots (epoch divided into slots) to mine a new block, but what do the relay nodes do?

From developers.cardano.org:

Within the Cardano environment, there are two types of nodes: Block-producing nodes, and relay nodes, which are nodes with no operational certificates.
Relay nodes do not have any keys, so they cannot produce blocks. Instead, relays act as proxies between the core network nodes and the internet, establishing a security perimeter around the core, block-producing network nodes. Since external nodes cannot communicate with block-producing nodes directly, relay nodes ensure that the integrity of the core nodes and the blockchain remains intact, even if one or more relays become compromised.
If a relay node becomes compromised, you can simply switch it off and use a different one.

In picture, a typical Cardano stake pool network looks like this:

Also, I would point out, you don't need to run a relay, it is just recommended best practice to protect your block producer from variety of attacks.


text:
ADA Payments for Ecommerce
I am looking for plugins that integrate with Squarespace, Webflow, for custom websites to accept cryptocurrency payments including ADA.
The NowPayments.io plugin only works for a few e-commerce websites.

There's currently also a solution by coti called adapay https://adapay.finance/ . Unfortunately, I think currently it's deployed as a tailored solution only.


text:
is it possible to use (bip39) 12 words passphrase in yoroi?
Currently I have a 12 words passphrase that I use over some wallets like exodus and metamask, I want to use the same 12 words on yoroi but yoroi only allows me to use 15 or 24 words.

I was under the impression that yoroi uses bip39 standard, why I can't create a wallet with only 12 words?
What is the technical limitation that prevents yoroi to use 12?
Is there an existing way (without coding it myself) to transform my 12 words into 15?, or 24?, assuming that 12 word passphrases are just 12*11=132 bits of entropy (128 bit entropy + 4 bit checksum) [reference here]

I want to avoid creating a new wallet entirely and now having to backup 12+24=36 words for reasons out of this scope.
(like for example I already etched the 12 words in metal using carbon atoms and I don't want to do it again because is expensive).

Yoroi dev here.
Yoroi uses 15 words because we think it's the best trade-off between security and convenience. Using more words may provide marginal security benefits, but you also have downsides like more difficulty if you want to memorise your mnemonics, more risk of writing down the wrong word or in the wrong order during backups, more inconvenience using offline metal backup devices (because you need to backup more words) and so on.
We also allow to recover 24-word mnemonics so that Daedalus users can use Yoroi if they want to. But allowing for more options compromises usability/UX. It's not a technical choice.
I don't see why you could not "stretch" a 12-word recovery phrase to obtain 15 words. You just need to make sure that the checksum is valid.
Finally, and more importantly, I am not sure that trying to use the same recovery phrase to manage multiple wallets is a good practice (hardware wallets are an exception of course). But ultimately, it's your choice.

thank you very much for answering, now I understand 15 words is just a choice and 12 words is not a technical limitation.
Regarding the stretching is less secure because it reduces the search space for brute force if the attacker knows it was a key generated by stretching 12 words, defeating the purpose of using more, but I envision one way to stretch it is to just add more bits from the checksum (37 bits) then it will make 128+37=165 or 15 11bit words.

Finally, using the same recovery phrase for multiple wallets shall not be a problem as long the wallet phrase is secured like in a hardware wallet, also that's the idea of HD wallets, to serve multiple coins, and therefore multiple wallets if a coin is not listed in a wallet of choice, I think®

Yes, agree, but it depends on how you manage it.  If you are constantly restoring mnemonic wallets in multiple devices, then it's an issue. Or if some apps, for some reason, are storing your root key, then there is a risk that all your wallets get exposed.

thanks for your insights, the best option here is just to create a new wallet with 15 or 24 words and make a metal backup of it also, this is why I am accepting this as the answer, please have a good day

After reading the bip39 specification, I learned that a 12 word mnemonic phrase was generated using an entropy of 128 bits, if I want to use a 24 word passphrase, there shall be no way to generate it from a 12 word list the entropy for a 24 word mnemonic phrase uses a 256 bit entropy + 8 bits of checksum which finally generates a 256 + 8 = 264 bits of random bits that can be split on 24 words of 11 bits, thus using the 2048 (2^11) words in the bip39 word list.
I wonder if I can use a key stretching algorithm like PBKDF2+HMAC-SHA512 algorithms, to produce a 256-bit (or it's first 256 bits) values as its final output in order to generate the 24 words mnemonic phrase I want, from only a list of 12 words, but I am not sure about how secure this is (well, of course is less secure because I cut the search space in half).
For now, I think the most secure way to obtain a 24 words mnemonic passphrase is to just create a new wallet on yoroi and just manage 2 mnemonic phrases, one with 12 words for btc and other altcoins (via trezor wallet and exodus), and a 24 word mnemonic phrase for cardano using yoroi :c
I leave this answer for any future reader, please let me know if I am wrong, please have a good day.


text:
How to convert xvk to svk?
I use cardano-address cli export extended private key, but i want to use it with cardano-cli command, how to convert it?

Yes, if you have created your cardano-wallet wallet using a mnemonic, you can restore a private key from it.
An excellent tool for this is cardano-addresses.

Generate your root private key.

cardano-address key from-recovery-phrase Shelley < phrase.prv > root.xsk
root_xsk1hqzfzrgskgnpwskxxrv5khs7ess82ecy8za9l5ef7e0afd2849p3zryje8chk39nxtva0sww5me3pzkej4rvd5cae3q3v8eu7556n6pdrp4fdu8nsglynpmcppxxvfdyzdz5gfq3fefjepxhvqspmuyvmvqg8983

Generate your payment verification key for the first address. Notice here, the /0/0 is the address index, increase the last digit to generate your other addresses.

cardano-address key child 1852H/1815H/0H/0/0 < root.xsk | cardano-address key public --with-chain-code > addr.xvk
addr_xvk1grvg8qzmkmw2n0dm4pd0h3j4dv6yglyammyp733eyj629dc3z28v6wk22nfmru6xz0vl2s3y5xndyd57fu70hrt84c6zkvlwx6fdl7ct9j7yc

You should be able to use your payment key to sign a transaction using cardano-cli.

Create your payment address to double check it is correct.

cardano-address address payment --network-tag testnet < addr.xvk > payment.addr
addr_test1vp2fg770ddmqxxduasjsas39l5wwvwa04nj8ud95fde7f7guscp6v

Sign payment key (xxx.skey) generated by cardano-cli is a json file, in your case addr.xvk file is not a json file, is there any command line tool i can use to convert addr.xvk to a standard json file to meet the cardano-cli 's demand ?