text:
How do I get wallet holders for a cnfts project?
I'm super new to cardano blockchain development. Today, I just have a chance to explore on blockfrost api. I've been trying to find an answer of the question that

Is there any public APIs out there that can make me get all addresses holding cnfts from a single project under the same policy id ? For example, the below image is a captured screenshot from www.opencnft.io, it shows all wallet holders distribution.
Right now I only see these two available APIs from blockfrost

https://cardano-mainnet.blockfrost.io/api/v0/assets/policy/{policy_id}

https://cardano-mainnet.blockfrost.io/api/v0/assets/{asset}/addresses

The problem right now is that the second api, {asset} is like a concatenation of the policy_id and hex-encoded asset_name mixed together, which asset_name in cnft asset will be a unique asset id and their asset ids all vary from each other under the same policy. Meaning that I need to call this API n times by having each request vary on asset_name (given n are total nfts of a project)
Appreciate any helps :)

Seeing as many projects have up to 10k assets it's clear that you cannot use Blockfrost for this.
Unless opencnft.io has an exposed API endpoint that you can use to query this info from their database, I'm afraid you're going to have to use a tool like Ogmios to extract the relevant information from the blockchain yourself. You'll have to set up a cardano node and use the chainSyncClient utility in Ogmios to sync blocks and store the UTxOs/addresses containing the assets in a custom database (for example json/SQL).

Depending on the exact use case Blockfrost should be a perfectly fine option to fetch the holders of 10k assets. Even the free plan includes 50k requests per day. It might not be the best option for building a site that frequently needs to update this data on many projects though.

Right. It depends on the the use case indeed. I assumed the latter.

Thanks so much guys, you guys help me a lot

To add one more approach I recently found which could potentially be much simpler. On Cardanoscan if you go to the token's policy details page, there's a button "View" right after "Policy Asset Holders". It will show you the token holder's addresses per page. You can easily scrape this data, for example in Python using requests module or async requests to reduce time as you'll need to scrape multiple pages (200+ pages). Change the query param pageNo with each new request https://cardanoscan.io/tokenPolicy/d5e6bf0500378d4f0da4e8dde6becec7621cd8cbf5cbb9b87013d4cc Spacebudz example


text:
Metadata '721' error on pool.pm
Hello and thank you beforehand for your time! I read a lot before posting and could not find a solution to this.
Pool.pm is complaining about the metadata '721' throwing an error: "Expecting an OBJECT with a field named 721"
I first thought I made the transaction using a different policy id than the metadata like in this post: NFT Image not Displaying in Pool.pm after using the 721 Metadata Standard
But as you can see from https://cardanoscan.io/transaction/c02c4db6bc9b2b9f3adcac930559368f7c2a4f00a2a53fc8661fae3b5ce844b2?tab=metadata the policy id matches the one on the metadata. The metadata I used is:
{
  "777": {
    "prc": "0.5",
    "addr": [
      "addr1q8pfw723tpkt8hl7q4wxx7h9seqt4cy22zrqk4axmhmcglwykt772jcyu6u",
      "9pv84nktsmpefeh7w9y6hdr87a65a93ysut2t0r"
    ]
  },

  "721": {
    "3e3a9f39933d04bd854527801f615d35d1cbe1b0344d482af20343ae": {
      "ShaveandTattooed": {
        "Name": "Shave and Tattooed",
        "Artist": "Marvin Lunas",
        "Image": "QmRTJUU8MUw5rUzES6XJd5RiA55K9seVAWU3tTkS8UoQYi",
        "mediaType": "image/png",
        "Description": "Description",
        "files": [
          {
            "mediaType": "image/png",
            "src": "QmUhgW6c8MKmzZKMNtr8Sfvb8UjqM3bgCh6X1upDCNAgHH",
            "Name": "Shave and Tattooed"
          }
        ],
        "ID": "1",
        "Minting Platform": "https://adamagic.io"
      }
    },
    "Version": "1.0"
  }
}

I have no idea what is causing this issue because I did use the same template before and it was all good.
It also has a problem while loading the thumbnail and at this point, I think the problem is on me.
Once again, thank you all for your time and effort!
Cheers

When I tried I did not get a 721 error from pool.pm. The assets show correctly with the correct policy ID eg https://pool.pm/asset1xpdk028mq57te9dkg62rvy79nv2mhl4zr78xgn and https://pool.pm/asset1qlmcztdqq3w8fu5jfxrmsel40yn0y652hhs9ap . The policy shows ok https://pool.pm/policy/3e3a9f39933d04bd854527801f615d35d1cbe1b0344d482af20343ae .
But the policy when searched shows 'no match found' using
https://pool.pm/tokens/3e3a9f39933d04bd854527801f615d35d1cbe1b0344d482af20343ae - I think pool.pm only shows 'recent' minted or transferred NFTs as there are so many.

It's showing up for me alright on pool.pm: https://pool.pm/asset1xpdk028mq57te9dkg62rvy79nv2mhl4zr78xgn
Might have been just a temporary issue while data was populating?
There's a testing tool here, that you can use to verify it works: https://pool.pm/test/metadata
Here it's populated with your metadata: Link
When you remove or rename the "721" object you'll see your exact error show up: "Expecting an OBJECT with a field named 721".
So if this is the place you're seeing it, there might be just a simple syntax error in the json you're putting in here.
Just some potential minor improvements to the metadata:
According to the spec at https://cips.cardano.org/cips/cip25/#specification you should use lowercase attribute names like "name" and "image" instead of "Name" or "Image".
And for the image hashes I'd add "ipfs://" as a prefix to make it more clear where to look for them, but it does usually work fine without.
Anyways looks like it all works fine on my side as is

source: Stack Exchange

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

sort: votes


text:
What is a Semantics Model?
In the eUTxO research paper by IOHK, it mentioned that the eUTxO model is able to enable both expressive smart contracts and keep the simple semantic simplicity of the UTXO model.
But what does semantic simplicity mean?
As per request here is a link to the paper.

could you share the link to the paper for context?

Good call don't no why I didn't attach one. Sorry.

in theoretical computer science, "semantic" is meant to indicate a property of a language.
in particular, it describes the set of words/symbols that are disposed in a particular order to describe a well-formed program.
always in theoretical computer science, it is often introduced alongside the study of automata, in order to demonstrate the differences and limitations of various theoretical models.
in the paper you linked it is mentioned how the logic that we can run on protocols like Bitcoin could be expressed using a simple state machine, the simplest of automatas, which are easier to describe and write but less powerful than models such as a PDAs and Turing machines
so when it is said that the UTxO tends to produce a simpler semantic model from a purely practical point of view it can be seen as a way to express the complexity needed to describe a program.
A simpler semantic model doesn't necessarily mean that is less powerful, only that is easier to express. (whereas a less powerful semantic model is condition sufficient but not necessary for a simpler semantic model)

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


text:
How to have a contract on chain for extended periods of time?
In PPP Larz explains that there's a limit to how long a contract can remain on chain, what is that limit and how do I go about extending it?

Can you point to the source where Lars says this?

Just a guess, but you might be referring to the POSIX time <-> slot conversion, where Lars noted in week 3 (see notes here), that - if you require a definite upper bound for a slot interval - you should not place that upper bound too far into the future, because slot lengths could potentially change in the future, and cause your script to behave unexpectedly.
If so, I'm not sure if this is still important in the context of using txInfoValidRange in smart contracts though, since it seems to have changed from SlotRange to POSIXTimeRange (https://github.com/input-output-hk/plutus/blob/65fa7ce05a810947f565ac59b4d4e35b3cd5d1b3/plutus-ledger-api/src/PlutusLedgerApi/V1/Contexts.hs#L109 since this commit) - and so you probably don't need to care about this any longer.
In any case this is not related to how long your contract stays on chain, but only how one needs to consider working with time & slot length in certain scenarios.

Yeah it's changed a bit can i specify this to be something like 100 years from now?

In general if you're working with the POSIXTime: It's in milliseconds since 1970-01-01T00:00:00Z. So in 100 years it'll be around ~4812480000000. I think in general you can safely work with this in your scripts (but don't trust me on this :p).
However for the "txInfoValidRange" value: It's not set directly by you in posix time, but converted from slots under the hood and set by whoever created the transaction in the first place. I think it can also take any value up to infinity (open interval) - so yes, it can also be a valid tx in 100 years.


text:
What is Type Safety?
In the Haskell programming language there are a number of concepts that must be understood by anyone wishing to learn and use the maximum potential of the language. One of these what is is type safety.
My question is what is meant by type safety?

Wikipedia has better explanation that I could give : https://en.wikipedia.org/wiki/Type_safety

Type Safety is a simple and powerful concept – it means that your app validates types at compile time, and throws an error if you've tried to assign the wrong type to a variable. This way a statically-typed Haskell language prevents type errors (and Plutus does exactly the same way). And Haskell is really good at Type Inference.
Example 1.
Two Ints can be multiplied:
multiplication :: Int -> Int -> Int
multiplication x y = x * y
main = do
   print(multiplication 125 4)

-- Result: 500

Example 2.
Int and Char types cannot be multiplied:
multiplication :: Int -> Int -> Int
multiplication x y = x * y
main = do
   print(multiplication 125 '4')

-- Result: Couldn't match expected type `Int' with actual type `Char'

This response assumes you know what Types are.
Type safety is pretty much ensuring that you’re putting square pegs into square holes at all times to avoid buggy code.
Example:
A) 3 * 1 -> This is correct because both are integers (Int) and operation can be done.
B) 3 * “foo” —> This is wrong because one is an integer (Int) whereas the other is a string ([Char]), the operation can’t be done.
Expression A is type safe whereas Expression B isn’t.


text:
Can I Use TraceIfFalse in deployment?
So I use traceIfFalse to test a lot of my smart contracts now I'm ready to deploy some of then and I want to know if this is for development only or if its fine to have a smart contract use this function when deployed to the chain?
Im using it in the validator of the contract.

it strictly depends on your needs and how your validator is supposed to work.
traces in general (trace, traceIfFalse, traceIfTrue, traceError) are known to be one of the causes of larger scripts.
so if your validator has to be used in pair with other data in a transaction it is essential it reduces the script size.
keep in mind that removing traces means you'll likely have a hard time understanding what is wrong if something goes wrong.
one possible solution to keep traces would be to use error codes ( as done for some errors that might happen when using builtin funcitonalities ) so that you can reduce the script size and have a clue of what's going on in your code.


text:
Rising trend in blocks missing: what could be the reason? Should we worry?
I came across this fantastic real-time data-visualization site for Cardano: Cardano Blockchain Insights.
My question is: why have the missing blocks increased by so much? Epoch 347 is due to some known pools, but why is there a general trend since circa Epoch 270? Some hypotheses:

Is it because there are simply more pools, so it's harder to
broadcast blocks before the next block comes up?
Is it because more people are using barebones metal servers, so
connections are less reliable than cloud services?
Is it because more people are using cloud services, so there's more congestion in the cloud? (Sounds unlikely to me but just want to get some ideas)
Maybe the trend is due to some pool operators? (Don't want to lay the blame on anyone but it's one possibility)
Should we worry about it? Will the decline affect the long-term prosepct of Cardano?

Thanks!

I can give you my opinion on the argument, but please note that I'm not assuming to have enough data to give you 100% guarantee mine are the reasons this is appening.
I will focus more on your first option and I'll give you some counter arguments for the other 3 (and then your final question).
option 2 and option 3 should not be relevant in terms of missed blocks, afterall some people succeeded running a cardano-node on mobile (this happened also more recently, I just couldn't find the more recent source)
I'd exclude option 4 since some operators not acting correctly wouldn't be enough for an upper trend, on top of being more damaging for the operator itself
option 1

Is it because there are simply more pools, so it's harder to broadcast blocks before the next block comes up

I think it is because there are more pools but not for the reason you gave, I say so because Ouroboros is designed to broadcast a block so that at least half the network knows about it in 1~2 second from the creation and the majority of the active chain in 5 seconds at worse.
I think it is because there are more pools because in this scenario height battles are more probable to happen, those are not rare events as you could see by spending 5 minutes on https://pooltool.io/realtime
If my idea is correct this should not worry you as ouroboros is designed to handle "small forks" quickly

Well it should not worry us in regards to network stability, but what about "the higher the amount of missed blocks by SPOs the lower rewards for stakers"?

Thank you. I'll leave the question open to discussions.


text:
Creating transactions: is it required to send all utxos as inputs and outputs
I'm developing some raw tx server-side scripts and dealing with ValueNotConservedUTxO errors. If I create a transaction from a specific address, must I create inputs for all the utxos and then add the ones I'm not sending elsewhere to a change address?
Hopefully I'm just missing a key understanding else I really don't understand why such a waste of blockchain data would be part of the plan.

No, you don't have to create inputs for all utxos at an address; but for every utxo you do add as an input, you need to spend it in full (i.e. including assets that may be included), so your outputs and inputs add up correctly (apart from the transaction fee).


text:
How can I create babbage era tx. Whats the difference from Alonzo Era?
I can't use my old Tx creator (cardano-cli) from Alonzo era.
Command failed: transaction build  Error:
 The era of the node and the tx do not match.
  The node is running in the Babbage era, but the transaction is for the Alonzo era.
  \n"}

How can I create babbage era tx. Whats the difference from Alonzo Era?

You can probably just add --babbage-era to your cardano-cli transaction build (or build-raw) command. You'll see this option when you enter cardano-cli transaction build -h.
As per this issue and this comment the alonzo-era is still set as the default for now.
Regarding the differences, the babbage era brings lots of new features and possibilities, that you can find a good technical overview of here, including: reference inputs, reference scripts, inline datums and much more.


text:
How can a transaction first be included in block A, then in block B
Earlier today I submitted a transaction on the Testnet. Shortly after I checked it using blockfrost and got the info my tx is included in block 3681998
A few hours later I checked again, but now the tx is included in block 3682001.
I am seeking for an explanation how that happened.
Thank you!

My suspicion is as follows:

You saw the tx in block 3681998 (which must have been the chain tip).
Another block (competing with 3681998) was chosen by the consensus algorithm that did not contain that tx.
Block 3682001 was added that included that tx.

Thanks for your answer. Maybe that's what happened. Did you notice block 3681998 is empty? How can I check if the block wasn't chosen?

Sometimes there are empty blocks. There is no way to check why a block wasn't chosen. This is the normal operation of a distributed ledger / blockchain. Read up on how bitcoin chooses blocks.

The latest blocks in the blockchain generally can change for a while until further blocks are created on top and push your transaction down the chain. The "deeper" it gets, the more likely it is not to change.
The two blocks you're pointing to are just ~3 minutes apart, so there doesn't seem to be anything abnormal about it. Here's a good read on these confirmation times / settlement windows.

Thanks for your quick response! I should have added to my question that I am aware blocks only become truly immutable after 129600 slots. My question is more about how this specific case occurred. Sorry if I wasn't clear.

Ah okay, I don't know of a way to get the data for this specific case unfortunately. But the first block holding your transaction was probably orphaned for a reason that is described nicely in this article: https://www.beaver-stake-pool.net/post/slot-battles-height-battles-and-orphaned-blocks


text:
How to query the address that sent a token from cardano-db-sync?
I'm trying to query the token transactions using the schemas of Cardano-db-sync. When querying ADA transactions, I can easily see the input and output addresses with the values sent by joining the tx, tx_in, and tx_out tables, as shown in the examples here.
However, it is not as easy when I try to query token transactions. I used the multi_asset and ma_tx_out tables to identify which token was sent and in which transaction. I can see the address that received the token, but I cannot identify the address that sent the token when there are multiple input addresses.
For example, how can I know that (addr1q8h ... 8k5s6cnspc) sent the token and not the other input address in this transaction? Is it actually possible to do that by only joining the tables?

For example, how can I know that (addr1q8h ... 8k5s6cnspc) sent the token and not the other input address in this transaction? Is it actually possible to do that by only joining the tables?

The multiple inputs of a transaction are not mapped individually to an output. All you can do is query the input UTxO to know assets associated with individual input (which is same for base currency, ADA) - you probably already have the latter part sorted, but just in case - sample example code used by koios for complete transaction information can be found here
In the example you mention, it is easy to deduce since all the assets were present on single address. However, if you try to look at slightly more matured wallet transaction, this will likely complicate further as you'd be associating multiple inputs containing same asset - which is true also for base asset (ADA). The logic would be the same, consider inputs used to consume in desired output, and have the remainder spent to change address.


text:
Plutus V2 Primitives
Does any have (or has anyone found) a simple summary of Plutus V2 Primitives?  They made the short list of big changes in the Vasil fork announcement, so they seem important.  Other than just reading haddock after searching for Plutus.V2, is there a resource for understanding and using the new stuff?
Might be a Lars Office Hours kind of question.

In addition to what Michele said, maybe the following repo helps understand the new cips (1). It has some nice examples on how to use the new functionalities.
Note however that we are currently in the transition of a new cost model on the testnet, we have to wait for epoch 216 I think). After that update Plutus V2 script will become available.

Great repo with enough information to lead me where I want to go.  Thanks @fermat.

If you try to compile the code examples, do not forget to use the next node branch of the plutus-app repository. The main branch is not ready yet for plutusV2, I think.

for this purpose, I found useful the source code itself
in particular, I think a good starting point would be the Plutus.V2 version of TxInfo
other than the new information available there should not be any difference in writing the smart contracts.


text:
Encoding / Decoding Fingerprint with Python
We currently use a python script to get fingerprints from assetName and policy id. However we are resorting to using the cardano bech32 binary for the final part of the process.
from hashlib import blake2b
from subprocess import check_output
import binascii
import bech32
import sys

policyId = '60a75d4bfee53ebe583679faed1fba8a8921abfd685dbc76e313032a'
tokenId = '416433763173446576696c7331313739'
binary_asset = binascii.unhexlify(policyId + tokenId)
output = blake2b(binary_asset, digest_size=20).hexdigest()
output = check_output([f"/home/bech32bin/bech32.sh", str(output)]).decode(sys.stdout.encoding).strip()

print(output)

### output is asset1rgafp0kmehn9ws6g9224fyjd550wakdhlupk0k (correct)

Where the contents of bech32.sh are:
/home/bech32bin/bech32 asset <<< $1

This utilises the bech32 binary for the final stage of the process detailed in pseudocode here https://cips.cardano.org/cips/cip14/
Does anyone have an idea for a pythonic method of doing the last part. Without having to call a subprocess (which is slow, especially when looping through on potentially thousands of nfts) I assume with pythons inbuilt bech32 lib but have been unable to replicate.

By last part I assume you mean just the bech32.sh. If so, you can use the below :
encodedstr=bech32.bech32_encode("prefix",bech32.convertbits(bytes.fromhex(hexstr), 8, 5))

perfect. TY mate.


text:
Daedalus Node is Not the Latest Version
I am running Daedalus to use the Cardano-Cli. Right now when I run the command
cardano-cli query tip --testnet-magic 1097911063

It returns this, which states that it is still in the Alonzo era.
{
    "era": "Alonzo",
    "epoch": 214,
    "hash": "add989729d61973bb82174179887a089ae9648b28d211e9cfc83993aed3b7068",
    "block": 3680416,
    "slot": 62504629,
    "syncProgress": "99.74"
}

Do I have to update the node myself? Or do I have to wait for Daedalus to do it and download a newer release? If so, when will the updated version be out?

There will be an updated version of Daedalus for testnet running the new node by the end of the week (most likely Thursday, taken from Discord). You can probably download it from here once it's ready:
https://testnets.cardano.org/en/testnets/cardano/get-started/wallet/

let the node sync
the output you shared shows
    "syncProgress": "99.74"

meaning the node is not synced with the blockchain.
as soon running the command you see
   "syncProgress": "100.00"

you should be able to enjoy your Vasil testnet


text:
Cabal repl fails because of missing dependency lzma
Summary
When running cabal repl inside any week in the Plutus Pioneer Program, it fails with the error message:
cabal: Missing dependency on a foreign library:
* Missing (or bad) header file: lzma.h
* Missing (or bad) C library: lzma

However, when running which lzma I get a path to /Applications/anaconda3/bin/lzma
Also when trying to brew install lzma I am told that lzma is now included in xz.

Overview/Description
When trying to build the cabal repl for the Plutus Pioneer Program on macOS Monterrey, cabal fails with an error message stating it can't find the lzma library.
I've tried using cabal new-build --extra-include-dirs="<path to lzma>" (the path I got from running which lzma on the terminal) and extra-include-dirs: /opt/homebrew/include  extra-lib-dirs: /opt/homebrew/lib to no avail.
Steps to Reproduce
Following the instructions on cardanoacademy, cardano stack exchange, and IOG's technical community discord to build the cabal repl for the Plutus Pioneer Program.

Inside plutus-apps - git checkout 3746610e53654a1167aeb4c6294c6096d16b0502
Run command nix-shell
Inside nix-shell - git checkout (tag of the corresponding week on the cabal.project file, e.g. ee59880f47ab835dbd73bea0847dab7869fc20d8 for week01).
Run command Cabal update
Run command Cabal repl

Test Results
Failed to build lzma-0.0.0.3. The failure occurred during the configure step.
Build log (
/Users/macadmin/.cabal/logs/ghc-8.10.2.20201118/lzm-0.0.0.3-09eda932.log ):
Configuring library for lzma-0.0.0.3..
cabal: Missing dependency on a foreign library:
* Missing (or bad) header file: lzma.h
* Missing (or bad) C library: lzma
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the
library file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
If the header file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.

cabal: Failed to build lzma-0.0.0.3 (which is required by
plutus-pioneer-program-week01-0.1.0.0). See the build log above for details.

Environment Setup and Configuration
OS: macOS Monterrey version 12.4
Model Name: MacBook Pro
Any help or guidance would be greatly appreciated.

which lzma likely returned the path to the executable. extra-include-dirs probably wants a path to source code eg source for lzma. Try locate lzma.h (or similar command for Mac) to see if it's on your system and use that path in extra-include-dirs. If it isn't you should be able to locate and install the lzma source.

Looks like 'liblzma-dev' is the source package that you want to install, and you might need to use --extra-lib-dirs instead.

@MC_Brisbane-JUSTPool I did locate lzma.h and got a list of paths, I tried them all with --extra-include-dirs and still the same issue, plus an added treat of Not in scope: type constructor or class ‘GHC.GenTickish’ which I'm also looking into. I've tried brew install liblzma-dev and get lzma is now part of the xz formula. Weird thing is, I can see lzma.h all over the place, how does it not see it? I've even tried installing the Haskell package and nothing.

Two weeks just to realize I hand't followed instructions properly. To be completely fair, it's hard to find documentation that links setting up the plutus playground with the plutus pioneer program, but the information is there.
The problem is simple, I was using the wrong git checkout tag. I was using this reference and incorrectly assumed that the git checkout for the plutus pioneer program's respective week was to be done inside the nix-shell.
It is not. IOHK's guide is pretty straightforward, complete and up to date as far as I can tell.
Basically,

The git checkout for the respective week needs to be done first inside the /plutus-apps directory (i.e. git checkout 41149926c108c71831cfe8d244c83b0ee4bf5c8a for week01)
Run nix-shell
Inside the nix-shell navigate to the plutus-pioneer-program/code/<week no> and run cabal update,
Run cabal build
Run cabal repl

Glad you got it working.


text:
Cardano sync stuck with errors: ErrorPolicy and DnsSubscription
Greeting!
My cardano-node sync stuck at 99.65% then getting those errors:

Cardano-node version - 1.35
Cardano-cli version - 1.35
Any suggestions how to fix those errors?
P.S. A few weeks ago sync was 100%

After few days cardano node fully synced. Maybe problem was due to new Babbage era.

It looks like the log is from 1.34.0 - Are you sure you restarted the node after upgrading to 1.35.0?
If yes, maybe specify the full path to the process (for example, /home/<user>/.cabal/bin/cardano-node instead of just cardano-node in your startup command - in case you've got multiple node binaries in your $PATH environment variable).

I initially used 1.35. Cardano-node located only at /var/cardano. My system start up it like service.

I tried to remove the database folder but the cardano-node still throw errors after 95% sync.


text:
Plutus week 6 - Oracle example smart contract removed
Previously in Plutus pioneer program Week 6 shows how to implement an Oracle, now the example code has been removed.
Is this because the way to implement Oracles has changed? and the previous approach is not applicable anymore?

I can't say why they would have removed it. But Vasil does allow for much better Oracles with "reference" outputs. They might provide an example of that, but the old model isn't invalidated with the Vasil upgrades.

I'll take a look the Vasil improvements, thank you @MitchellTurner

The Plutus Pioneer Program is iterative, thus the code in the repo can change between iterations.
However, if I'm not wrong, you can find the oracle example here: https://github.com/functionally/mantis-oracle/blob/main/src/Mantra/Oracle.hs

Here is the link to the branch. In case anyone wanna check it out.


text:
Cardano-Wallet server won't restore my wallet through mnemonic_sentence
When I try to restore a users wallet through cardano-wallet (testnet) I get this payload using the [POST] /wallets endpoint
{
  "code": "wallet_already_exists",
  "message": "This operation would yield a wallet with the following id: 8209f39a872faa51a63c0f7bb8d748067cf7b2b0 However, I already know of a wallet with this id."
}

The following payload I send is the name,mnemonic_sentence & passphrase with the same arguments I gave it while creating the wallet. I even went as far as to change the name & passphrase but I still get the same wallet_already_exists error.
{
  "name": "Recovery Wallet",
  "mnemonic_sentence": [
    <15 KEYS>
  ],
  "passphrase": "wallet_pass_01"
}

I read that Cardano-Wallet should lookup a wallet and return its funds when a mnemonic_sentence derives a wallet that already exists. As you can see this isn't working for me & I don't see how I can force a recovery.

Sounds like the wallet was created successfully. Can you see the addresses of the wallet? Use something like /wallets/{walletId}/addresses which would be wallets/8209f39a872faa51a63c0f7bb8d748067cf7b2b0/addresses in your case. Then check address balances. Or you could delete the wallet and restore it again if you want.

@MC_Brisbane-JUSTPool Yes! I actually did that & came across something interesting. Since cardano-wallet is a stateful services the DB checks to see if a wallet was created already by itself, resulting in a DB lookup for that ID. If there is no ID in the DB & on the cardano-network then it'll create a wallet for you.
Now if you want to restore a wallet that your instance of cardano-wallet has created then it'll throw the wallet_already_exists error. So the solution is either me having to create my own cardano server to manage keys or I have to wipe the cardano-wallet db each time :(

Ok that is interesting behaviour, got link to the info? Are you using the latest wallet version? cardano-wallet version v2022-07-01 was only released recently so will have a heap of changes/fixes relating to compatibility with cardano-node 1.35.0.

Let me look into this, apparently I've been using v2022-04-27. I'm going to update my container & then get back to you on this, if the error still persists then I'll create my own server to talk directly  to the cardano-node & bypass cardano-wallet

Summary from comments:
Suggested for OP to check they are is using the latest cardano-wallet version v2022-07-01.
OP noted they are using v2022-04-27 so will update and report back.


text:
Pre-creating Cardano Wallet Receiving Addresses for later use
Does it matter when a receiving address is used to receive ADA into a wallet?
For example:

I use cardano-node/cardano-wallet to create a wallet.
I then generate 100 receiving addresses for that wallet.
I store the receiving addresses in a database table
Over time, as needed, I use one of the receiving addresses to allow a user of a service to send ADA to the wallet, I mark that address as "Used=1" in the table, and use the next unused address the next time one is needed for that same customer, or a different customer.
At some point, if unused addresses are getting low, I get a notification - and proceed to generate more receiving addresses and add them to the table to replenish the pool of unused addresses.

There are some benefits to doing this in this way...do you see problems with this methodology? Is it not feasible because of a time-based limitation on using a receiving address generated for a wallet or some other such issue I am not aware of?
Does this seem like a reasonable strategy at least until I have a more dynamic/on-demand wallet address generating system devised/implemented?
Thank you!

I don't see any problems in doing it this way. Just make sure you save the recovery words in safe places, to be able to recover the wallet.
You can also take a look at my script here to see the way I'm using to manage some of my wallets:
https://gist.github.com/cardano-apexpool/99784308812bdf7aa01446fa95f47fd2

Thank you for taking a look at my question and responding!
Thanks too for the link to your repo.

@data_relevant


text:
cardano node sync stop at 99%
i am trying to setup cardano test node but i am getting this error in console and it stuck on 99%
[185:cardano.node.DnsSubscription:Notice:610213] [2022-07-10 15:16:41.88 UTC] Domain: "relays-new.cardano-testnet.iohkdev.io" Connection Attempt Start, destination 13.41.9.54:3001
[185:cardano.node.DnsSubscription:Notice:610214] [2022-07-10 15:16:41.90 UTC] Domain: "relays-new.cardano-testnet.iohkdev.io" Connection Attempt Start, destination 3.131.32.242:3001
[185:cardano.node.DnsSubscription:Notice:610213] [2022-07-10 15:16:41.93 UTC] Domain: "relays-new.cardano-testnet.iohkdev.io" Connection Attempt End, destination 13.41.9.54:3001 outcome: ConnectSuccess
[185:cardano.node.DnsSubscription:Notice:610215] [2022-07-10 15:16:41.93 UTC] Domain: "relays-new.cardano-testnet.iohkdev.io" Connection Attempt Start, destination 54.199.108.71:3001
[185:cardano.node.DnsSubscription:Notice:610216] [2022-07-10 15:16:41.96 UTC] Domain: "relays-new.cardano-testnet.iohkdev.io" Connection Attempt Start, destination 3.133.220.20:3001
[185:cardano.node.DnsSubscription:Notice:610230] [2022-07-10 15:16:41.98 UTC] Domain: "relays-new.cardano-testnet.iohkdev.io" Connection Attempt Start, destination 18.198.216.177:3001
[185:cardano.node.DnsSubscription:Notice:610231] [2022-07-10 15:16:42.01 UTC] Domain: "relays-new.cardano-testnet.iohkdev.io" Connection Attempt Start, destination 184.169.196.177:3001
[185:cardano.node.DnsSubscription:Notice:610230] [2022-07-10 15:16:42.02 UTC] Domain: "relays-new.cardano-testnet.iohkdev.io" Connection Attempt End, destination 18.198.216.177:3001 outcome: ConnectSuccessLast
[185:cardano.node.ErrorPolicy:Notice:51] [2022-07-10 15:16:42.02 UTC] IP 3.131.32.242:3001 ErrorPolicySuspendConsumer (Just (ConnectionExceptionTrace (SubscriberError {seType = SubscriberParallelConnectionCancelled, seMessage = "Parallel connection cancelled", seStack = []}))) 1s
[185:cardano.node.ErrorPolicy:Notice:51] [2022-07-10 15:16:42.02 UTC] IP 54.199.108.71:3001 ErrorPolicySuspendConsumer (Just (ConnectionExceptionTrace (SubscriberError {seType = SubscriberParallelConnectionCancelled, seMessage = "Parallel connection cancelled", seStack = []}))) 1s
[185:cardano.node.ErrorPolicy:Notice:51] [2022-07-10 15:16:42.02 UTC] IP 3.133.220.20:3001 ErrorPolicySuspendConsumer (Just (ConnectionExceptionTrace (SubscriberError {seType = SubscriberParallelConnectionCancelled, seMessage = "Parallel connection cancelled", seStack = []}))) 1s
[185:cardano.node.ErrorPolicy:Notice:51] [2022-07-10 15:16:42.02 UTC] IP 184.169.196.177:3001 ErrorPolicySuspendConsumer (Just (ConnectionExceptionTrace (SubscriberError {seType = SubscriberParallelConnectionCancelled, seMessage = "Parallel connection cancelled", seStack = []}))) 1s
[185:cardano.node.DnsSubscription:Error:610213] [2022-07-10 15:16:42.22 UTC] Domain: "relays-new.cardano-testnet.iohkdev.io" Application Exception: 13.41.9.54:3001 MuxError (MuxIOException Network.Socket.recvBuf: resource vanished (Connection reset by peer)) "(recv errored)"
[185:cardano.node.ErrorPolicy:Warning:51] [2022-07-10 15:16:42.22 UTC] IP 13.41.9.54:3001 ErrorPolicySuspendPeer (Just (ApplicationExceptionTrace (MuxError (MuxIOException Network.Socket.recvBuf: resource vanished (Connection reset by peer)) "(recv errored)"))) 20s 20s
[185:cardano.node.DnsSubscription:Error:610230] [2022-07-10 15:16:42.31 UTC] Domain: "relays-new.cardano-testnet.iohkdev.io" Application Exception: 18.198.216.177:3001 MuxError (MuxIOException Network.Socket.recvBuf: resource vanished (Connection reset by peer)) "(recv errored)"
[185:cardano.node.ErrorPolicy:Warning:51] [2022-07-10 15:16:42.31 UTC] IP 18.198.216.177:3001 ErrorPolicySuspendPeer (Just (ApplicationExceptionTrace (MuxError (MuxIOException Network.Socket.recvBuf: resource vanished (Connection reset by peer)) "(recv errored)"))) 20s 20s```

i have updated cardano-node to 1.35.3 still same issue issue i am facing, syncing stoped

You need to upgrade to node 1.35.0 (better to use 1.35.1) to sync post Vasil HF

Please make sure you have the latest genesis and config files for your node version. Hi have seen this symptoms in the past with nodes that had not updated files, so you may check for it. Depending on how you are managing the node your update procedure may be different, but in general you can find the latest versions in the official repository:
https://github.com/input-output-hk/cardano-node/tree/master/configuration/cardano
Also, check that you are not out of disk:
df -h

and the logs for any meaningful hint:
journalctl -f -e

Cheers,
Josep

Just checking as Im having the same issue, but according to that link, yes the config files have been updated but the genesis files are all over 2 years old... some even older. Is this correct?

Hi Bertus, yes they are that old. You can check they are not corrupted checking their hash, i.e. from your files directory, cardano-cli byron genesis print-genesis-hash --genesis-json byron-genesis.json should output 5f20df933584822601f9e3f8c024eb5eb252fe8cefb24d1317dc3d432e940ebb , cardano-cli genesis hash --genesis shelley-genesis.json should output
1a3be38bcbb7911969283716ad7aa550250226b76a61fc51cc9a9a35d9276d81, and cardano-cli genesis hash --genesis alonzo-genesis.json should output
7e94a15f55d1e82d10f09203fa1d40f8eede58fd8066542cf6566008068ed874. How many time have been stuck at 99%?


text:
Generating and storing Seed Phrase offline
I would like to be able to generate a new seed phrase using:
cardano-wallet recovery-phrase generate

...and use that for a new wallet, but do it offline. So the seed phrase is never onscreen on a network connected machine and only ever recorded on paper.
Is there a documented procedure for doing this?

You can use BIP39 compatible library to generate 15/24 word mnemonics. If looking for CLI, you can use cardano-addresses, check out the Readme in the repo, the command to generate mnemonics would be:
cardano-address recovery-phrase generate --size 15 > phrase.prv

# exercise club noble adult miracle awkward problem olympic puppy private goddess piano fatal fashion vacuum

The short answer is Yes, you can generate and store your seed phrase offline.
When generating a primary recovery phrase for new Cardano CLI wallet, you can choose 15, 18, 21, or 24-word phrase. Optional additional protection can be provided with a secondary recovery phrase containing 9 or 12 words.
These two Medium stories will provide you with useful information how to do that:
How does 12-word seed phrase work?
Cardano wallet Command Line Interface (Part one)


text:
Problen when sysncing node on mainnet
I runned a node on testnet successfully, then I wanted to do it again but in the mainnet. I installed by following "Coincashew" guide and the developers cardano guide. I am encountering the following error and problems. First, node makes a very slow chunk validation, by my experience on testnet this is really weird, but, it might be something from mainnet?, I don't really know, this is a sample of the process:
[vmi92943:cardano.node.ChainDB:Info:7] [2022-07-10 16:07:57.49 UTC] Validated chunk no. 996 out of 2322. Progress: 42.89%
[vmi92943:cardano.node.ChainDB:Info:7] [2022-07-10 16:07:57.49 UTC] Validating chunk no. 997 out of 2322. Progress: 42.89%
[vmi92943:cardano.node.ChainDB:Info:7] [2022-07-10 16:07:58.09 UTC] Validated chunk no. 997 out of 2322. Progress: 42.94%
[vmi92943:cardano.node.ChainDB:Info:7] [2022-07-10 16:07:58.09 UTC] Validating chunk no. 998 out of 2322. Progress: 42.94%
[vmi92943:cardano.node.ChainDB:Info:7] [2022-07-10 16:07:58.75 UTC] Validated chunk no. 998 out of 2322. Progress: 42.98%
[vmi92943:cardano.node.ChainDB:Info:7] [2022-07-10 16:07:58.75 UTC] Validating chunk no. 999 out of 2322. Progress: 42.98%
[vmi92943:cardano.node.ChainDB:Info:7] [2022-07-10 16:07:59.39 UTC] Validated chunk no. 999 out of 2322. Progress: 43.02%
[vmi92943:cardano.node.ChainDB:Info:7] [2022-07-10 16:07:59.39 UTC] Validating chunk no. 1000 out of 2322. Progress: 43.02%
[vmi92943:cardano.node.ChainDB:Info:7] [2022-07-10 16:07:59.88 UTC] Validated chunk no. 1000 out of 2322. Progress: 43.07%
[vmi92943:cardano.node.ChainDB:Info:7] [2022-07-10 16:07:59.88 UTC] Validating chunk no. 1001 out of 2322. Progress: 43.07%
[vmi92943:cardano.node.ChainDB:Info:7] [2022-07-10 16:08:00.52 UTC] Validated chunk no. 1001 out of 2322. Progress: 43.11%

Right after that chunk validation the following is shown:
[vmi92943:cardano.node.ChainDB:Info:7] [2022-07-10 16:28:05.79 UTC] Found a valid last location at chunk 2322 with tip d9138d5dec83c9b1283a8122d3fa0602e81d78d9c652ca646dbe05dd6aaaf4c6@50157911.
[vmi92943:cardano.node.ChainDB:Info:7] [2022-07-10 16:28:05.79 UTC] Opened imm db with immutable tip at d9138d5dec83c9b1283a8122d3fa0602e81d78d9c652ca646dbe05dd6aaaf4c6 at slot 50157911 and chunk 2322
[vmi92943:cardano.node.ChainDB:Info:7] [2022-07-10 16:28:05.79 UTC] Started opening Volatile DB
[vmi92943:cardano.node.ChainDB:Info:7] [2022-07-10 16:28:13.88 UTC] Opened vol db
[vmi92943:cardano.node.ChainDB:Info:7] [2022-07-10 16:28:13.88 UTC] Started opening Ledger DB
[vmi92943:cardano.node.ChainDB:Error:7] [2022-07-10 16:29:23.72 UTC] Invalid Snapshot DiskSnapshot {dsNumber = 49806209, dsSuffix = Nothing}InitFailureRead (ReadFailed (DeserialiseFailure 866812015 "end of input"))

Then, the node starts replaying ledger from genesis:
[vmi92943:cardano.node.ChainDB:Info:7] [2022-07-10 16:28:13.88 UTC] Replaying ledger from genesis
[vmi92943:cardano.node.ChainDB:Info:7] [2022-07-10 16:28:14.29 UTC] Replayed block: slot 0 out of 50157911. Progress: 0.00%
[vmi92943:cardano.node.ChainDB:Info:7] [2022-07-10 16:28:17.04 UTC] Replayed block: slot 21599 out of 50157911. Progress: 0.04%
[vmi92943:cardano.node.ChainDB:Info:7] [2022-07-10 16:28:21.05 UTC] Replayed block: slot 43199 out of 50157911. Progress: 0.09%

After this the node starts syncing for a while, but all of the sudden it stops, showing the following:
The problem first showed up with cardano-node version 1.34.1 I thought that maybe updating to 1.35.1 would solve the problem, but it didn't.
This output are from 1.35.1 I don't know if the first two issues posted happened in 1.34.1 because I didn't reload the node
[vmi92943:cardano.node.ChainDB:Notice:15464] [2022-07-10 20:45:26.25 UTC] Chain extended, new tip: ffc34e48133acb25d215f4e5bbbbed795439a5b6465e2f16296df0f78bc0d04b at slot 50211725
[vmi92943:cardano.node.ChainDB:Notice:15464] [2022-07-10 20:45:27.86 UTC] Chain extended, new tip: 52be37abf928860cf634c67d234403a0eec60b138fa4cbc6306dad04b12f8588 at slot 50211749
./startRelayNode1.sh: line 9: 429709 Killed                  /home/cardano/.local/bin/cardano-node run +RTS -N -A16m -qg -qb -RTS --topology ${TOPOLOGY} --database-path ${DB_PATH} --socket-path ${SOCKET_PATH} --host-addr ${HOSTADDR} --port ${PORT} --config ${CONFIG}

I runned everything again and I noticed this warning
[vmi92943:cardano.node.shutdown:Warning:7] [2022-07-10 20:44:12.01 UTC] Will terminate upon reaching NoShutdown

How much free diskspace do you have on the chain DB volume (try df -h), and how much RAM and swap space (try free -h)? The mainnet chain DB is about 70GB at the moment and 16GB of RAM is needed.

I have enough disk space currently using arround 40 gb. I have an 150gb of storage. I have 8gb of RAM. I decided to use 8gb instead of 16gb because I read about many SPOs that are doing well with 8gb of RAM

How much swapspace do you have? If sticking with 8GB of RAM make sure you have a good amount of swapspace allocated eg 10GB. Cardano-node at times will use more than 8GB of RAM and then use the swapspace.
While your chain is syncing run top or free -h to monitor RAM and swap usage.

I have been watching RAM usage and it never reaches te point where it need to make use of swap. I am planing on reinstalling the entire node, can you confirm to me the ideal version of cardano-node for mainnet?

Yeah that's probably a good idea. In terms of versions I would go straight to 1.35.0. Version 1.34.1 is stable but will require a few hours of chain work when moving to 1.35.0, so you can avoid that down time. I updated my pool to 1.35.0 recently and things look stable. There will likely be a 1.35.1 but that should just be a code update, no chain/DB changes.

I totally misread the output of top and free -h. I don't have swap on my system. I'll implement it and then I'll tell you about my results. Thanks.

Ok great - that will be the root cause.

It seems to be working correctly now. Thank you so much.

No problem, glad it's working for you.

Summary of comments:
System with 8GB of RAM and no swap space defined, so the process would run out of memory and terminate.
Swap space will be set up (10GB) and things should be ok.

Be aware that while swap space may allow the node to run, if its hitting swap space because there is not enough RAM, it will be slower than it if was just in RAM. For a regular node this may not be a problem, but for a block producer, the poorer performance may result in lost slot battles.


text:
Using Blockfrost api to get the price of an ada/token pair on Minswap
Can I use the Blockfrost API to query a pair that is on the Minswap DEX?

I am trying to use this adapter and the ts is not working in excell. I have installed the npm tho. It is not using the adapter so whats another way to query?

Yes, there should be a way to query a pair which is listed on Minswap via API.
I attached a github link to the adapter.
https://github.com/minswap/blockfrost-adapter

Thank you for your response, and the link to that repo as well.
I am trying to check from a web hook setup in blockfrost though - I receive a request from the blockfrost webhook and want to use the api there, on the server side to query the pair...the adapter you referenced assumes use of a client-side nuget/lib?

Sorry for the late response. To be honest, I just get started to start coding, so I can't really answer your quenstion for sure, but I assume it's a client-side lib.


text:
How Do You Convert Math Symbols in Haskell?
So i heard you can use denotational semantics to write Haskell code using math notation for example circle in place of . to denote function composition. My question is in four parts:

how do I use/write this into my code?
how is the conversion between the two handled?
does this come with time or security concerns?
does this still compile to plutus-core correctly?

By using . you are already using denotational semantic

In computer science, denotational semantics (initially known as mathematical semantics or Scott–Strachey semantics) is an approach of formalizing the meanings of programming languages by constructing mathematical objects

(source)
in fact the . aims to emulate the function composition operator in math ( ∘, used as g  ∘  f to indicate a function that acts as g(f(x)) ).
with that being said there are still your question to answer to:
how do I use/write this into my code?
in Haskell is as simple as:
circle :: ( b -> c ) -> ( a -> b ) -> ( a -> c )
circle = (.)

how is the conversion between the two handled?
being Haskell lazy-evaluated, when you get to the point of calling
circle g f

it will be substituted to
(.) g f

which is equivalent to
g . f

does this come with time or security concerns?
no security concerns, this is all handled by haskell.
does this still compile to plutus-core correctly?
as long it is {-# INLINEABLE circle #-} it doesn't comes to my mind a reason why it wouldn't


text:
Why do Binance stake pools pledge nothing?
Binance runs 62 pools close to saturation. See AdaPools: https://adapools.org/groups/binance-20. But I am more surprised that every one of them has only 2 ADA in pledge! I am confused why Binance does this since nothing-at-pledge pools are supposed to only earn 77% of fully-pledged pools' rewards. Binance isn't dumb (or so I think) and they have dominated staking for a while, so they should know this better than me. If there's any technical reason behind this, could someone share them so we can better run our own pools? Thank you.
Edit: most Binance pools only have 5 to 10 delegators: https://cexplorer.io/groups/binance though all of them are public pools. In addition, they are promising 15% yields on Cardano so they are probably using a custom system anyway.
Related questions:

Why do Binance run 62 pools if it is an exchange?
Are there any negative effects of having too many stake pools run by central exchanges?

DISCLAIMER: There is no official statement from Binance on that topic, so I can only speculate.

Binance is running (similar to other big exchanges) a very large amount of pools. To be able to provide a meaningful pledge on all of them, they would have to hold a large amount of ADA. This would expose them to the risk of market volatility and also lock a substantial amount of funds that they can't use for anything else.
They can't increase the pledge on some of the pools without increasing it on all of the pools, because this would be unfair for their customers. (Some get better rewards, some worse).
Therefore I think the only logical thing to do for Binance (or other big staking providers) is to simply accept that the pools are earning less than the maximum amount of rewards. They still earn more than enough for it to be a profitable business due to the large amount of controlled stake. The people coming short are their customers, but they are probably not aware of this.
Another option would be to take the pools private (100% margin fee) and distribute the rewards using their own custom system. But this would increase the operational cost.

Thank you! I did my own research, and most Binance pools only have 5 to 10 delegators: https://cexplorer.io/groups/binance though all of them are public pools. In addition, they are promising 15% yields on Cardano so I think they are indeed using a custom system.


text:
How Will the Atala Plutus Integration Work?
I know that Atala prism will be used as the basis of Cardanos DiD but whenever I ask someone how it will work with Plutus, I end up hearing some new infrastructure needs to be built out.
My question is what is this infrastructure and how will it work with Plutus.


text:
Upload Smartcontract to Blockchain
I've seen a tutorial where a smart-contract was uploaded to Cardano Blockchain using cardano-cli, so I would like to do the same thing using plutus PAB. How would I do that? The tutorial on lecture 6 from PPP only shows using a local machine, don't show how to do it in a blockchain.

PAB stands for Plutus Application Backend and as a backend is nothing more than a server responding to requests.
The PAB takes care of smart contract interaction through the creation of transactions.
Onchain we have scripts that lock outputs with logic. The scripts have a corresponding address linked to the hash of the script. When someone tries to spend an output at this address, the script has to evaluate to true given its inputs. In the PAB a contract comprises the logic on how to construct a transaction given one or more scripts. In general, we thus do not call it deploying the contract, since it lives off-chain.
A good thing to remember is that transactions in Cardano have no side effects, they are pure and deterministic in their behavior. Because Cardano uses the eUTxO model, wallets have to build transactions where in account model blockchains function call can be made that perform an action that might give access to all your funds.
So, to interact with a script, you just have to send funds to the corresponding script address and spend it according to the logic of it. It doesn't matter whether these transactions are constructed using the client, the PAB or even using JavaScript in the browser, the choice is yours. As to how to use the PAB for this, take a look at (1).

Before the Vasil HF (and without script references), there is no real deployment of smart contracts.
The way it works is that you can create outputs at your contract script address just like Michele described - by sending funds to the contract address.
But spending those outputs requires to supply the script to be attached to the transaction. It will be ran to validate if spending from that address is valid or not.
Until we don't have script references (Vasil HF) this is the process of using plutus scripts. Once, script references are available you can actually upload your Plutus script to the chain and are not required to attach it for every following spending transaction.
More information can be found here.


text:
Unlocked NFT minting policy
I want to create a collection of NFTs with unlimited supply. This way one NFT gets minted every time someone buys one. I don't need a limited supply because I want these NFTs to work as a "member ID" for a particular platform (I don't want a limited amount of users).
I understand that the minting policy will be unlocked for eternity.
What I am wondering right now is what happens with the security of the keys in this particular case: with locked minting policy NFTs this is not a risk, because if a malicious actor gets access to those keys, he/she won't be able to mint or burn any token.
What happens in this case? How can I assure a decent level of security if I want to build a server that will manage the minting of these member NFTs?
I think that this question can also be related to this other one, that hasn't received an answer yet: What is the best (and most secure) way to store private keys in an Express server?

If you want to add security to this setup, you might want to consider using a multi signature setup. Say, for example, a 3 out of 5 signatures are needed. Then an adversary needs to retrieve at least 3 keys to break the security of the minting policy. If you keep the keys on different machines, it's harder to break the security.
In addition, another excellent way is to use a hardware wallet for signing. This keeps the signing keys offline and never loads them on a computer.
It all a question about how far you want to go with security and how good do you implement the security.
In general, when you have signing keys on your machine, always store them encrypted with, for example, GnuPG. In this case, even if the machine is compromised the keys might not.
What kind of logic is necessary for a user to get access to such a platform? If this is paying you an x amount of ada this can be implemented with plutus scripts, this adds another layer of security.

Thanks for your answer. It is pretty clear to me so I marked it as accepted. I understand that the best way to store keys when they need to be in a server is with encryption. What I don't get about this approach is that, to encrypt something, you need a phrase or password, right? So, to decrypt the key, you'll need access to this phrase or password. What happens then with the security of this information? What should I do?

Good question, in general, this password is in your head and is only used when you want to sign a transaction with the signing key. You use a GnuPG command that temporarily unencrypted the skey file with your password.


text:
Programmatically Send Transactions From a Wallet Using Javascript
I am building an application that has a hot wallet that stores ADA that my user has deposited. After some business logic is met, I want to transfer funds from my hot wallet to another address. How do I programmatically send ADA from my wallet to another user? I am currently using the Cardano-serialization-library but it prompts you to enter your password into your wallet extension for the transactions to go through. How do I programmatically send transactions from my wallet to my user without putting in a password in my wallet extension? My application is built on MERN stack so it needs to be in JavaScript.

If you already hold access to wallet private keys, you dont need to "interact" with a wallet extension, you already have all you need to derive the keys, addresses, fetch inputs from query layer of your choice and then construct/submit transaction.
If - instead - you're interacting via extension to access user's wallet, doing it without user prompt should NOT be possible unless using an insecure wallet with bad practices (i.e. either does not care about user security to authorize transactions OR allows bulk mode of transactions to be allowed at once, both of which can be easy targets for scam).


text:
Why not just simply use Haskell instead of Plutus?
I can think of two major reasons as to why Cardano chose a strongly-typed functional language for it's Blockchain:

Strongly-typed - because as the capabilities of the Blockchain and scripts become more powerfull, type safety is a must-have to ensure determinism and security.
Functional - because it adapts very well with the UTXO design.

So my question is doesn't Haskell already fit the bill? Why is the Plutus library, its intermediary representations and Plutus Core even needed?

Haskell is a lazy language, this allows for infinite data structures. Onchain this is a hazard since it opens the door to attacks, you want a strict language to keep things deterministic.

For more hava a look at https://youtu.be/xWlUrq0y4JY?t=790

There are many reasons. For example:

You need tooling for the communication between the on-chain and the off-chain code and many other tasks.
You need tooling that generates code where the on-chain code is quite specific. You can't use the regular machine code that the Haskell compiler gives you and run it on the blockchain.
With a language so versatile as Haskell, you can write extremely complex code. This is great in some settings, but with smart contracts, it increases the chances of error.

Those are some of the issues that you don't have to deal with because of Plutus:

Plutus provides a lot of infrastructure developers would have to create themselves if they'd just use naked Haskell. So it saves effort and makes it easier to develop smart contracts.
It limits the library interfaces available to developers making it straightforward for them to write secure and performant code.
In the blockchain, you want a code format that is designed to be easy to reason about, closely implements the mathematical specification, and allows you to be confident that it's correctly implemented. That's why we have Plutus Core.

Sources:

IOHK Language Architect - Manuel Chakravarty Interview
Keynote talk by Manuel Chakravarty: Plutus - Functional Smart Contracts on Cardano

awesome answer, I would also cite the need for reduced set of instructions so that it is possible to reduce the effective size of the serialized smart contract on-chain

Do you have a source for that?

Eager vs Lazy Evaluation
Haskell is used for programs that require a high degree of formal verification. That's why both off-chain and on-chain code for Cardano is written in Haskell. Plutus is visually similar to Haskell, but unlike Haskell, the language is Eagerly Evaluated.
4 widely available Haskell's implementations – GHC, NHC98, Hugs98, and HBC compilers – all use lazy evaluation. That was the core reason to launch a new language for smart contracts' developers.
The second reason is: on Plutus platform, GHC compiles the off-chain code, while the Plutus compiler compiles the on-chain code. Third reason is quite obvious: the complexity of Plutus is much lower than that of Haskell.


text:
How did SundaeSwap solve the scalability issue associated with consuming the same UTxO more than once in the same block?
I know that this was a very hot topic when SundaeSwap came out.
How did the team solve this?

A good thing to remember when developing on Cardano is that there exists no global state! The state and its history of the blockchain is captured in a graph, where the current state of the chain are the outer leafs of this graph.
This above structure allows the blockchain to process transactions that append to this graph to be highly concurrent. The only problem is, once a leaf has left the current state and has become history, then other transaction cannot use it anymore. This latter is the misnamed “concurrency problem”. I call this misnamed, since the whole ledge is as concurrent as it can be. With only local state, you thus have to design your protocols accordingly, an EVM style approach (which relies on a global state) is not possible.
In the most common dexes liquidity is provided via a liquidity pool. This is a centralized piece of data that stores the information about the state. When a transaction utilized this pool, it needs to know the entire state of that pool. On Cardano, this thus has to be represented in a single unspent transaction output, no way around that. But since every transaction consumes this output and pushes it to the history of the graph creating a new location for the state of the pool, other transaction that try to utilize it as well lose track of its location. This means that only one transaction per block can trade with the pool.
To overcome this, we introduce a waiting line of outputs that want to interact with this pool. Then each block, these waiting transactions are combined to create multiple trades with the same pool in one transaction. This solves the problem.
For more information see (1)
This picture helps visualize the graph, here the E, F, G, H, I are leafs (these are nodes without any children) representing the current state of the blockchain. The rest of the nodes are already consumed outputs in the past.


text:
How Does the Blockchain Use Hashes?
Hash functions are often called one way functions however this means that you should not be able to undo them. So why and how are SHA256 and SHA512 used in blockchains if they should be irreversible.
Also I noticed that Plutus has some unhasing functions how do these work?

The hash function in plutus is also a one-way function. I think that the unHash function that is meant here is the type constructor of a Hash type. unHash serves here to unwrap the type to, probably, a builtinByteString. Can you point to this unHash function?

The Cardano code does not use SHA256 or SHA512, but rather uses 2 different versions of the Blake2 hash functions (but Plutus may use SHA hashes).
Hash functions are used in several places. Two simple examples are block ids (ie the hash of the block) and transaction ids (the hash of the transaction). For these two examples reversing the hash is never needed.
I am almost certain that the Plutus "unhashing" function you see is just the accessor for the newtype wrapper (its a Haskell/Plutus thing).

Cardano does not use SHA256 hashing. There are BLAKE2b cryptographic hashing algorithms in Cardano, and the following table represents three of them:

Hashing Algorithm
Referred as
Used for

BLAKE2b-224
hash28
Verification keys and multi-signature scripts

BLAKE2b-256
hash32
Used everywhere else in Cardano

BLAKE2b-512
hash64
Used for key derivations


text:
Get Ada locked with asset from db-sync query?
Does anybody know a way to get the locked asset Ada/tAda information from db-sync? identical to the information displayed in Nami wallet?

I've tried looking at all the tables, but nothing seems to hold this value.
could this value be calculated some other way by combining or summing? any help is very much appreciated.

All native asset transactions are associated with an ADA transaction. The ADA transaction has a transaction id, and it is probably a way to track locked asset by looking at the ADA transaction id.

@ErikdeCastroLopo Thanks for your suggestion, although I'm sadly still stuck on this issue. I created a new question here https://cardano.stackexchange.com/questions/8703/can-anyone-explain-how-tada-locked-with-asset-is-calculated because a more confusing problem came up surrounding locked tAda with assets. thanks again!


text:
Chain index stop syncing after slot 62510369, maybe related with new Babbage era
Chain index is not syncing in tesnet after Slot: 62510369,
BlockId: d931221f9bc4cae34de422d9f4281a2b0344e86aac6b31eb54e2ee90f44a09b9
I converted to POSIX TIME and is: Friday, 22 July 2022 8:19:45.999 AM, related with the time frame of the new babbage era.
I download and built the latest plutus apps (commit 139c0429f2c7a656ff6114e6373f895d29132860) and syncing from zero again with no success.
Im using with cardano-node-1.35.0-linux which is syncing 100%.
There was similar issues with cardano-db-sync and they said they fix the issue there.
https://github.com/input-output-hk/cardano-db-sync/issues/1181
https://github.com/input-output-hk/cardano-db-sync/issues/1182
Here also, some report about the chain index rolling back slots after this slot:
https://github.com/input-output-hk/plutus-apps/pull/557
Any idea?
Im Running in WSL2 with Ubuntu.
The message from chain index is:
[chain-index:Info:33] [2022-07-17 01:06:05.64 UTC] Syncing (98.21%). Processed 0 blocks, 1 rollbacks in the last 12s. Current tip is Point(Slot 62510369, BlockId d931221f9bc4cae34de422d9f4281a2b0344e86aac6b31eb54e2ee90f44a09b9)
Here is full detaiuled run of chain index with verbose:
Command line config:
AppConfig {acLogConfigPath = Nothing, acMinLogLevel = Just Debug, acConfigPath = Just "/home/manuelpadilla/source/cardano-falcon-stakepool-devs/cardano-falcon-stakepol-devs-haskell/files/config/cardano-chain-index/chain-index-config.json", acCLIConfigOverrides = CLIConfigOverrides {ccSocketPath = Nothing, ccDbPath = Nothing, ccPort = Nothing, ccNetworkId = Nothing, ccAppendTransactionQueueSize = Nothing}, acCommand = StartChainIndex}

Logging config:
Representation {minSeverity = Debug, rotation = Nothing, setupScribes = [ScribeDefinition {scKind = StdoutSK, scFormat = ScText, scName = "stdout", scPrivacy = ScPublic, scRotation = Nothing, scMinSev = Debug, scMaxSev = Emergency}], defaultScribes = [(StdoutSK,"stdout")], setupBackends = [KatipBK,AggregationBK,MonitoringBK,EKGViewBK], defaultBackends = [KatipBK,AggregationBK,EKGViewBK], hasEKG = Just (Endpoint ("localhost",12790)), hasGraylog = Nothing, hasPrometheus = Nothing, hasGUI = Nothing, traceForwardTo = Nothing, forwardDelay = Nothing, traceAcceptAt = Nothing, options = fromList []}

Chain Index config:
Socket: /home/manuelpadilla/source/tools/cardano-node-1.35.0-linux2/db/node.socket
Db: /home/manuelpadilla/source/tools/cardano-chain-index/chain-index.db
Port: 9083
Network Id: Testnet (NetworkMagic {unNetworkMagic = 1097911063})
Security Param: 2160
Store from: BlockNo 0
Append transaction queue size: 500

The tip of the local node: SlotNo 63654709
Connecting to the node using socket: /home/manuelpadilla/source/tools/cardano-node-1.35.0-linux2/db/node.socket
[chain-index:Debug:11] [2022-07-17 02:13:00.78 UTC] BeamLogItem: SqlLog: SELECT "t0"."row_slot" AS "res0", "t0"."row_block_id" AS "res1", "t0"."row_block_number" AS "res2" FROM "tips" AS "t0" ORDER BY "t0"."row_slot" DESC;
-- With values: []
Starting webserver on port 9083
A Swagger UI for the endpoints are available at http://localhost:9083/swagger/swagger-ui
[chain-index:Debug:33] [2022-07-17 02:13:02.79 UTC] BeamLogItem: SqlLog: DELETE FROM "tips" WHERE ("row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:02.79 UTC] BeamLogItem: SqlLog: DELETE FROM "utxo_out_refs" WHERE EXISTS (SELECT "t0"."output_row_tip__row_slot" AS "res0", "t0"."output_row_out_ref" AS "res1" FROM "unspent_outputs" AS "t0" WHERE (("t0"."output_row_tip__row_slot")>(?)) AND (("row_out_ref")=("t0"."output_row_out_ref")));
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:14.08 UTC] BeamLogItem: SqlLog: DELETE FROM "unspent_outputs" WHERE ("output_row_tip__row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:14.08 UTC] BeamLogItem: SqlLog: DELETE FROM "unmatched_inputs" WHERE ("input_row_tip__row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:14.08 UTC] BeamLogItem: SqlLog: SELECT "t0"."output_row_tip__row_slot" AS "res0", "t0"."output_row_out_ref" AS "res1" FROM "unspent_outputs" AS "t0";
-- With values: []
[chain-index:Debug:33] [2022-07-17 02:13:14.79 UTC] BeamLogItem: SqlLog: SELECT "t0"."input_row_tip__row_slot" AS "res0", "t0"."input_row_out_ref" AS "res1" FROM "unmatched_inputs" AS "t0";
-- With values: []
[chain-index:Debug:33] [2022-07-17 02:13:14.86 UTC] BeamLogItem: SqlLog: SELECT "t0"."row_slot" AS "res0", "t0"."row_block_id" AS "res1", "t0"."row_block_number" AS "res2" FROM "tips" AS "t0" ORDER BY "t0"."row_slot" ASC;
-- With values: []
[chain-index:Debug:33] [2022-07-17 02:13:15.85 UTC] BeamLogItem: SqlLog: DELETE FROM "tips" WHERE ("row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:15.86 UTC] BeamLogItem: SqlLog: DELETE FROM "utxo_out_refs" WHERE EXISTS (SELECT "t0"."output_row_tip__row_slot" AS "res0", "t0"."output_row_out_ref" AS "res1" FROM "unspent_outputs" AS "t0" WHERE (("t0"."output_row_tip__row_slot")>(?)) AND (("row_out_ref")=("t0"."output_row_out_ref")));
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:27.56 UTC] BeamLogItem: SqlLog: DELETE FROM "unspent_outputs" WHERE ("output_row_tip__row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:27.56 UTC] BeamLogItem: SqlLog: DELETE FROM "unmatched_inputs" WHERE ("input_row_tip__row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:27.56 UTC] RollbackSuccess: New tip is Tip(Slot 62510369, BlockId d931221f9bc4cae34de422d9f4281a2b0344e86aac6b31eb54e2ee90f44a09b9, BlockNumber 3680594)
[chain-index:Debug:33] [2022-07-17 02:13:27.56 UTC] BeamLogItem: SqlLog: DELETE FROM "tips" WHERE ("row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Info:33] [2022-07-17 02:13:27.56 UTC] Syncing (98.20%). Processed 0 blocks, 1 rollbacks in the last 11s. Current tip is Point(Slot 62510369, BlockId d931221f9bc4cae34de422d9f4281a2b0344e86aac6b31eb54e2ee90f44a09b9)
[chain-index:Debug:33] [2022-07-17 02:13:27.56 UTC] BeamLogItem: SqlLog: DELETE FROM "utxo_out_refs" WHERE EXISTS (SELECT "t0"."output_row_tip__row_slot" AS "res0", "t0"."output_row_out_ref" AS "res1" FROM "unspent_outputs" AS "t0" WHERE (("t0"."output_row_tip__row_slot")>(?)) AND (("row_out_ref")=("t0"."output_row_out_ref")));
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:39.04 UTC] BeamLogItem: SqlLog: DELETE FROM "unspent_outputs" WHERE ("output_row_tip__row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:39.04 UTC] BeamLogItem: SqlLog: DELETE FROM "unmatched_inputs" WHERE ("input_row_tip__row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:39.04 UTC] BeamLogItem: SqlLog: SELECT "t0"."output_row_tip__row_slot" AS "res0", "t0"."output_row_out_ref" AS "res1" FROM "unspent_outputs" AS "t0";
-- With values: []
[chain-index:Debug:33] [2022-07-17 02:13:39.68 UTC] BeamLogItem: SqlLog: SELECT "t0"."input_row_tip__row_slot" AS "res0", "t0"."input_row_out_ref" AS "res1" FROM "unmatched_inputs" AS "t0";
-- With values: []
[chain-index:Debug:33] [2022-07-17 02:13:39.77 UTC] BeamLogItem: SqlLog: SELECT "t0"."row_slot" AS "res0", "t0"."row_block_id" AS "res1", "t0"."row_block_number" AS "res2" FROM "tips" AS "t0" ORDER BY "t0"."row_slot" ASC;
-- With values: []
[chain-index:Debug:33] [2022-07-17 02:13:40.69 UTC] BeamLogItem: SqlLog: DELETE FROM "tips" WHERE ("row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:40.69 UTC] BeamLogItem: SqlLog: DELETE FROM "utxo_out_refs" WHERE EXISTS (SELECT "t0"."output_row_tip__row_slot" AS "res0", "t0"."output_row_out_ref" AS "res1" FROM "unspent_outputs" AS "t0" WHERE (("t0"."output_row_tip__row_slot")>(?)) AND (("row_out_ref")=("t0"."output_row_out_ref")));
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:52.59 UTC] BeamLogItem: SqlLog: DELETE FROM "unspent_outputs" WHERE ("output_row_tip__row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:52.59 UTC] BeamLogItem: SqlLog: DELETE FROM "unmatched_inputs" WHERE ("input_row_tip__row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:52.59 UTC] RollbackSuccess: New tip is Tip(Slot 62510369, BlockId d931221f9bc4cae34de422d9f4281a2b0344e86aac6b31eb54e2ee90f44a09b9, BlockNumber 3680594)
[chain-index:Info:33] [2022-07-17 02:13:52.59 UTC] Syncing (98.20%). Processed 0 blocks, 1 rollbacks in the last 11s. Current tip is Point(Slot 62510369, BlockId d931221f9bc4cae34de422d9f4281a2b0344e86aac6b31eb54e2ee90f44a09b9)
[chain-index:Debug:33] [2022-07-17 02:13:52.59 UTC] BeamLogItem: SqlLog: DELETE FROM "tips" WHERE ("row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:52.59 UTC] BeamLogItem: SqlLog: DELETE FROM "utxo_out_refs" WHERE EXISTS (SELECT "t0"."output_row_tip__row_slot" AS "res0", "t0"."output_row_out_ref" AS "res1" FROM "unspent_outputs" AS "t0" WHERE (("t0"."output_row_tip__row_slot")>(?)) AND (("row_out_ref")=("t0"."output_row_out_ref")));
-- With values: [SQLInteger 62510369]

I'm not clear on what system you are having a problem with. You mentioned that your cardano-node is 100% synced - is your issue with your local cardano-db-sync? What errors/warnings are you getting in the log file? Share some log details here.

Im not using cardano-db-sync.
The problem is with plutus-app cardano-chain-index, need to run pab.
Im using WSL and ubuntu.
There is not error, just repeting all the time:
[chain-index:Info:33] [2022-07-17 01:06:05.64 UTC] Syncing (98.21%). Processed 0 blocks, 1 rollbacks in the last 12s. Current tip is Point(Slot 62510369, BlockId d931221f9bc4cae34de422d9f4281a2b0344e86aac6b31eb54e2ee90f44a09b9)
Looks like it is doing rollbacks all the new blocks.

cardano-node version 1.35.1 fixes the deserialisation error you mentioned.

Similar to cardano-db-sync references you found, every repo that is interacting with node has to go through updates to be able to read blocks post Vasil H/F.

Here also, some report about the chain index rolling back slots after this slot: https://github.com/input-output-hk/plutus-apps/pull/557

As mentioned in the issue, the work for compatibility with Vasil for plutus-apps is being done in next-node branch, it's not yet ready for PAB and will likely be part of upcoming release.

Perfect! I'll be more patience then! Is it normal to release a new version of the blockchain without all the required updates in the infrastructure around? Node, Wallet, Chain Index, Pab, DB-Sync? All the devs are going to pass by problems if we do the other way around. Some products could be in production, and they are going to stop working... don't you think?

The release being marked on node does not make it ready for mainnet, it's why they did not go for fork on mainnet yet. Currently, node/wallet/dbsync have Vasil ready versions already


text:
Smart contract is not working after Vasil Hardfork in testnet
My smart contracts deployed in testnet stoped working after the Vasil Hardfork. i get this error:

""transaction submit error ShelleyTxValidationError
ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure
(FromAlonzoUtxowFail (WrappedShelleyEraFailure
(ExtraneousScriptWitnessesUTXOW (fromList [ScriptHash
"84017e78c2e887e8fac3fdf270110464aebd67f9cfc73453714b62f6"])))),UtxowFailure
(FromAlonzoUtxowFail (WrappedShelleyEraFailure
(MissingScriptWitnessesUTXOW (fromList [ScriptHash
"9e9807f4d1532b1f6853ad9e9cbea957727c8c0c3b5e89fae60961f9"])))),UtxowFailure
(FromAlonzoUtxowFail (NonOutputSupplimentaryDatums (fromList [SafeHash
"1c48b6a92c64e2c4ac4408620c5a33df9a456b0e58ed422cc7eee51f5ee356b3"])
(fromList [SafeHash
"07e6205f926822d79c530e7e331de123d9050c44afe292a0167fdc9fa943a481"]))),UtxowFailure
(FromAlonzoUtxowFail (ExtraRedeemers [RdmrPtr Spend 24])),UtxowFailure
(FromAlonzoUtxowFail (PPViewHashesDontMatch (SJust (SafeHash
"9835cece923eb8a48e0018bb9ad0901aea26b0575a64a15df1817328ef466620"))
(SJust (SafeHash
"3f52ec17e7d530f1730cc6d5c3bb83f397af30ed16ece7af1fc4314f2ab2d36b"))))])""

I think that the relevant part is

PPViewHashesDontMatch (SJust (SafeHash
"9835cece923eb8a48e0018bb9ad0901aea26b0575a64a15df1817328ef466620"))
(SJust (SafeHash
"3f52ec17e7d530f1730cc6d5c3bb83f397af30ed16ece7af1fc4314f2ab2d36b"))))])"

wich has to do with Protocol Parameters, I am using Cardano serialization Lib. and I use 10.04 and I think the problem might be in my cost models now:
const cost_model_vals = [

197209, 0, 1, 1, 396231, 621, 0, 1, 150000, 1000, 0, 1, 150000, 32, 2477736,
29175, 4, 29773, 100, 29773, 100, 29773, 100, 29773, 100, 29773, 100, 29773,
100, 100, 100, 29773, 100, 150000, 32, 150000, 32, 150000, 32, 150000, 1000,
0, 1, 150000, 32, 150000, 1000, 0, 8, 148000, 425507, 118, 0, 1, 1, 150000,
1000, 0, 8, 150000, 112536, 247, 1, 150000, 10000, 1, 136542, 1326, 1, 1000,
150000, 1000, 1, 150000, 32, 150000, 32, 150000, 32, 1, 1, 150000, 1, 150000,
4, 103599, 248, 1, 103599, 248, 1, 145276, 1366, 1, 179690, 497, 1, 150000,
32, 150000, 32, 150000, 32, 150000, 32, 150000, 32, 150000, 32, 148000,
425507, 118, 0, 1, 1, 61516, 11218, 0, 1, 150000, 32, 148000, 425507, 118, 0,
1, 1, 148000, 425507, 118, 0, 1, 1, 2477736, 29175, 4, 0, 82363, 4, 150000,
5000, 0, 1, 150000, 32, 197209, 0, 1, 1, 150000, 32, 150000, 32, 150000, 32,
150000, 32, 150000, 32, 150000, 32, 150000, 32, 3345831, 1, 1,
];
Then :
const costModel = wasm.CostModel.new();
cost_model_vals.forEach((x, i) => costModel.set(i, wasm.Int.new_i32(x)));

const costModels = wasm.Costmdls.new();
costModels.insert(wasm.Language.new_plutus_v1(), costModel);

const scriptDataHash = wasm.hash_script_data(redeemers, costModels, datums);
txBody.set_script_data_hash(scriptDataHash);

Now all my smart contracts do not work anymore.. has anyone solved this issue in CSL ?

You probably need to update your version of the Serialization Lib, the latest currently is 11.0.0-rc.6 (on npm here).
Plenty of changes making it babbage compatible: https://github.com/Emurgo/cardano-serialization-lib/pull/478

I’ll 10/10 recommend bringing this up to the IOG discord in case it turns out to be the effect of some breaking change somewhere. Probably best to ping Becky Hopwood, she’s the Technical community lead in the discord and responds super fast.

Already asked there, i will try to look for Becky Hopwood as you suggested, thank you!

PPViewHashesDontMatch error means that Protocol Parameters hash does not match. Simply deleting your old protocol.json and replacing it with a new one (babbage era) should solve the problem.
cardano-cli query protocol-parameters --testnet-magic 1097911063

I am afraid in CSL is a little bit more difficult than in Cli. But i hope i can post an answer with detailed code in the next hours.. just in case it helps someone else

For solving the issue: Update CSL to 11 then change pp code with this one:
    const costModel = wasm.TxBuilderConstants.plutus_vasil_cost_models().get(
  wasm.Language.new_plutus_v1()
);

const costModels = wasm.Costmdls.new();
costModels.insert(wasm.Language.new_plutus_v1(), costModel);

const scriptDataHash = wasm.hash_script_data(redeemers, costModels, datums);
txBody.set_script_data_hash(scriptDataHash);

have you solved the issue? After the HF the cardano-cli transaction build command should include --babbage-era. Adding this, I was able to spend smart contract utxo.

Yes I solved using the code i auto answered :) and updating to CSL 11


text:
Is there a way using the cardano emulator trace to stop loging all the Contract logs?
Im using the trace emulator, but the debug info that I print in the terminal using logInfo is completly lost in middle of hundreds of lines of contract logs made automaticaly by the emulator.
There is a way to set the level of verbose?
Here is an example how it looks:
Slot 00104: *** CONTRACT LOG: "CALCULATED Rewards: 3000000"
Slot 00104: 00000000-0000-4000-8000-000000000002 {Wallet Wc30e}:
Contract log: Object (fromList [("mkTxLogLookups",Object (fromList [("slMPS",Array [Array [String "5abd1e1ba79c8ea981f2949126e186c1709b1c0a118be2a11648a3a8",Object (fromList [("getMintingPolicy",String "5908c0010000332332233322232323322332232323332223233322232333333332222222232333222323333222232323322323332223232323322332232323333322222332233223322332233223322332222232325335302f332235300a0012235300e002222222222233335302200b203f2333553059120013233505f223335350180032200200200135350160012200133501622533530400021042100103f235302b35301c0012200122235303000322335305500220462333573466e3c00406c11c11802c80fc80fccccd5cd19b8735573a6ea801120002047232635304633573809408e08a0886666ae68cdc39aab9d5002480008cc028c8c8c8c8c8c8c8c8c8c8c8cccd5cd19b8735573aa01490001199999999980c19a813119191999ab9a3370e6aae754009200023301e303635742a00460566ae84d5d1280111931a982b19ab9c05a057055054135573ca00226ea8004d5d0a80519a8130139aba150093335502d75ca0586ae854020ccd540b5d728161aba1500733502603f35742a00c66a04c66aa0a0090eb4d5d0a8029919191999ab9a3370e6aae754009200023350203232323333573466e1cd55cea80124000466a05066a07ceb4d5d0a80118219aba135744a004464c6a60b466ae7017816c1641604d55cf280089baa00135742a0046464646666ae68cdc39aab9d5002480008cd4098cd40f9d69aba150023043357426ae8940088c98d4c168cd5ce02f02d82c82c09aab9e5001137540026ae84d5d1280111931a982b19ab9c05a057055054135573ca00226ea8004d5d0a80219a8133ae35742a00666a04c66aa0a0eb88004d5d0a801181a9aba135744a004464c6a60a466ae7015814c1441404d5d1280089aba25001135744a00226ae8940044d5d1280089aba25001135744a00226ae8940044d55cf280089baa00135742a0046464646666ae68cdc3a800a400c4603a606e6ae84d55cf280191999ab9a3370ea00490021180e18209aba135573ca00846666ae68cdc3a801a40044603860586ae84d55cf280291999ab9a3370ea00890001180f9bae357426aae7940188c98d4c134cd5ce02882702602582502482409aab9d5001137540026ae84d5d1280111931a982319ab9c04a0470450441046132635304533573892010350543500046044135573ca00226ea800448848cc00400c008480048848cc00400c0088004888888888848cccccccccc00402c02802402001c01801401000c00880048848cc00400c008800448848cc00400c0084800448848cc00400c0084800448848cc00400c00848004848888c010014848888c00c014848888c008014848888c004014800448c88c008dd6000990009aa81c111999aab9f00125038233503730043574200460066ae880080c08c8c8c8cccd5cd19b8735573aa006900011998039919191999ab9a3370e6aae754009200023300d302e35742a00466a0200546ae84d5d1280111931a981a19ab9c038035033032135573ca00226ea8004d5d0a801999aa805bae500a35742a00466a018eb8d5d09aba25002232635303033573806806205e05c26ae8940044d55cf280089baa00122212333001004003002200122123300100300220011335500175ceb44488c88c008dd5800990009aa81911191999aab9f002250332335032335502e300635573aa004600a6aae794008c010d5d100181589aba100112232323333573466e1d400520002350083005357426aae79400c8cccd5cd19b87500248008940208c98d4c0a8cd5ce01701581481401389aab9d500113754002242446004006224400224002464646666ae68cdc39aab9d5002480008cc018c01cd5d0a8011bad357426ae8940088c98d4c090cd5ce01401281181109aab9e50011375400244246600200600440024646666ae68cdc39aab9d5001480008dd71aba135573ca004464c6a604066ae7009008407c0784dd500089119191999ab9a3370ea00290021280391999ab9a3370ea004900111a80518031aba135573ca00846666ae68cdc3a801a40004a014464c6a604666ae7009c09008808408007c4d55cea80089baa00112122230030041122200211222001120012323333573466e1d40052002200623333573466e1d400920002006232635301b33573803e03803403203026aae74dd50008910010910009000919191919191999ab9a3370ea0029006100591999ab9a3370ea0049005100691999ab9a3370ea00690041198059bae35742a00a6eb4d5d09aba2500523333573466e1d4011200623300d375c6ae85401cdd71aba135744a00e46666ae68cdc3a802a400846602460286ae854024dd71aba135744a01246666ae68cdc3a8032400446028602a6ae84d55cf280591999ab9a3370ea00e900011809980b1aba135573ca018464c6a604066ae7009008407c07807407006c0680640604d55cea80209aab9e500

I figured it out...
You can configure it with the 2nd parameter, TraceConfig, on the call runEmulatorTraceIO'.
https://play.marlowe-finance.io/doc/haddock/plutus-contract/html/Plutus-Trace-Emulator.html#t:TraceConfig
There you can put on the traceConfigMinLogLevel field MonadExtras.Info to Log only debug level info.
traceConfig = TraceEmulator.TraceConfig
  {
    traceConfigShowEvent = traceConfigShowEventExample,
    -- ^ Function to decide how to print the particular events.
    traceConfigOutputHandle = SystemIO.stdout, -- withFile "/tmp/trace-log.txt" WriteMode $ \h -> h
    -- ^ Where to print the outputs to. Default: 'System.IO.stdout'
    traceConfigMinLogLevel = MonadExtras.Info
    -- Debug
    -- Info
    -- Notice
    -- Warning
    -- Error
    -- Critical
    -- Alert
    -- Emergency
  }

traceConfigShowEventExample :: MonadExtras.LogMessage WalletEmulatorTypes.EmulatorEvent -> Maybe P.String
traceConfigShowEventExample (MonadExtras.LogMessage _minLogLevel (WalletEmulatorTypes.EmulatorTimeEvent slot e)) =
    let logMsgMaybe = case e of
          WalletEmulatorMultiAgent.UserThreadEvent (TraceEmulatorTypes.UserLog msg) ->
              Just $ "*** USER LOG: " <> msg
          WalletEmulatorMultiAgent.InstanceEvent (TraceEmulatorTypes.ContractInstanceLog (TraceEmulatorTypes.ContractLog (DataAeson.String msg)) _ _) ->
              Just $ "*** CONTRACT LOG: " <> P.show msg
          WalletEmulatorMultiAgent.InstanceEvent (TraceEmulatorTypes.ContractInstanceLog (TraceEmulatorTypes.StoppedWithError err)       _ _) ->
              Just $ "*** CONTRACT STOPPED WITH ERROR: " <> P.show err
          WalletEmulatorMultiAgent.InstanceEvent (TraceEmulatorTypes.ContractInstanceLog TraceEmulatorTypes.NoRequestsHandled            _ _) ->
              Nothing
          WalletEmulatorMultiAgent.InstanceEvent (TraceEmulatorTypes.ContractInstanceLog (TraceEmulatorTypes.HandledRequest _)           _ _) ->
              Nothing
          WalletEmulatorMultiAgent.InstanceEvent (TraceEmulatorTypes.ContractInstanceLog (TraceEmulatorTypes.CurrentRequests _)          _ _) ->
              Nothing
          WalletEmulatorMultiAgent.SchedulerEvent _ ->
              Nothing
          WalletEmulatorMultiAgent.WalletEvent _ _ ->
              Nothing
          ev ->
              Just . Prettyprinter.renderString . Prettyprinter.layoutPretty Prettyprinter.defaultLayoutOptions . Prettyprinter.pretty $ ev
        paddedSlotNo = pad 5 (Ledger.getSlot slot)
     in fmap (\m -> "Slot " <> paddedSlotNo <> ": " <> m) logMsgMaybe
 where
    pad :: P.Int -> Integer -> P.String
    pad n = (\x -> P.replicate (n P.- P.length x) '0' ++ x) . P.show

I also find the emulator trace way to verbose, so I prefer to use the pab simluator that has much better and concise debugging info.  For info to run the simulator with working code you can check out my repository here:
https://github.com/lley154/cardano-lottery#developer-testing

Thanks! Ill take a look! Sounds promising. I''ll mark this as an answer if it works as you said! I'm taking a look at your code.

it opens me a world using the pab simulator inspired in your code! thank you :)

great to hear it was helpful!


text:
Importing Ledger hardware wallet addresses to Nami
I'm having issues importing and seeing my Ledger hardware wallet addresses with Nami. I would be interested to know if anyone else is in a similar situation to the one described below and if they have found a solution to this problem.
I set up my Yoroi wallet with my Ledger hardware wallet and, after setting it up in the default way, which created one address, I then manually got Yoroi to create a 2nd address.
So I now had two addresses on my Yoroi wallet that were both integrated with my
Ledger and could only be used through that.
I recently tried using a DApp that doesn't support Ledger-integrated Yoroi wallets but does support Nami, so I tried to set up Nami to use those same two ADA addresses that I had originally set up on my Ledger wallet. So I went to Nami -> Connect Hardware Wallet and was then prompted to select the accounts that I wanted to add. I was given the option to add "Account 1 - Default", in addition to 49 other accounts, all numbered sequentially from 2 to 50. I added all 50 accounts.
I noticed that my 1st ledger-integrated Yoroi address was imported across to Nami as "Account 1 - default", however my 2nd Yoroi wallet address wasn't imported into Nami as Account 2 or any other of the 48 accounts that were set up. It seems that Account 2 to Account 49 were just new addresses that Nami had generated. I couldn't see my 2nd Yoroi wallet address anywhere in the Nami wallet.
When connecting my Nami wallet to the DApp, if I connect using Account 1 (i.e. my 1st Yoroi/Ledger address that I imported across to Nami) then I don't experience any issues and the DApp correctly shows the connected address.
My issue is this however: I can't get Nami to see the 2nd address that I set up on my Yoroi wallet. For some reason, I can't seem to get Nami to import this address too.
This person seems to have a similar problem - https://forum.cardano.org/t/restoring-nami-wallet-restored-wallet-with-different-address-and-0-funds/86632/130?page=4. Although in his case, he isn't using a hardware wallet, the similarity is that he is only able to restore the first address of his wallet on Nami using his seed phrase and the 2nd one is not appearing at all.
I've tried using Ledger Live and seeing how it deals with my two addresses - I've imported my cardano accounts into there and I've found that those two ADA addresses were imported as a single account and their transaction history were merged into one.
Another interesting point is that checking those two addresses on CardanoScan shows them as having the same Controlled Stake Key but each address shows it's own separate transaction history on CardanoScan.
I would be very interested to know if anyone has experienced the above issue and if they have a solution to it.
Many thanks

Nami uses one address per account, UTXOs in other addresses will be invisible. This true in general, not just for hardware wallets.

That is the expected behaviour from Nami, as it only imports first address for a given account (a HD wallet can have multiple accounts and each account can have multiple addresses). You can read more about HD Wallets that you might be familiar with (and is seen by Ledger Live too) here. This is also documented on their website under Is Nami compatible with Daedalus/Yoroi.
If you want to access full wallet contents, You can - however - import your wallet to eternl / typhon / flint to access complete HD Wallet.

Thanks very much, I used Eternl and it solved my issue!


text:
How to get unused address for stake key via Blockfrost API
Using Blockfrost API, I can query a stake address, and receive known addresses that have "state=used" like when I query them on my local node via Cardano-Wallet.
I am interested in "state=unused" though.
How can I get unused receiving addresses for a stake key using Blockfrost API?
EDIT:
When I use:

localhost:[port]/v2/wallets/[wallet id]/addresses?state=unused' | jq '.[0]

...on my local instance of cardano-wallet, I get the first addr for the wallet that has state=unused I was hoping for something similar from the blockfrost api - so I could avoid having to setup something that provides it to my web app from my local linux box where I have cardano-node & cardano-wallet running

The ask seems fundamentally wrong, as unused wallets - by definition - are not on-chain and can only be derived using root public keys (in case you haven't, could be helpful for you to check BIP-44 spec that is used by cardano-wallet ). The derivation of addresses can be easily achieved via one of the SDK/libs offline (you can find many of them at developer portal - most popular ones being  cardano-serialisation-lib and cardano-multiplatform-lib).
Some notes tho about these (adding here, tho it may not be relevant for your context):

There can be close to infinite unused addresses for a given stake account. You may see limited number of addresses because of default BIP-44 address gap (20), but that will not be all-inclusive list.
One can only derive addresses at different address idx if they have the root pub key, wouldn't be a good practice to rely on external services, especially when you have libraries to do it locally.
Even if you were to use a remote service that would provide list of addresses , from query pov - it would never be guaranteed to include different combinations of payment and stake key credentials , as they can also be merged across from different wallets.

Thank you for taking the time to answer.
When I use:

http://localhost:[port]/v2/wallets/[wallet id]/addresses?state=unused' | jq '.[0]

on my local instance of cardano-wallet, I get the first addr for the wallet that has state=unused
I was hoping for something similar from the blockfrost api - so I could avoid having to setup something that provides it to my web app from my local linux box where I have cardano-node & cardano-wallet running

You do not need cardano-node/cardano-wallet/etc running, the links above refer to SDKs/libs that should allow you to do this on the device where private keys , while fetching tx-in/UTxO details can be from blockfrost.io/koios.rest/etc

So the correct answer appears to be: "That's not possible".
The Blockfrost API does not have a utility call of any kind that returns an unused address of a given wallet.
The Blockfrost API does have a call that returns known used addresses from the blockchain though.
To generate an address for a given set of private keys, I can use one of the libraries as mentioned by RdLrt, thank you.
cardano-serialisation-lib or cardano-multiplatform-lib.


text:
after 1.35.0 update: gLiveView Luck and Ideal showing "--"
Hi new stake pool operator here. I'm having an issue after upgrading to 1.35.0. In gLiveView it shows blanks for both luck and ideal and it hasn't minted any new blocks since upgrading.
Any thoughts or suggestions would be greatly appreciated.

Is the tip at 100%? you can check it with cardano-cli query tip --mainnet/--testnet-magic 1097911063, if it is not, the node isn't in sync.
From there you can start to troubleshoot, if the BP isn't syncing, means that it doesn't have connection to relays. If it has not that, you need to check that everything is fine on that side, services are up, ports are open, ecc
Another thing that you can check on BP (or on nodes with the flag tracemempool active in the config file), is if those nodes are processing txs or not (gLiveView -> Pending TXs).
You can also check the logs to see if there are any errors with the command journalctl --unit cardano-node.service --follow.
Also share the tests that you already have done and the pool ticker, this way we can help you better.

Thanks Nic_T2C. I’ve ended up downgrading back to 1.34.1 but your suggestions are helpful as the nodes are still syncing. It was hard to find any clear indication that 1.35.0 was stable and ready for mainnet. Do you happen to know what the recommendation is?

We are currently running 1.35.1 on Testnet and probably 1.35.2 will come.
I am still running 1.34.1 on Mainnet and from what I am concerned, this is the recommended version.
If you are interested, I can share the link to SPO Announcements Telegram Group, this way you can stay always up to date :-)

That would be great @Nik_T2H

@Nik_T2K Ok so the producer and two relays are running. Producer gliveview shows 2 outgoing connections. Relays both show pending TXs.
Runningcardano-cli query tip --mainnet produces the error query tip  Error: Error while looking up environment variable: CARDANO_NODE_SOCKET_PATH" which seems significant.
It looks like maybe cnode.sh is not exporting that variable? Using cntools by the way. The producer has created a socket file node0.socket in the default cntools location on startup.

I confirmed the tip is at 100% and all three nodes have values for Pending Tx @Nik_T2K

That is a good sign, do you still have other thing to solve?

Hi yes there was still the outstanding problem of gLiveView showing blanks for ideal and luck but I believe I just solved it. I had to manually upgrade CNCLI to v5.0.4. It seems there was an issue running cncli.sh on startup and the cntools prereqs did not install the latest version. Thank you for all of your help!

This issue was helpful CNCLI Leaderlog Issue Since 1.35

Here is the SPO Announcement Group and the Best Practice Group.
In the second one you can also ask question related to a stake pool and receive help.
About CNtools, I don't have much experience, I personally run without that.
So maybe someone else can step in.
First of all, you need to make sure that your node is running, socket file is created once node is started, so this is one thing that you can check.
Second thing that I thought, is that the problem could come by the fact that the path to the socket isn't defined anywhere.
Without cntools, you create an env variable in .bashrc file as follow:
export CARDANO_NODE_SOCKET_PATH=<path_to_socket>

But I am not sure if cntools do that automatically.
Try to look on that direction and check if there is a place where you can edit that path to the correct one.
If you find the answer please post it down here. Could be usefull for others and could make me learn something new :-)

The guild tools (CNTools/gLV/etc) does it automatically, but does not export it to bashrc (as there may be more than one node running on a host, and could result in naughty outcomes).

Nice, thanks for sharing, so basically he should only add few things to the .bashrc file and he would be good to go? @RdLrT

To use it on terminal , yip