text:
How do I get the http endpoint to work for cardano-wallet?
Using a DigitalOcean Ubuntu droplet, I have:

successfully installed cardano-node according to:
https://developers.cardano.org/docs/get-started/installing-cardano-node/
cardano-cli 1.32.1 - linux-x86_64 - ghc-8.10
git rev 4f65fb9a27aa7e3a1873ab4211e412af780a3648

successful installed cardano-wallet according to:
https://developers.cardano.org/docs/get-started/installing-cardano-wallet
v2021-12-15 (git revision: 760140e238a5fbca61d1b286d7a80ece058dc729)

(in order to download/calculate the latest hashes) run

nohup cardano-node run
    --topology ~/cardano/mainnet/mainnet-topology.json
    --database-path ~/cardano/db
    --socket-path ~/cardano/db/node.socket
    --host-addr <my_ip>
    --port <port-number>
    --config ~/cardano/mainnet/mainnet-config.json & exit

And then asked the wallet to serve the http interface:

cardano-wallet serve \
  --mainnet \
  --node-socket ~/cardano/db/node.socket \
  --database ~/cardano/db
  --port 8090

However, when using Chrome to go to http://<my_ip>:8090/v2/network/information or http://<my_ip>:8090/v2, I only get:
This site can’t be reached
<my_ip> refused to connect.
Try:

Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED

Now, when I run cardano-cli query tip --mainnet I am only at epoch 293 (and as time of this question we are at 310.
Do I need to wait till I get to 310 for the http api to work? Is there anything else that is needed to get this connected?

By default cardano-wallet listens on loopback ip only - 127.0.0.1, to listen on server external ip, you need to add --listen-address parameter
So at the end command should be:
cardano-wallet serve \
  --listen-address 0.0.0.0 \
  --mainnet \
  --node-socket ~/cardano/db/node.socket \
  --database ~/cardano/db
  --port 8090

Or put dropleat real ip instead of 0.0.0.0 if it doesn't works.
Keep in mind that this is very, very dangerous to keep your wallet open to whole world especially on mainnet, so use this with caution and please use digitalocean FW and allow only your own IPs.

I'm worried I may have a fundamental misunderstanding of this whole thing. I wanted to make it open to the whole world, so I can create wallets for people via this service. (specifically, I wanted to make an iOS app that among other things can generate a wallet and give people their 12-15 word passphrase and let them enter/change a password)

@JeffreyBerthiaume, yes, never do that. The generation of the wallet needs to stay in the application itself, having a hosted service to do this is an extremely bad idea.

I'm no networking wiz (working on it) - but I just played around with the above:
I got the same error when I used my public IP address. However, when I use the loopback address (127.0.0.1) it seems to work for me.
Try running: http://127.0.0.1:8090/v2/network/information in chrome and see if that works.
If anyone knows why the public IP doesn't work but the loopback does, please explain why! :)

I'm not running this locally - this is on a Digital Ocean droplet, kind of like having a mini server running.

Ah I see. Then it won't be so simple - my naive and non-technical answer would be that you'd have to configure your droplet firewall to open port 8090 so that you could access it from the outside. Security is a concern here, but digital ocean has cloud-firewall options that make it relatively easy to allow connections to/from specific addresses (your home/office). I will work on this myself because it's piqued my curiosity; I'll get back here when I learn more.

FYI, I created and applied a firewall specifically letting traffic in from the node port as well as the wallet port. Still nothing on either.

authors: ибрагим асланзаде


text:
What are the security implications to having cardano-wallet run on a public server?
I want to use a public cardano-wallet server running on mainnet, so I can connect to it and create wallets for users of my iOS app.

How can I set up all transactions to be encrypted (over SSL) instead of over http?

Does the server keep logs of requests, and if so, how can I clear them? (I don't want to save a local record of anything I receive)

Are there any other security concerns?

In most cases, you should never manage users wallets with a hosted service. The whole point of a decentralized blockchain is that users are managing their own assets.
The best practice is to generate and keep the keys used in signing of a transaction within the iOS application managed by the user and use a hosted service to communicate with the Cardano blockchain (something like blockfrost.io or a hosted cardano-db-sync instance).

What if I'm using cardano-wallet to generate the pass-phrase and set a password - where does this get set? I can't use blockfrost to create a wallet, and I don't want to be responsible for the wallet either.

Your code needs to generate the passphrase, your application needs to protect the keys with a password. The user must be responsible for the wallet.

source: Stack Exchange

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

sort: votes


text:
Block missed despite no problem on servers
My pool missed a block but looking at the server logs everything was fine at this moment.
Here are the Cardano logs :
{"thread":"1734","loc":null,"data" {"kind":"TraceStartLeadershipCheck","chainDensity":4.882958e-2,"slot":40969729,"delegMapSize":861059,"utxoSize":3467585,"credentials":"Cardano"},"sev":"Info","env":"1.29.0:4c594","msg":"","app":[],"host":"deploy-s","pid":"80","ns":["cardano.node.LeadershipCheck"],"at":"2021-09-25T02:13:40.00Z"}
{"thread":"1734","loc":null,"data":{"val": {"kind":"TraceNodeNotLeader","slot":40969729},"credentials":"Cardano"},"sev":"Info","env":"1.29.0:4c594","msg":"","app":[],"host":"deploy-s","pid":"80","ns":["cardano.node.Forge"],"at":"2021-09-25T02:13:40.00Z"}
{"thread":"1734","loc":null,"data":{"kind":"TraceStartLeadershipCheck","chainDensity":4.882958e-2,"slot":40969730,"delegMapSize":861059,"utxoSize":3467585,"credentials":"Cardano"},"sev":"Info","env":"1.29.0:4c594","msg":"","app":[],"host":"deploy-s","pid":"80","ns":["cardano.node.LeadershipCheck"],"at":"2021-09-25T02:13:41.00Z"}
{"thread":"1734","loc":null,"data":{"val":{"kind":"TraceNodeIsLeader","slot":40969730},"credentials":"Cardano"},"sev":"Info","env":"1.29.0:4c594","msg":"","app":[],"host":"deploy-s","pid":"80","ns":["cardano.node.Forge"],"at":"2021-09-25T02:13:41.00Z"}
{"thread":"217610","loc":null,"data":{"kind":"ChainSyncClientEvent.TraceDownloadedHeader","peer":{"remote":{"addr":"10.45.129.61","port":"6000"},"local":{"addr":"100.64.5.177","port":"43899"}},"slot":40969728,"block":"3e41596123fca52a1328fdf70c6986be9b57e9b3a5284d0232632aae4cf5affb","blockNo":6287888},"sev":"Info","env":"1.29.0:4c594","msg":"","app":[],"host":"deploy-s","pid":"80","ns":["cardano.node.ChainSyncClient"],"at":"2021-09-25T02:13:41.11Z"}
{"thread":"1736","loc":null,"data":{"peers":[{"length":"1","kind":"FetchDecision results","peer":{"remote":{"addr":"10.45.129.61","port":"6000"},"local":{"addr":"100.64.5.177","port":"43899"}}}],"kind":"PeersFetch"},"sev":"Info","env":"1.29.0:4c594","msg":"","app":[],"host":"deploy-s","pid":"80","ns":["cardano.node.BlockFetchDecision"],"at":"2021-09-25T02:13:41.14Z"}
{"thread":"1736","loc":null,"data":{"kind":"AddedFetchRequest","peer":{"remote":{"addr":"10.45.129.61","port":"6000"},"local":{"addr":"100.64.5.177","port":"43899"}}},"sev":"Info","env":"1.29.0:4c594","msg":"","app":[],"host":"deploy-s","pid":"80","ns":["cardano.node.BlockFetchClient"],"at":"2021-09-25T02:13:41.14Z"}
{"thread":"217608","loc":null,"data":{"kind":"AcknowledgedFetchRequest","peer":{"remote":{"addr":"10.45.129.61","port":"6000"},"local":{"addr":"100.64.5.177","port":"43899"}}},"sev":"Info","env":"1.29.0:4c594","msg":"","app":[],"host":"deploy-s","pid":"80","ns":["cardano.node.BlockFetchClient"],"at":"2021-09-25T02:13:41.16Z"}
{"thread":"217608","loc":null,"data":{"length":1,"kind":"SendFetchRequest","head":"3e41596123fca52a1328fdf70c6986be9b57e9b3a5284d0232632aae4cf5affb","peer":{"remote":{"addr":"10.45.129.61","port":"6000"},"local":{"addr":"100.64.5.177","port":"43899"}}},"sev":"Info","env":"1.29.0:4c594","msg":"","app":[],"host":"deploy-s","pid":"80","ns":["cardano.node.BlockFetchClient"],"at":"2021-09-25T02:13:41.16Z"}
{"thread":"217607","loc":null,"data":{"kind":"StartedFetchBatch","peer":{"remote":{"addr":"10.45.129.61","port":"6000"},"local":{"addr":"100.64.5.177","port":"43899"}}},"sev":"Info","env":"1.29.0:4c594","msg":"","app":[],"host":"deploy-s","pid":"80","ns":["cardano.node.BlockFetchClient"],"at":"2021-09-25T02:13:41.22Z"}
{"thread":"1734","loc":null,"data":{"val":{"kind":"TraceForgedBlock","blockPrev":"78de58439fc25a623ca44b8b7945385a23a727dc81a562f8aea54b3fa8dce4e5","slot":40969730,"block":"e16eb1d6ff408c4ada4f9f2fbdf554f7821ccd8d6b4a302c93aab8c3be0b22ff","blockNo":6287888},"credentials":"Cardano"},"sev":"Info","env":"1.29.0:4c594","msg":"","app":[],"host":"deploy-s","pid":"80","ns":["cardano.node.Forge"],"at":"2021-09-25T02:13:41.29Z"}
{"thread":"217607","loc":null,"data":{"kind":"CompletedBlockFetch","peer":{"remote":{"addr":"10.45.129.61","port":"6000"},"local":{"addr":"100.64.5.177","port":"43899"}},"block":"3e41596123fca52a1328fdf70c6986be9b57e9b3a5284d0232632aae4cf5affb"},"sev":"Info","env":"1.29.0:4c594","msg":"","app":[],"host":"deploy-s","pid":"80","ns":["cardano.node.BlockFetchClient"],"at":"2021-09-25T02:13:41.32Z"}
{"thread":"217607","loc":null,"data":{"kind":"CompletedFetchBatch","peer":{"remote":{"addr":"10.45.129.61","port":"6000"},"local":{"addr":"100.64.5.177","port":"43899"}}},"sev":"Info","env":"1.29.0:4c594","msg":"","app":[],"host":"deploy-s","pid":"80","ns":["cardano.node.BlockFetchClient"],"at":"2021-09-25T02:13:41.32Z"}
{"thread":"1724","loc":null,"data":{"newtip":"3e41596123fca52a1328fdf70c6986be9b57e9b3a5284d0232632aae4cf5affb@40969728","chainLengthDelta":1,"kind":"TraceAddBlockEvent.AddedToCurrentChain"},"sev":"Notice","env":"1.29.0:4c594","msg":"","app":[],"host":"deploy-s","pid":"80","ns":["cardano.node.ChainDB"],"at":"2021-09-25T02:13:41.49Z"}
{"thread":"217591","loc":null,"data":{"kind":"ChainSyncServerEvent.TraceChainSyncServerReadBlocked.AddBlock","slot":40969728,"block":"3e41596123fca52a1328fdf70c6986be9b57e9b3a5284d0232632aae4cf5affb","blockNo":6287888},"sev":"Info","env":"1.29.0:4c594","msg":"","app":[],"host":"deploy-s","pid":"80","ns":["cardano.node.ChainSyncHeaderServer"],"at":"2021-09-25T02:13:41.49Z"}
{"thread":"217591","loc":null,"data":{"point":{"kind":"BlockPoint","headerHash":"3e41596123fca52a1328fdf70c6986be9b57e9b3a5284d0232632aae4cf5affb","slot":40969728},"kind":"ChainSyncServerEvent.TraceChainSyncRollForward"},"sev":"Info","env":"1.29.0:4c594","msg":"","app":[],"host":"deploy-s","pid":"80","ns":["cardano.node.ChainSyncHeaderServer"],"at":"2021-09-25T02:13:41.49Z"}
{"thread":"1724","loc":null,"data":{"kind":"TraceAddBlockEvent.TrySwitchToAFork","block":{"kind":"Point","hash":"e16eb1d6ff408c4ada4f9f2fbdf554f7821ccd8d6b4a302c93aab8c3be0b22ff","slot":40969730}},"sev":"Info","env":"1.29.0:4c594","msg":"","app":[],"host":"deploy-s","pid":"80","ns":["cardano.node.ChainDB"],"at":"2021-09-25T02:13:41.49Z"}
{"thread":"1882","loc":null,"data":{"kind":"ChainSyncServerEvent.TraceChainSyncServerReadBlocked.AddBlock","slot":40969728,"block":"3e41596123fca52a1328fdf70c6986be9b57e9b3a5284d0232632aae4cf5affb","blockNo":6287888},"sev":"Info","env":"1.29.0:4c594","msg":"","app":[],"host":"deploy-s","pid":"80","ns":["cardano.node.ChainSyncHeaderServer"],"at":"2021-09-25T02:13:41.49Z"}
{"thread":"1882","loc":null,"data":{"point":{"kind":"BlockPoint","headerHash":"3e41596123fca52a1328fdf70c6986be9b57e9b3a5284d0232632aae4cf5affb","slot":40969728},"kind":"ChainSyncServerEvent.TraceChainSyncRollForward"},"sev":"Info","env":"1.29.0:4c594","msg":"","app":[],"host":"deploy-s","pid":"80","ns":["cardano.node.ChainSyncHeaderServer"],"at":"2021-09-25T02:13:41.49Z"}
{"thread":"1734","loc":null,"data":{"val":{"kind":"TraceDidntAdoptBlock","slot":40969730},"credentials":"Cardano"},"sev":"Error","env":"1.29.0:4c594","msg":"","app":[],"host":"deploy-s","pid":"80","ns":["cardano.node.Forge"],"at":"2021-09-25T02:13:41.51Z"}
{"thread":"1732","loc":null,"data":{"txs":[{"txid":"txid: TxId {_unTxId = SafeHash \"b1733a284ed3d44aef1db34bbafee20f0882a2478bc3b694c67fcd7dacb7258d\"}"},{"txid":"txid: TxId {_unTxId = SafeHash \"f8c92325873b728b22655f91b9c330d1f8e69c7632d444e291c3955d50bc4f20\"}"},{"txid":"txid: TxId {_unTxId = SafeHash \"5600ecfce06658369f4ad4fa21c1f841b40a8e799116734e7bae81b4fd5c81e3\"}"},{"txid":"txid: TxId {_unTxId = SafeHash \"08cf32b2b8cb9b54f6894b784997a84a98db44783d60322d618f6b38be798e69\"}"},{"txid":"txid: TxId {_unTxId = SafeHash \"fafb77fe479b34041e38881639fd92a84d4910867ac9f10b792058214d1708e7\"}"}],"mempoolSize":{"numTxs":1,"bytes":1495},"kind":"TraceMempoolRemoveTxs"},"sev":"Info","env":"1.29.0:4c594","msg":"","app":[],"host":"deploy-s","pid":"80","ns":["cardano.node.Mempool"],"at":"2021-09-25T02:13:41.79Z"}
{"thread":"1734","loc":null,"data":{"kind":"TraceStartLeadershipCheck","chainDensity":4.885721e-2,"slot":40969731,"delegMapSize":861059,"utxoSize":3467587,"credentials":"Cardano"},"sev":"Info","env":"1.29.0:4c594","msg":"","app":[],"host":"deploy-s","pid":"80","ns":["cardano.node.LeadershipCheck"],"at":"2021-09-25T02:13:42.00Z"}

I see that there is a "TraceAddBlockEvent.TrySwitchToAFork" event during my leader slot, is it the cause of my problem ? Can I do something to avoid that in the future ?

How do you see this skipping / missed? I see 40969729, 40969730, 40969731 is that the block serial? Seems legit. Maybe I don't know what slot is.

@Tomachi I have this in the logs {"kind":"TraceDidntAdoptBlock","slot":40969730}

Yes, if you forge a block in a slot but the node switches to a different fork before your block is propagated, your node with increment the metric tracking that it forged but didn't adopt it.

OK it sounds a bit like an "Uncle" block in Ethereum yes? AFAIK in Ethereum these get acknowledged in the next block but with lesser rewards, I guess it would make the chain harder to forge so makes sense. I wonder if Cardano uses these blocks? Or is the counter just for internal use to diagnose slow propagation issues maybe.

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


text:
Error When Running stack ghci on my MacOS Terminal
I am getting this error when I try to run stack ghci on my Mac Termina. How do I resolve this? I've run stack upgrade and stack update.
Downloading lts-18.13 build plan ...RedownloadFailed Request {
  host                 = "raw.githubusercontent.com"
  port                 = 443
  secure               = True
  requestHeaders       = []
  path                 = "/fpco/lts-haskell/master//lts-18.13.yaml"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}

Is your Mac an M1 Chipset? If so, I think there is a chance that is the issue. If it is an M1, you could run it under Rosetta and that should work.

My Mac has Intel and not M1 Chip.


text:
Cardano Data for Data Analytics and Data Visualisation
Where can I get Cardano raw data or formatted data (e.g. no. of wallets, ADA price, etc) that I can use for data science, analytics and visualisation?

there are providers such as
https://api.koios.rest/#overview
and
https://blockfrost.io/


text:
Daedalus fails to load wallet
Daedalus after 4.2.1 upgrade fails to load my wallet, the logs says the wallet was found, I can see some sqlite wallet files on my computer and cannot seem to find any information about anything being errorous, the only error I can spot in the logs are saying:
[34m[cardano-wallet.pools-engine:Info:1340][0m [2021-08-20 17:13:04.65 UTC] Fetching metadata with hash 7e10ed9d from https://smash.cardano-mainnet.iohk.io/api/v1/metadata/<bighexnumber>/<bighexnumber>
[33m[cardano-wallet.pools-engine:Warning:1340][0m [2021-08-20 17:13:04.81 UTC] Failed to fetch metadata with hash 7e10ed9d: There's no known metadata for this pool.

Can I somehow fix my wallet information without the seed phrase?

Please submit a support ticket within Daedalus.


text:
datum hash of bytes is different between cardano-serialization-lib and cardano-cli
I am having trouble using cardano-serialization-lib. I am trying to calculate the datum hash from bytes using this library:
var myBytes = Buffer.from(
    'b1566319045054327346e0043eed1af00eec2a63d9536f65087ca1c8'
  );
  const dtHash = hash_plutus_data(PlutusData.new_bytes(myBytes));

which gives me a4c44696aa4ed831f3a1c0b86e407a8c092cf680e61ed23f0e47a15b73d59c79
but when I tried to do it through cli with cardano-cli transaction hash-script-data --script-data-file $datumFile
where datumFile is
{
    "bytes": "b1566319045054327346e0043eed1af00eec2a63d9536f65087ca1"
}

I got edc92947d6f09957c3fe31c10478e6eeee7fdaec1e2cc7439633325cd9bcf13f instead

Did you manage to solve this?

I'm pretty sure this is a known bug which the devs are aiming to fix in the next hard fork. You can see the discussion here: https://github.com/Emurgo/cardano-serialization-lib/issues/227
Does your transaction work when you submit it? If it doesn't, you should get a relevant error related to the datum which you can use to fix your transaction body.


text:
Convert Plutus Address Credential to real-net address
So in Plutus we have the Address type which has two constructors ScriptCredential which is a ValidatorHash or PubKeyCredential which is a PubKeyHash but all these are not encoded in the same way as addresses on the alonzo testnet or any other real net.
I'm using the script Alwayssucceed from the Alonzo-testnet repo.
When we compile it to .plutus and build its address in cli we get addr_test1wpnlxv2xv9a9ucvnvzqakwepzl9ltx7jzgm53av2e9ncv4sysemm8
But in Plutus if we display its Address we get a totally different output. This is what I tried because Cardano addresses are encoded in bech32.
import Data.ByteString.Base16 as B16
import Codec.Binary.Bech32 as B32

valhash :: Maybe Plutus.ValidatorHash
valhash = toValidatorHash $ scriptAddress validator

transform :: IO ()
transform = let Right prefix = humanReadablePartFromText "addr_test1" in
  case valhash of
    Nothing -> print @String "Nothing"
    Just vhash -> case vhash of
      Plutus.ValidatorHash vhashbs -> print $ B32.encode prefix (dataPartFromBytes $ fromBuiltin vhashbs)

Output : addr_test11xpnaff4z2xn3szgf8z6a2txju6dnsmsar22h2fnmvf7hyx8lpvw
Someone suggested here that in Plutus these Addresses are encoded in Base16, but B16.decode $ fromBuiltin vhashbs returns that it isn't a Base16 encoded bytestring.
My question is, is there a way to convert Plutus addresses to real Cardano addresses? Or will they understand each other when off-chain support (PAB) comes to real blockchains?
Thanks

Have you managed to solve this?

I think the question does not make much sense actually, we can convert from .plutus to bech32 and that's enough, I think when you convert to Address you put it in the format for the Emulator, it is not linked to real net, but honestly I don't know. Currently I'm looking at how to get the right ValidatorHash from the validator, still no clue. This conversion process is very unclear (what format does plutus understand, what format is to be passed on the blockchain...)

Check here please:
https://cardano.stackexchange.com/a/8808/6196
I answered a similar question in a different post


text:
Script unlock cannot submit, budget overspent
I'm  trying to unlock some token at a script address, so I create a tx with cardano-cli transaction build ... this passes successfully, then I sign the tx. It is now ready for submit but when I submit I get this error:
Command failed: transaction submit  Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (UtxoFailure (UtxosFailure (ValidationTagMismatch (IsValid True) (FailedUnexpectedly [PlutusFailure "\nThe 3 arg plutus script (PlutusScript ScriptHash \"9f8863d5eb3f855c406ff38f29daa84e41ba0f3f1203bbe54275cf5f\") fails.\nCekError An error has occurred:  User error:\nThe budget was overspent. Final negative state: ({ cpu: -119092 | mem: -400 })
After this I get a detail of the Tx followed by a big patch of non-readable text. (This same error also appears in the output of the syncing testnet node I'm running)
Anyone knows what's the issue and how to solve it? Thanks

The error says your contract is over resource budget.
 User error:
   The budget was overspent. Final negative state: ({ cpu: -119092 | mem: -400 })


text:
Difference between Ouroboros' Proof of Stake and Solana's Proof of History
What are the key differences between Ouroboros' Proof of Stake and Solana's Proof of History in aspects such as security, decentralization, functionality, efficiency (such as number of transactions per second) and energy use? Are there published papers or articles which compare the two?

https://eprint.iacr.org/2016/889.pdf https://medium.com/solana-labs/proof-of-history-a-clock-for-blockchain-cf47a61a9274 the answer would be found by reviewing the two papers and comparing the two i havent read through either yet but will and post my personal opinion about the two


text:
Can't find .config on the root

So this step on the "Ubuntu setup for Plutus Playround" Cant work.

mkdir ~/.config/nix
echo 'substituters = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/' >> ~/.config/nix/nix.conf
echo 'trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=' >> ~/.config/nix/nix.conf

what should i do? trying to create a .config folder don't work either.
(my coding and linux level is low)

If the file does not exist you have to create it. It should work.

Don't work..
mkdir ~/.config/nix
mkdir: cannot create directory ‘/home/cnode/.config/nix’: No such file or directory

Not sure what directory you are in (folder).  Maybe post back (use pwd).  None the less, you probably don't have the nix.conf file made in /etc/nix directory?  Try this on how to make one: https://www.punkbit.com/hacking/plutus-developer-environment-setup-on-macos-monterey/

It’s because the folder .config does not exist yet, so you cannot create the nested folder nix
So you run this instead
mkdir -p ~/.config/nix


text:
Having a problem with Minting with Cardanocli-js
Im creating a transaction using this code:

const tx = {   txIn: wallet.balance().utxo,   txOut: [
{
address: wallet.paymentAddr,
value: { ...wallet.balance().value, [MARCELOCOIN]: 1 },
}   ],   minting: [
{ action: 'mint', quantity: 100, asset: MARCELOCOIN, script: mintScript },   ],   witnessCount: 2, };

when i try to create the Raw arquive with:

let raw = cardanocliJs.transactionBuildRaw(tx);

It gives me the following error:

option --tx-out:
unexpected "N"
expecting white space or quantity (word64)

Error: Command failed: cardano-cli transaction build-raw                 --tx-in 5896209b2eb8eb2e3b19e06335e787c9856661087e6796fd5f483f0a30b923cc#0 --tx-in c6b914dfd086ac8e776c91ea615e847d1e7dc6f447a8cca467371de506ab64a7#1                  --tx-out "addr_test1qqmjrep08v07cjn4t3852hr54czxw4m2dyv7wynkk3ufl63xjyzlpj9g68r0n0q3sfgc9vtt8z48z7yff3a4lh9kp2fqa0ccru+998825875+NaN undefined+1 43ad91053eb32da8884e1e5c4b67865d5f46f90072110c8e233261b9.MarceloCoin"                                                                                --invalid-hereafter 38296439                 --invalid-before 0                 --fee 0                 --out-file /home/cnode/minter/minter/tmp/tx_4ue4nzska.raw

So you see that there is a 'undefined' inside tx-out. I don't know whats the problem.. Can you help me?

Hello. Cardano cli has changed recently and that had added extra output in the query which maybe not yet been managed to implement by the library developer. Try contacting the developer or raising an issue on Github

I have already, but he is too busy with other stuff to help..

All solved with the actualization of the cardanocli-js to the 4.0.1 version.
The examples are working great!

Yes, version 4.0.0 had problems with extra whitespace in some lines. Version 4.0.1 resolved the issue.

The issue which is simple. The command: cardano-cli query utxo --address {address} --mainnet
Has changed it's output format recently. It now returns an extra field at the end of each TX. A well placed .pop() on the correct JS array will fix it. This extra data belongs to the Smart Contract logics.
Unfortunately I do not use this library and am unfamiliar with it so cannot offer any further guidance.


text:
How to get a full command list of the Cardano-cli
I'm trying to fix something (the cardanocli-js) that broke with this last update (1.31.0) but i don't know how to see the correct way that, in 1.31.0 version, the Cli make transactions (or find how much cost the fee). I didn't find the list of commands and their correct use..
I know that using help i can somewhat get it. But there is a more explanatory version somewhere?
thank you.

The only one I know is this:

Cardano Node CLI Reference
[EDIT] Create Simple Transaction (although it's a bit outdated) this one explains very well how to create a transaction and calculate fees.

Related to fee, first you need to build the transaction then you can use this command:
cardano-cli transaction calculate-min-fee \
  --tx-body-file transaction.raw \
  --tx-in-count 1 \
  --tx-out-count 1 \
  --witness-count 2 \
  --testnet-magic 1097911063 \
  --protocol-params-file protocol-params.json

Where:

--tx-body-file FILE      Input filepath of the JSON TxBody.

--tx-in-count NATURAL    The number of transaction inputs.

--tx-out-count NATURAL   The number of transaction outputs.

--witness-count NATURAL  The number of Shelley key witnesses.

There is a good explanation to calculate fees


text:
Failing to set up plutus on windows
So I'm using WSL Windows 10 and I set up IOHK hashes, but everytime I run nix-shell I get following error:
build of '/nix/store/9im4jp068ykqsm4s8996px605p6zrw7q-Agda-plan-to-nix-pkgs.drv' failed. Would greatly appreciate any help.

Solved it by upgrading to wsl 2.


text:
How does Cardano execute real time transactions if block time is 20 seconds?
New to the crypto space, please correct me if I misunderstood the meaning of block time.
When a cardano node submits a transaction, it goes to a local mempool and submitted on the blockchain for verification. Let's assume this part is instantaneous from the wallet node.
The official docs state that blocks are produced every 20 seconds. In other words, even if the validator nodes receive the transaction immediately, they will wait upto another 20 seconds, and then create a new block to broadcast.
This implies even a low assurance for block will take atleast 20 seconds. In my experience with cardano wallets (before the dexes were launched), it rarely took more than 10 seconds to get a high assurance for transaction.
I also read on the forums that 20 seconds block time is configurable, and can't be enforced on a node. So are we relying on SPOs to use a low block creation time interval to solve real time transactions in the long run?

Block time is 20 seconds in average. Sometimes we have blocks at shorter intervals, sometimes much longer. I saw sometimes sequences of 4 or 5 blocks at one second interval from each other. And sometimes even 2 minutes. And sometimes we have 2 or even stake pools which are minting a block in the same second, and only one will be adopted by the blockchain (this is called a slot battle). And when a stake pool mints a block without receiving the previous minted block (if it was minted in the second before, and the propagation time is more than 1 second), a height battle will occur, and only one of the 2 blocks will be adopted.
SPOs cannot choose when to mint a block. This is decided randomly, based on the VRF key of each stake pool, and is known 1.5 days before each epoch starts for the next epoch. In about 2 hours, I will know how many slots to mint blocks my stake pool has allocated for epoch 318 (exact date and time, in seconds, because one slot is one second).
The average interval of 20 seconds between block is given by a parameter, "density", which is not 0.05 (5%). This means 5 blocks in average for every 100 seconds. This is a parameter that can be adjusted, but I don't think it will be adjusted soon.
If your transactions were confirmed until now in less than 10 seconds, you were just "lucky". Now the blockchain is pretty busy, and it will probably take a few blocks until a transaction is confirmed, even more if you are using a light wallet.

Thanks for the detailed explanation. I still don't follow how would Cardano achieve real time transactions, say someone paying ADA at a coffee shop. Is density parameter tuning from 0.05 to 1.00 (or close to 1) the only way? Why not do it now?

Have one more query on your statement "In about 2 hours, I will know how many slots to mint blocks my stake pool has allocated for epoch 318". Are you suggesting slot leaders for each slot in the coming epoch are announced 1.5 days before it starts? If that were the case, wouldn't an SPO just turn on their machine for those few seconds and ignore the rest because it's not getting any revenue? Additionally, what happens a preselected slot leader is down when the slot time comes?

Yes, SPOs can find out 1.5 days before a new epoch starts the slots when their stake pools will mint blocks. They could turn off the block producer, but starting it and starting the service takes at least 10 minutes, sometimes a lot longer.
The relays cannot be stopped, because they need incoming connections to propagate blocks. It you stop them, you lose those connections, and the blocks will be lost. This is why the relays must stay connected all the time.

For real time payments a Layer 2 solution will probably be better suited.

@dev - the Cardano roadmap has a bunch of things in the pipeline coming that will lead to scalability. Hydra Head is a big one, but AFAIK there are a bunch of other things that will work together to increase Transactions Per Second to 3000+. Right now they've just introduced smart contracts and dapps, so I think that's what a lot of the work has been going to.


text:
When can we expect live deployment of the Plutus Playground
I am working with a low end device, and the live deployment of the playground is what I'm counting on. When can I expect it and is there any community deployed server that is active now?

You may already be aware , but the live deployment is back online, as posted on Discord by Matthew Capps.
For future reference, this was in the ppp-announcements channel on the IOG Discord server. A lot of the most current info is shared out there by IO(HK).
Good luck and wish you the best in this class!

Can you share a link to the deployment? I was not able to find it on Discord.

It looks like it's online and available here. Not sure what version it is though.


text:
Setting up .ghci for Haskell installation in WSL
I used the ghcup tool to install ghc and cabal, on completion I tried to create a .ghci file to print a new prompt.
It gave me a warning
*** WARNING: .ghci is writable by someone else, IGNORING!
Suggested fix: execute 'chmod go-w .ghci'

Even after doing the suggested fix the same warning appears and nothing happened to the prompt :(

may you try doing chmod 644 .ghci

@elrmndo It did not work either. :(

I am having this problem using Nix on macOS 10.14.6 and 10.15.7 in early 2022. It is frankly embarrassing that this problem, which has been known for more than 8 years, has not been fixed.


text:
How to talk to Cardano blockchain using Javascript
How would I go about making a Javascript script which can get information from the cardano blockchain. Like what library or framework can I use.

While I have not used this API myself, the Blockfrost API has a JavaScript SDK that can do that. There is a free tier.

Ogmios runs alongside a cardano node and provides a websocket api to sync or query the chain. Documentation is available here. If you don't want to host the node yourself, or want to get up and runnning as quickly as possible, you could check out the instance hosted by Gimbalabs

The MESH JS SDK is ideally suited for Javascript or Typescript interaction with Cardano, including functions abstracting most of the core functionality and "Providers" which can be used to get data from Blockfrost, Koios, Ogmios etc. There are also React elements, and starter kits and basic templates.

Nami wallet injects a bunch of functions yo your browser, similar to meta mask:
https://namiwallet.io/

You can also interact with cardano blockchain via cli, and there is a nice library that i use personally a lot named cardanocli-js


text:
Choosing Ubuntu over WSL for Plutus development
I use a low end laptop as my daily driver running a WSL Ubuntu-20.04 as my platform of choice. When trying to run the plutus-playground it often crashes. Should I try using Ubuntu or any other Linux boot for the development or will I get a similar experience there too.

WSL is a hack for running Linux programs. Plutus Playground is very stable once it is installed on a stable platform. I had hosted a playground without any issue for more than a month that too without restart. It is highly recommended that Ubuntu or other Linux OS be used as a base platform than Windows.

Ubuntu is far better, just tried running plutus on it :chef_kiss:.


text:
Haskell example programs
So I've been trying to learn Haskell for a week now but I think it's time to do some small projects (like, a small guessing game or such). Can you all direct me into some project's I can take a look at and try and recreate.

I had used https://wiki.haskell.org/H-99:_Ninety-Nine_Haskell_Problems . These are the best set of algo programs.

A place that I like for practicing problems is Exercism
Apart from the unit testing validation, volunteers check your code and give you human feedback.
https://exercism.org/tracks/haskell


text:
voting with Catalyst
I have multiple wallets (two on Daedalus, two on Yoroi and one Nami.) How do I vote with each wallet? Catalyst on my iPhone will only allow me to register one wallet.

You either have to vote with your first account, than reinstall the app (or just wipe its storage) and vote again with your second account.
Alternatively you can use any application cloning app on iOS that will allow you to setup the same application with two acocunts.


text:
send multiple assets in one transaction
I have 2 wallets.
I have about 10 assets (tokens, cnfts) besides ADA in each wallet.
I would like to send the assets from one wallet to the other to consolidate them.
Can I do this in one transaction?
Thanks!

Yes you can. A single cardano transaction may contain multiple inputs per address from multiple wallets, so long as the transaction contains a signature for every unique address from which a UTXO is being consumed.
For example, if all of your ADA/assets that you wish to consolidate are spread across 5 UTXO's in a single address, you can create a transaction where all 5 are consumed in 5 TX-inputs, and output to a single UTXO sent to the new wallet. If no change is being sent back to the original wallet/address, such a transaction would contain 5 inputs and one output. This transaction would require only one signature associated with the address whose UTXO's are being consumed. If there are multiple input addresses, you would need a signature from each input address.
I provided an example in this post.
Let me know if you need further clarification or a different example! :)

Wow, thanks. I'm glad this is possible, but it sounds confusing. Would I do this directly from my wallet, or is this done with a CLI tool?

if you are using a frontend wallet like Yoroi or Daedalus, I don't think there is an option for multi-wallet (batched) transactions. You could however consolidate assets from a single wallet in one transaction by sending all of the assets to a single address on your new wallet. If however you do need to construct multi-wallet transactions, cardano-cli or cardano-wallet would be the way to go.

Are you looking to use a light wallet client or do this using the cardano-cli?
If you’re looking to just get the one time task done, I’d recommend this.
Go to Send -> Input an address -> Input an amount -> Add assets to the same transaction -> Submit.


text:
hardware wallet
With all the hacking of personal computers, ledger, and t-mobile; what is the safest way to store ADA? I have been hacked through ledger live through a google add-on. Is Yori with ledger safe?
thanks,
totally paranoid

Could you explain how you were hacked in Ledger Live? What Google add-on? What did the hack do? Also, you’ll get better responses if you edit your title and ask a meaningful question, rather than just having “hardware wallet”. Have a look at the titles of other questions as examples.

Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.

Ledger live doesn't have a google add-on, you were only scammed.  There isn't a way to get hacked with ledger live unless you accept a transaction. I've been using Ledger since 2017 it works as long as you pay attention to what transaction you're accepting on your ledger device.
Those people who got hacked via a sim swap didn't understand basic cyber security.
First of all, you don't use SMS as 2nd step authentication, use Google Authenticator or the many vendors with a similar app.
You do not leave your bag holding on an exchange PERIOD!. Mt.Gox is a primary example of why and this continues today for those who don't spend the time to learn this lesson.
IF you have over 100k in crypto and don't have a ledger or trezor and a Cryptotag or blockplate, it's only a matter of time before you lose it all.
My ADA is safe with only $230 invested in hardware because I spent extra to get titanium plates to protect my seed phrase sold by Cryptotag. Heed these warnings or get featured in the next "I got hacked from coinbase and I'm mad" article.
also, Charles does not give away free ADA. NEVER!!

Unlike many users I have a slightly different than mainstream view on Trezor & Ledger.
Avoid both. Ledgers internal servers where hacked and all of their customer information was released to the world. Also there was a Shopify leak as well. I know two stake pool operators who's info was released and they are constantly being sent spoofed emails and one of them fell for one.
Trezor link
Hacking users is far easier than hacking secure systems. All they would have to do to is get you to click on something in an email and they can trace that IP to your physical location through your ISP.
For any large sum wallet keep it on paper (Titanium? Need to enter an address to have it shipped).
Create the wallet(3 copies of the seed stored in different locations), add funds, delegate to OTG pool(or some other pool..) Then delete the wallet off the computer. It will earn rewards and can be restored when needed.
If you want a wallet for interacting with the blockchain like buying/trading NFT's create a second smaller wallet with Nami. Nami is single address wallet while Yoroi is multi address so create a new wallet in Nami and add funds to it. Brave browser is nice.
It would also be best to get an open source privacy respecting operating system and encrypt your dns traffic. elementary.io for example is an Ubuntu based OS and secure.
Full paranoid is an old Thinkpad with encrypted Libreboot with Trisquel.
Intel & AMD have backdoors so it depends who you think your adversaries are.
https://hackaday.com/2020/06/16/disable-intels-backdoor-on-modern-hardware/
https://www.flashedtech.com/
Peace & Freedom!

Ledgers' internal servers don't affect the Ledger devices. I was in that hack myself, My crypto was fine the whole time and since I know what a phishing email is like and scam calls, I managed just fine. Also Ledgers use secure element chips.
Also, SPOs should know better about scams and proper key management, it's not acceptable to be in that position of power in the network and to be vulnerable to an email scam.


text:
How would one go about Gating content through ownership of an NFT?
The question is the title, I want to gate access to a URL based on the presence of a specific token in their wallet.
I assume this would be done through a wallet browser plugin? I've heard that this can be done through Nami wallet but would like some more information if anyone can help please?
Many thanks in advance.

In the Nami wallet documentation, it says how to interact with the wallet using web-browser, for example you can run window.cardano.enable(), there is a command for queryng UTXOs.. i have not been able to make it work, but yes the one that query the address.. then you can query the adress using blockfrost, and check the UTXOs sitting in that adress.

Thanks for the answer :)


text:
Can you the number of NFT's that can be minted in a transaction?
I wanted to understand if you could place a hard limit on the number of tokens minted under a policy.
I've scanned the docs and the policy.script only seems to control permission and the amount of time before the policy is locked.
I'm wondering if this is possible, and if not - what stops NFT creators just minting more than they say they will?
Many thanks

There is not a way to specify the limit for a given native asset in the policy.
Only, once the policy is timelocked, you have the guarantee that the NFT creator does not mint or burn the NFTs.

With a Plutus script, you can absolutely limit the number by ensuring not more than a certain number has been minted by putting it into the validator.

Check out Lars Lecture 5 ... https://youtu.be/SsaVjSsPPcg?t=2471
It explains everything very clearly!


text:
How are identities verified on Atala Prism?
I assume as an adult I can get an atala verified identity rather easily, but if a minor wants an identity on atala (for example, to play blockchain games) how is that done?  What information/documentation is needed, etc...


text:
would anyone reply/share who is working on inventory and shipping solutions with Cardano?
would anyone reply/share who is working on inventory and shipping solutions with Cardano?
storage
shipping
automation
price quotes
samples
contracts
distribution

I'm sure there is many more, but top of my head:

We, at Five Binaries, have a customer that is using the cardano-oracle-node to monitoring the supply chain of their products during shipping.
Emurgo is working to port their Traceability Solution to Cardano.

very neat, thank you @Marek Mahut - StakeNuts!

Maybe a little late to the question, but recently Strait Brands announced they will use Cardano's blockchain to manage their supply chain.


text:
Voting fund 6 not working
Can not register for fund 6. In adalight it says enter link description here
Registration for fund 5 voting is closed, and fund 6 is not shown.

Did you already update the app and clear both cache and storage?

Registration for fund6 is now closed, last call was on Oct 4 - 11AM UTC.
As @Aron Neewart said, you probably need to update your app if you don't see fund6. Anyway, now is too late to register, do that for the next fund


text:
npm run start in plutus-playground-client throws several "Could not find module" errors
I'm trying to run the plutus-playground-client. My OS is macOS Big Sur 11.6.2
I have set up the environment with the following steps based on the nix install instructions from:
https://docs.plutus-community.com/docs/setup/MacOS.html
and the playground setup instructions (on page 2) from:
https://docs.google.com/document/d/13112LHG9vVvNUs40oZSqZ-DF6_yFiT_SJZ2NaEmjMM4/edit#
These are the exact steps I've taken for setup:
# install nix
$ sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume

# check version
$ nix --version # prints (nix (Nix) 2.5.1)

# edit nix conf file
$ sudo nano /etc/nix/nix.conf

# after edit, contents of conf file are
build-users-group = nixbld
experimental-features = nix-command
substituters        = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=volume

# restart Mac (confirmed this step is needed, or cache isn't recognized)

# clone plutus-apps repo
$ git clone https://github.com/input-output-hk/plutus-apps

# cd into plutus-apps
$ cd plutus-apps

# checkout latest commit
$ git checkout 41149926c108c71831cfe8d244c83b0ee4bf5c8a

# build server (confirmed after mac restart, cache is recognized and this builds in 1-2 min)
$ nix-build -A plutus-playground.server

# enter nix-shell (as expected, first time always takes ~1 hour)
$ nix-shell

# once in nix-shell, run playground server
$ cd plutus-playground-client
$ plutus-playground-server

# server builds successfully, output printed below:
plutus-playground-server: for development use only
[Info] Running: (Nothing,Webserver {_port = 8080, _maxInterpretationTime = 80s})
Initializing Context
Initializing Context
Warning: GITHUB_CLIENT_ID not set
Warning: GITHUB_CLIENT_SECRET not set
Warning: JWT_SIGNATURE not set
Interpreter ready

# in second terminal, enter nix-shell
$ nix-shell

# attempt to run client
$ cd plutus-playground-client
$ npm run start

client starts building, but always runs into the following error.
plutus-playground-server: user error (Error evaluating simulation: InterpreterError (CompilationErrors [CompilationError {filename = "\n/private/tmp/web-ghc-work-81ca65233755c126/Main.hs", row = 2, column = 1, text = [" error:","    Could not find module \8216Playground.Contract\8217","    Use -v (or `:set -v` in ghci) to see a list of the files searched for.","  |","2 | import Playground.Contract","  | ^^^^^^^^^^^^^^^^^^^^^^^^^^"]},CompilationError {filename = "/private/tmp/web-ghc-work-81ca65233755c126/Main.hs", row = 3, column = 1, text = [" error:","    Could not find module \8216Plutus.Contract\8217","    Use -v (or `:set -v` in ghci) to see a list of the files searched for.","  |","3 | import Plutus.Contract","  | ^^^^^^^^^^^^^^^^^^^^^^"]},CompilationError {filename = "/private/tmp/web-ghc-work-81ca65233755c126/Main.hs", row = 4, column = 1, text = [" error:","    Could not find module \8216PlutusTx.Prelude\8217","    Use -v (or `:set -v` in ghci) to see a list of the files searched for.","  |","4 | import PlutusTx.Prelude","  | ^^^^^^^^^^^^^^^^^^^^^^^"]}]))
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! plutus-playground-client@1.0.0 start: `plutus-playground-generate-purs && npm install && npm run install:spago && npm run build:webpack:dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the plutus-playground-client@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/gmoratorio/.npm/_logs/2022-01-14T20_08_36_926Z-debug.log

It looks like it can't resolve several dependencies
Playground.Contract
Plutus.Contract
PlutusTx.Prelude

but I can't figure out how to fix the resolution.
I've tried wiping my install and starting over several times including running
nix-collect-garbage
nix-build -A plutus-playground.server

after reinstalling nix, and every time I get the same dependency resolution error.
Any help or ideas would be appreciated

This solution https://cardano.stackexchange.com/a/6451/2758 is what finally did it for me:
GC_DONT_GC=1 npm run start

instead of just
npm run start
Heads up to anyone else seeing this issue!
Edit: to clarify, I'd already seen that post, but when OP said the cache clear had resolved the issue for him, I figured it was something else affecting my build (and it was). Thanks to the last commenter on that thread!
Edit2: immediately after solving this issue I ran into dependency issues when trying to compile in the playground. This was resolved by restarting the server with the same prefix
GC_DONT_GC=1 plutus-playground-server

and then reconnecting the client. This post also contains additional steps - https://github.com/renzwo/cardano-plutus-apps-install-m1/blob/main/README.md

I can confirm this worked for me, darn GC_DONT_GC=1.  macOS i7 monterey (v12.1). Else when I compiled in the playground I got "error Could not find module"

This solution fixed it for me: https://stackoverflow.com/questions/42308879/how-to-solve-npm-error-npm-err-code-elifecycle

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


text:
plutus-playground-server: user error (Error evaluating simulation: JsonDecodingError
I'm following the first lecture in the plutus pioneer program but I cannot set up the local environment. The error happens when running npm start on a nix-shell after initializing the playground server.
The following purescript packages are needed by the generated code:

  - plutus-playground-client
  - purescript-either
  - purescript-foreign-generic
  - purescript-maybe
  - purescript-ordered-collections
  - purescript-profunctor-lenses
  - web-common

Successfully created your PureScript modules!
plutus-playground-server: user error (Error evaluating simulation: JsonDecodingError {expected = "EvaluationResult", decodingError = "Error in $: not enough input", input = ""})

I'm using windows 10 with WSL2

I would recommend opening an issue on the plutus issue tracker for this kind of case: https://github.com/input-output-hk/plutus/issues

Might be this? "If you're using Windows and WSL, make sure the plutus repo clone is located in the WSL filesystem" (https://stackoverflow.com/questions/68276780/plutus-playground-client-cannot-run)

No, it is located in the WSL filesystem. I'm planning to switch to ubuntu

Did you ever find the solution? I have the same issue...masOS i7 Monterey.

I recommend installing Virtual Box and using NixOS or just installing NixOS on a flash drive.
Here is an installation guide.

Thanks for your answer, but this is not really a solution to the problem

Are you running in a Nix shell?

Yes, It is activated


text:
Ambiguous type variable ‘e0’ arising from a use of ‘endpoints’
I'm writing emulator trace tests for the spacebudz contracts. Here is a minimum example:
{-# LANGUAGE DataKinds             #-}
{-# LANGUAGE FlexibleContexts      #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NoImplicitPrelude     #-}
{-# LANGUAGE OverloadedStrings     #-}
{-# LANGUAGE ScopedTypeVariables   #-}
{-# LANGUAGE TypeApplications      #-}
{-# LANGUAGE TypeFamilies          #-}
{-# LANGUAGE ExtendedDefaultRules  #-}

module Test.EmulatorTrace where

import           Control.Monad           hiding ( fmap )
import           Control.Monad.Freer.Extras    as Extras
import           Data.Default                   ( Default(..) )
import qualified Data.Map                      as Map
import           Ledger
import           Ledger.Ada                    as Ada
import           Ledger.TimeSlot
import           Ledger.Value
import           Plutus.Contract.Trace
import           Plutus.Trace.Emulator         as Emulator
import           PlutusTx.Prelude
import           Prelude                        ( IO
                                                , Show(..)
                                                )
import           Wallet.Emulator.Wallet

import           Contract

test :: IO ()
test = do
  test'

test' :: IO ()
test' = runEmulatorTraceIO' def def myTrace

myTrace :: EmulatorTrace ()
myTrace = do

  h1 <- activateContractWallet (Wallet 1) endpoints
  callEndpoint @"init" h1 ()

  void $ Emulator.waitNSlots 10

However, when trying to activate the wallets for the emulator, I get this error:
src/Test/EmulatorTrace.hs:45:43: error:
    • Ambiguous type variable ‘e0’ arising from a use of ‘endpoints’
      prevents the constraint ‘(Wallet.Types.AsContractError
                                  e0)’ from being solved.
      Probable fix: use a type annotation to specify what ‘e0’ should be.
      These potential instances exist:
        two instances involving out-of-scope types
        (use -fprint-potential-instances to see them all)
    • In the second argument of ‘activateContractWallet’, namely
        ‘endpoints’
      In a stmt of a 'do' block:
        h1 <- activateContractWallet (Wallet 1) endpoints
      In the expression:
        do h1 <- activateContractWallet (Wallet 1) endpoints
           callEndpoint @"init" h1 ()
           void $ waitNSlots 10
   |
45 |   h1 <- activateContractWallet (Wallet 1) endpoints

How is it possible, when every contract example has the same code?

This is changed in newer versions so you need to change:
h1 <- activateContractWallet (Wallet 1) endpoints

to
h1 <- activateContractWallet w1 (endpoints @ContractError)

For w1 you need to import Plutus.Contract.Test and for ContractError Wallet.Types

Well, it's because you're not specifying where the endpoints variable comes from. So, basically the error is saying: You've various instances of endpoints variable, which of those is it?
Try to specify it on your imports, something like this:
import OffChainCode (endpoints)
And if your offchain code is in the Contract file, try to change the name of the module Contract, as it's a Plutus type.

I think your endpoint looks something like this
endpoints :: forall  e. AsContractError e => Contract () yourSchema e ()

now in TraceMonad its confused what type should we put for variable e.
if you change your endpoint definition  to
endpoints :: Contract () yourSchema Text ()

This worked fine for me as now we are passing concrete types for endpoint.


text:
Data and metadata protection
Original question:
Where is confidential data held and how is access to it controlled?
response:
It depends on the context, but if you include metadata in a transaction, those metadata will be publicly available. However, you can always encrypt your metadata. When you encrypt metadata and attach it to a UTXO, whoever else has the secret key to decrypt those metadata will be able to read decipher it, but nobody else will be able to.
Additional questions related to above:
For holding confidential data: I see how encrypting data on chain can keep it confidential for some years until the crypto is broken and maybe that’s OK for some data and expectations of confidentiality. Quorum (when last I spoke to them) don’t put encrypted data on chain since they share my assumption that crypto works for a limited time. How would access to the secret key you mention be tied to UTXO? I don’t see that linkage

Blockchain is not designed for use in communication/secure storage. It is ideal for proving the existence of a digital resource at a point in time. Therefore it is not supporting the exchange of encrypted data or its key.
However, if you want to prove that you are holding a digital copy of some file you can post the hash of that file as metadata in the blockchain. Say after 10 years if someone denies that you had access to the document you can prove them wrong (Proof of existence).  Proof of ownership of an asset and proof of the existence of an asset is the primary service of the blockchain.


text:
Validating transactions
Original question:
When 51% or more of consensus participants validate any transaction for recording on-chain, against what evidence are they validating?
Original Answer:
Each transaction is broadcast, and the slot leader creates a block from all of the transactions in a given slot. That block is then broadcast to the rest of the network. The network relays the blocks until everyone has a copy, and each time a block is relayed, information about the sender is verified. See Ouroboros Praos for the set of properties tested when receiving a transaction.
Additional question related to original:
What I really wanted to explore was whether the data required for truly validating the correctness of any transaction is viewable to the participants or if it’s held confidential (like it might be encrypted) would that validation really mean anything? With bitcoin, everyone can see whether you have enough coin to give away what you propose to give; but if there’s a scheme where information like that is confidential, then the validation means nothing and few would want to participate in a transaction that cannot be validated. There will be some contradictions that will find their ways into these new systems.

Every block contains enough information to validate that
a.) The pool that produced the block was allowed to produce the block in that slot. The header contains a proof and hash of the pool's vrf keys that any consumer of the block can verify.
b.) Every transaction in the block is signed by the appropriate keys that allow the transaction to spend the utxos.


text:
Access Control for my company's vehicle
I wish to delegate access control with a Phone-As-A-Key DApp for vehicles (for sharing the vehicle, P2P rentals and more).
When delegating access control, the DApp will update a smart contract which needs to be downloaded in the vehicle (so it knows a new user should be whitelisted and so they Phone as a Key will open the vehicle).
Question: how many transactions do you foresee here and what shall the cost be.  Obviously, we cannot have customers (or us) paying large amounts of ADA to delegate access control.

This is hard to answer without an intricate understanding of the business logic around the vehicle unlocking.
I assume each car has its own smart contract and you want to whitelist a user for a pre-determined time. For simplicity I assume that we're happy for time to be measured in slots, with the business logic working out time->slots happening off-chain. This would mean all we need to do is send a users identifier to the smart-contract with the time-frame. By checking the users time-frame against the node when unlocking the car you'd be able to limit this to a single transaction like:
{
    user  Address
    start Slot
    end   Slot
}

Another way to go would be to update a smart contract with Lock and Unlock events setting an Address value and checking this value against the users phone when they attempt to unlock the car. However this would require two transactions and constant internet access to receive the second event.
In terms of transaction spend, one of the perks of Plutus is that you can calculate the cost of a contract up-front and failed transactions don't cost anything. That way you can show the user the fee at the checkout without any surprises. It also means you can prototype this contract and check the cost yourself. As I said without really understanding how you want this contract to work it's difficult to come up with a $$$ value.


text:
What is the cost (in ADA) of transferring ownership of NFTs?
I have a project underway using private Eth network (zero tx costs) where NFTs transfer ownership very frequently between various owners.  I wish to move to Cardano for its completeness and security but am concerned about the TX fees for attempting to accomplish this.  Can we presently calculate the price of transferring ownership of an NFT?

A good way to answer your question would be to find a transaction on the Cardano mainnet and see how much it cost.
Cardano Scan has a great lookup tool to see all token transactions
I picked a transaction at random which contained the transfer of a single native asset.
This shows that there were:

16.0 Ada of Inputs
A fee of 0.234405
"Change" of 14.265595 sent back to the sending address

This means a total transaction "cost" of 1.734405
That cost consists of:

The fee of 0.234405
A minimum Ada cost of 1.5

There are a few good references to understand how these costs are derived, as it depends on Cardano parameters but hopefully this example gave you an idea of the cost.
If you want to port your application across to Cardano, there is a great Technical Dev Guide you can use specific to minting NFTs.
Maybe the NFT will be worth more now that it is in a stack exchange answer!? :)

Ouch, that pretty much halts any hopes I had for moving onto Cardano.  I am not saying Cardano is expensive, I was just hoping it would be a little less so.  Thank you for your help on this!

Note that the minimum ADA cost isn't a fee. You can ask the NFT buyer to send the minADA with his request, and you send him back the NFT + minADA. Costs on Cardano are deterministic, so you should be able to calculate the minADA required for a specific NFT.

Thank you for this, I was not aware of this fact.  Ok, so the 1,5 ADA can be sent back and forth, and the fee is only 0.23 ADA (in the above use case).  However, this unfortunately is still very expensive for using ADA for something like access control, we could hardly expect customers to pay 0,23 ADA for doing something simple like granting vehicle access to others.  Then again, this will be even more, as it will be interacting with a smart contract, and the above fees are only for moving NFTs... I wonder how expensive smart contracts will be to use... Thanks again!

It should be possible to do this for no cost in an hydra head when hydra will be available.


text:
Questions about the ISO Model (Sundae Swap)
I have two questions about ISO project launches, such as Sundae Swap:

What happens to the ADA security model if more and more people re-delegate their stake into the Sundae Swap ISO stake pool for their rewards, possibly drastically reducing the number of other pools?  Are we just hoping this won't happen?
Pools can only stake so many ADA before they earn reduced/zero additional gains, so how can Sundae Swap simply tell everyone to jump into a single pool?  If too many jump in, won't this be a waste of reward earning potential?  Or shall they have numerous pools running?
Thank you

There are several pools doing this, for example the MELD pools are also doing this. There is no reason that everyone would just choose one project among them and stake with them. And anyway, those projects have no interest in doing so because then the cardano blockchain, and thus their project, has no value anymore.
Moreover, it is not very different from mining pool that mine in one cryptocurrency (say ETH) and pay miners in another (say BTC). As long as there is a competition for rewards the game theory remains the same.

Yes, they can just create more pools. There are 8 MELD pools for example.


text:
Design considerations when automatically signing and submitting Cardano transactions
Automating transactions (eg an Oracle that regularly publishes meta data to the blockchain) require that we balance the necessity to sign each transaction using a signing key with the security of the keys themselves.
What approaches have you and your projects used to tackle this problem? And, how does the approach change as an application's developer team grows?


text:
Could Project Catalyst explain why the iOS release process is so poor?
The IOHK dev team is very impressive and it is somewhat startling that the Project Catalyst iOS App (and maybe Android as well?) has a janky release process.
There is no visibility and I wonder if there are  some specific Github issue that explains the problem?  My assumption is that this is because the code is written in react-native?
Any clarification will be help.

The Catalyst app is a work in progress and has been improving over time. What was once just IOHK is now many development teams working on scores of projects, and the team responsible for Catalyst may be prioritizing the website over the iOS app, and this is not even to mention that they have to develop an Android app simultaneously as well. It is a lot of work =^).

Sure. I understand. I have been invested in ADA for a few years and I'm an iOS developer.  But this is a process level issue.  The versions of the Catalyst app have no continuity.  The fact that there is no good process to retain the QR code and PIN is not the best trade-off.  FWIW, the other teams have really nothing to do with the iOS and Android teams.


text:
What are the ways to make a validator script start to "live" on-chain?
What are the scenarios in which a validator script will start to "live" on-chain? By "living" on-chain, I mean there is at least one UTxO sitting on the script address.
A trivial answer is anyone sending some ADA to the script address of the validator script will create an UTxO sitting on the script address.
Another possible solution is having a "parent" validator script that is designed in a way such that consuming it will lead to creation of an UTxO sitting on the script address of a "child" validator script.
I wonder if there are any other ways.

Having an UTxO that a validator can spend doesn't activate the validator ( I suppose that's what you mean by "live" )
the validator only executes when trying to consume one of his UTxOs, but NOT when creating an UTxO.
So a validator only "lives" when spending (or minting, or staking), but in general is just a passive address.
You can think at validators as a person that makes the decision to sign a transaction based on a set of instructions (Plutus)
You as a person can receive ADA or Token without your need to allow the transaction; on the contrary, you as a person have to allow a transaction that uses one of your UTxOs by signing it, following your own logic
the same is true for validators, anyone can send ADA or tokens to them without any logic that allows that, but in order to spend a validator UTxO you need to run his logic, which makes him live

Yeah, you are absolutely right about script address being passive. My question wanted to know different ways to create an UTxO sitting at a given script address. There are already two ways that I have mentioned in the question. I just wanted to know any other possible ways to achieve it.

@Qin then what you are asking is for all possible ways to create an UTxO, and as the name "Unspent Transaction Output" implies, you need a transaction for that, no other ways

That is for sure that a transaction is needed. The two ways mentioned in the questions are two different types of transactions that can create an UTxO sitting at the script address. I was wondering if there were additional types of transactions other than the two mentioned in the question that can also create an UTxO sitting at the script address.


text:
How to make the ThreadToken for a StateMachine available to and verifiable by every participant?
In a StateMachine, TreadToken can be used for uniquely identifying the "genuine" UTxO sitting at the validator script of the StateMachine. A TreadToken is automatically created when the StateMachine is created by the first participant (wallet).
My question is how the other participants (wallets) can get the ThreadToken created for the StateMachine? Besides, when a participant somehow receives a ThreadToken, how can he/she verify that the received the TreadToken received is authentic?

They have to check that the state token is minted with the default minting policy.
The default minting policy and SM validator are coupled so that if this is verifiable, then all is well.

A TreadToken is automatically created when the StateMachine is created by the first participant (wallet).

Not necessarily. You can "Start" a SM by sending a UTXO to an address that corresponds to a SM. This is precisely why you might want to verify that the the thread token is an NFT.
If the default minting policy is not used then they'll need to do more homework. Again this might be fine. It might not.
It's possible to replace the default minting policy with a non-parameterized minting policy that shoe horns the uniqueness into the token name only.
In this case it would be much easier for a user to verify uniqueness, provided a trusted source has already verified "This CS will only make NFTs"
(policyId is a synonym for currency symbol)
An aside. It might also be desirable that the thread tokens aren't NFTs.
More generally, there are many ways you might want to modify the implementation of statemachine as available in Plutus. Its just one way to do it.

Thanks. But is it possible to derive the currency symbol of the default thread token from its state machine?


text:
To use state machine or not to use state machine? This is a question
Some validator scripts can be implemented with or without state machine. This is a decision that has to be made by the developer.
I wonder what are the pros and cons of using state machine. What factors should be considered when making the decision.

A state-machine gives you a framework for testing and reasoning about your code. It's generally much easier to think in terms of state machines where transactions are transitions, every transaction is one transition from one state into another, so knowing the initial conditions, you can think about what should be the outcome and test for it.
One "direct drawback" of representing things as state machine is that it forces you to include datums of both inputs you spent but also outputs you send to (since your validator must control the transition goes into the right state). There are cases where you may not want to reveal the datum upfront and obfuscating behind a hash is quite handy.
Another drawback is the maturity / usability of the current state machine framework in PlutusTx. Works well enough for simple scenarios but gets in the way of more complex cases and, adds a non negligible overhead. Yet, implementing a state-machine by hand is relatively easy.

Can you provide some example for "gets in the way of more complex cases"?


text:
Is it possible to upgrade a State Machine?
I wonder if it is possible to design a State Machine that has a special state transition that can upgrade the State Machine, meaning creating a new UTxO sitting at a new script address (instead of the old script address), representing the upgraded State Machine. After the upgrade, future transactions will be validated using the new State Machine.
I am not sure if this upgrading functionality is achievable using State Machine. If so, how can it be achieved?

Make a statemachine with a transition "Update".
Use Constraints (or otherwise, eg check) to layout in which contexts an "Upgrade" is permissible. For example "must be signed by my special key".
Make the upgrade target state a final state (isFinal s == True)

Et voila. You have "upgraded" your statemachine.
Obvs cardano validators are immutable - you can't upgrade them in the "mutate a thing" way

Thanks! Your approach will finish the current validator. I think additionally the update transition has to explicitly guarantee the creation of an UTxO sitting on the updated validator, to ensure the updated validator will be available.


text:
How can a validator script be used to mint native tokens, in addition to perform other checks?
Suppose we want a smart contract (validator script) that locks a user' fund (e.g. ADA) that she deposits and releases it back if she withdraws it. Suppose when she deposits some fund into the validator script, we want in the same transaction the validator script sends her wallet some native tokens as a proof of deposit.
In this scenario, how can the validator script mints some native tokens in the same transaction as a user sends some fund to the validator script?

You need a separate minting policy to mint the tokens.

we want a smart contract (validator script)

I tend to think of smart contracts as including a set of validators and policies, not just one script. It's typical to use multiple in concert.
Essentially the validator holds an NFT with a datum tracking the contract's state. The validator constrains any transaction spending the datum, and checks that the transaction

deposits/withdraws the correct amount,
mints/burns the correct amount, and
replaces the NFT + datum with updated state

The the minting policy will only mint if the NFT is spent--all the logic is on the validator side.
Check out the discussion on "dummy nfts"/"access tokens" here to get a better idea of how that would work.

Great explanation, I am a little confused why you'd put all the logic in the validator.
In the case of depositing money at the contract address, I'd expect the minting policy to run as well + make sure a corresponding output with ADA is created at the script address or did I misunderstand? I don't see how else the validator script would run if there is no output spent in the case of a depositing action.

Hence, I'd almost say the minting policy could do most of the logic except for validating withdraw ownership based on simple pubkeyHash comparison. But it could certainly ensure deposits to be correct (output at script address with equal amount to minted native token). And also burns which check if a corresponding withdraw is done too...
Please let me know if I misunderstand the context.

"make sure a corresponding output with ADA is created at the script address"--that's what I'm saying with "replaces the NFT + datum." Datums must exist on an output. If the validator is already checking that, it would be redundant to have the policy check it again. You could definitely have the minting policy check other things, but remember policies don't have any state, just tx context. There is no datum on the policy. So, if you ever want minting to rely on some state, you need need some validator to manage that state for you. I think it's best to keep all the logic in one spot.


text:
Can UTxO sit at a minting policy (currency symbol), like at a validator script address?
Both minting policy and validator script are on-chain code. Validator script can be used to lock fund sitting at its validator script address. A transaction can consume the UTxO only if the validator script successfully passes the validation.
Is it possible for an UTxO sitting at a minting policy (i.e. its currency symbol), so that a transaction that successfully consumes the UTxO by passing the minting policy can mint some native tokens?
My understanding is no because minting policy is only a part of a minting transaction but is not supposed to be the script address of an UTxO. Minting native tokens does not work the same as consuming an UTxO sitting at a script address. But I am not sure about my understanding.
Hope someone could help clarify.

As you said, minting policies is part of a transaction and and is not part of a script address UTxO, so it doesn't make sense saying "UTxO sitting at a minting policy", since the minting policy simply allows the minting / burning of native assets or not, it doesn't sit anywhere.
The answer to your question, though, is unexpected. You can create a minting policy that only validates if a certain script is being consumed. You would just need to confirm (in the minting policy) that a certain script is present in the input.


text:
How to check the output datum reference in V2
The following code would work for V1:
outputDatum :: EkivalEscrowDatum
outputDatum = case transferDatum $ txOutDatumHash ownOutput >>= flip findDatum info of

    Nothing -> traceError "Transfer output datum not found"

    Just d  -> d

However, "txOutDatumHash" seems to be missing a corresponding implementation in V2.
I understand we may face inline Datum, which would not include the Hash, but backward compatibility appears to not be fully implemented on this function.
From the plutus-apps examples, I noticed a mixture of V1 modules whenever the datum was being verified.
PS: transferDatum :: Maybe Datum -> Maybe EkivalEscrowDatum

For plutus v2 you have to differentiate since inline datums could be present at a given output.
outputDatumByHash :: DatumHash -> Maybe Datum
outputDatumByHash h = findDatum h info

ownOutputDatum :: TxOut -> Maybe TransferDatum
ownOutputDatum TxOut{txOutDatum=OutputDatumHash h} = transferDatum $ outputDatumByHash h
ownOutputDatum _                                   = Nothing

outputDatum :: TxOut -> TransferDatum
outputDatum txOut = case ownOutputDatum txOut of
    Nothing -> traceError "Transfer output datum not found"
    Just d  -> d

Looking at the API:
V1's TxOut uses txOutDatumHash :: Maybe DatumHash
V2's TxOut uses txOutDatum :: OutputDatum
where data OutputDatum = NoOutputDatum | OutputDatumHash DatumHash | OutputDatum Datum
So V2 still has DatumHash but you need to also handle the possibility of OutputDatum (inline datum).


text:
Create transaction by cardano-node using payment address generated by cardano-addresses
I'm using Cardano-addresses https://github.com/input-output-hk/cardano-addresses. I have a problem when try to make a transaction by using cardano-node using address generated by cardano-addresses.
So what I did is :

generate a root private key (root.xsk) from recovery phrase.
generate a payment verification key (addr.xvk)
generate a payment address from a payment key (payment.addr)

And the when I tried to make a transaction using that (payment.addr),
I don't know what signing key should I use to sign this transaction:
cardano-cli transaction sign
--tx-body-file body.raw
--testnet-magic 1097911063
--signing-key-file  what_key_should_I_use
--out-file signFile.signed

Please help me

Great question! Fundamentally, you want to use cardano-wallet to replace the following script in cardano-cli.
cardano-cli address key-gen \
 --verification-key-file key.vkey \
 --signing-key-file pkey.skey

In this tutorial, I will show you how convert the keys from the wallet format into the cli format.
First, create your recovery phrase and then a private key from that phrase. You have probably already completed this step, but here is an example:
cardano-address recovery-phrase generate --size 15 > phrase.prv

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

Just for safety, let's go ahead and create a child key from that root key. It is not necessary, but we should get into in the habits of good security practices.
cat root.xsk | cardano-address key child 1852H/1815H/0H/0/0 > key.xsk

We have created our root.xsk and then from it our key.xsk. We want to use key.xsk to sign transactions. However, if you try to put it directly into cardano-cli, you will get an error. Even if you were to put it into a JSON format, you still would not be able to use it. We have to convert it into a different format vis a vis the following:
cardano-cli key convert-cardano-address-key --shelley-payment-key --signing-key-file key.xsk --out-file key.skey

Now we have converted our key.xsk into a key.skey. Now we have to create a verification key:
cardano-cli key verification-key --signing-key-file key.skey --verification-key-file key.vkey

Excellent! Now we have a key.skey and a key.vkey. You know what to do! Go ahead and create an address...
cardano-cli address build --payment-verification-key-file key.vkey --out-file key.addr --testnet-magic 1097911063

...and then build the transaction.
cardano-cli transaction sign \
--tx-body-file body.raw \
--testnet-magic 1097911063 \
--signing-key-file key.skey \
--out-file signFile.signed

Boom! You should be done!
We went from our child key.xsk, which looks like
{
    "chain_code": "4bfecd01af45a1abde446ec69522867a309f927f61a26d286d2475369e888e46",
    "key_type": "private",
    "extended_key": "c024ea34b52056996acb2f8f7d74b78b610ed773fb4ff6b933e460714dd8455edf6ea0b09c190126d364e69df714aef5824c7630f7b70e42050149f98b704448"
}

to our key.skey, which looks like
{
    "type": "PaymentExtendedSigningKeyShelley_ed25519_bip32",
    "description": "",
    "cborHex": "5880c024ea34b52056996acb2f8f7d74b78b610ed773fb4ff6b933e460714dd8455edf6ea0b09c190126d364e69df714aef5824c7630f7b70e42050149f98b7044480782a02ee41c9d7455faf2df6f36edb0c9d0c2c31eaf9e2f10f255ead21f53074bfecd01af45a1abde446ec69522867a309f927f61a26d286d2475369e888e46"
}

Sources
A great reference produced by the Cardano Foundation
The associated examples

Sorry for the late response. Thank you. Let me try to do it. I will give back the result asap

How did you venerate your addr.xvk? What derivation path did you use?
You need to use the private payment key to that specific derivation path.

https://github.com/input-output-hk/cardano-addresses . I created addr.xvk from root.xsk as the README of this article


text:
What happens if someone gets my seed phrase?
If someone happens to get my seed phrase (off a paper I wrote it on) can they restore my Daedalus wallet on another machine and take my ADA?

The seed phrase is used to generate your private keys (and thus your public keys as well). If someone has access to your seed phrase, they can "restore" your wallet Yoroi, Daedalus, or any other wallet application and can do anything with your wallet that you could do. The only way to know if this has happened is to notice any transaction sending Ada or a token from your wallet that was not done by you. If you have any doubt, just create a new wallet and transfer all of your tokens and then funds from your old potentially compromised wallet to your new wallet.

As others have stated, yes they can restore your wallet and yes they can take all your ada and anything else associated with it.
With that said, here are some tips for securing your mnemonic phrase.
1.) Do not store these phrases on a computer. And if you must, do it on a air-gapped machine.
2.) Make sure you protect yourself from natural disasters. For example what if your house burns down, burning your computer with the restored wallet as well as the piece of paper the mnemonic was on? I personally stamped mine into a metal plate and keep it in a fireproof safe.
3.) Make sure you include instructions in your safe for a what to do with it in case you die. Personally my family does not know much about crypto so I would want my beneficiaries to have instructions on what to do. This way a loved one gets those gains in case something were to happen to you.
4.) Bonus tip, get a hardware Wallet like a Ledger X. This insures that your keys are not compromised in the making of your wallet. Although probably unlikely, it is possible that your internet connected device, you make the wallet on, is compromised. If it is, there is a possibility your wallet is too.

Yes. If someone get your seed phrase, he will be able to steal all your funds.

In addition to securing your seed phrase using the above methods, you may also want to memorise it. You can do that by grouping it sets of maybe four and creating silly sentences each containing four of the words. Every three days, write down the sentenses while highlighting the keywords. Do that for some months and it sticks.
This way, if I ever need to move my funds in an emergency (like suspecting someone may have had access to the physical backup), I can move fast by downloading a wallet anywhere and importing the wallet from my memorised seed phrase and moving the funds.


text:
I exchanged for AGIX tokens on my Trezor One but cannot access them. Any ideas on how to get them?
It shows on my Trezor One that my AGIX tokens were rexeived but my Etherium account shows nothing there. Do I need another wallet to sync with my Trezor in order to access these tokens. I would like to eventually convert them and hold them on the Cardano blockchain.

This question is not about Cardano, try to ask in the SingularityNET specific channels.

it is about Cardano in the sense that I am trying to convert these tokens to be used on the Cardano blockchain. I am trying to use the Erc-converter to move these tokens from Etherium to Cardano.


text:
What is the point of borrowing on Defi
In order to take out a loan on a Dapp you have to come with collateral. Whatever you cannot pay back on the loan,  you lose that amount in collateral and the interest accrued. That being the case what is the point for the average user to borrow on Defi? It seems only suited to traders to leverage their money. Is there another use case that anyone knows of?

I personally have many ideas. Some people need to borrow and that's OK. If I were to lend someone money though, I'd expect interest to be paid and the principal to slowly go down and usually, one would go through a bank with lawyers so it will be fairly costly for all this so there are minimums to reach before it becomes profitable to the Everyman. This clearly is an issue if we are to have safe, inclusive and decentralised finances.
Another reason is accessibility. Have you ever asked your bank how much it costs to use their API? Ring them, try it, their only line of questioning will be to ascertain how much they can get from you. With a smart contract, you could, depending on provider, interact with you SC at low cost or you can use your own node / code for free. Bet your bank won't do that.
To summarise, average user won't have immediate benefit other than reduced fees ( which add up quite quickly). So how is it going to change the world? It won't. The old world will simply die, as it does every generation, leaving behind a new people who are more technically knowledgeable and with that, these automated systems will allow users to interact with their finances.
This is obviously my own opinion with no historical backing (as there exists, none) and not everyone will agree. Heck, not sure if I do.So many moving cogs. But as I see it, right now, to the average person, I'd see more benefit in using fiat loans until a point where usage and value of crypto stabilises and only at that point in the not far away future, will it be globally beneficial.

Thanks for the thoughtful answer. I've been bouncing these ideas around in my own head too and I agree. These technologies are new and will eventually  be adopted by the masses and provide much greater efficiencies in financial markets, disintermediating great swaths of the economy. Let's see how long it takes!! I just don't see myself taking out a crypto loan on one of these dapps. I am happy to provide liquidity and make some interest, but I have no idea what I would do with a loan. Not interested in high stakes trading.

I recently borrowed some funds on Defi. The reason I borrowed was so I didn't have to sell my crpto. The collateral required was 4 times the loan. The loan was at 1% interest and my interest on the Defi token paid the 1% interest. I've paid back the loan and the only advantage I see is I didn't initially have to sell my crpto. But when I paid back the loan I had to sell crypto at a lower price because I needed to withdraw some funds permanently. The only way I will take another loan is if the collateral coin is in the initial stage of a bull run. Otherwise, it's best to just sell crypto for needed funds.


text:
How to comply with proposed EU funds transfer regulation on crypto asset transfers?
If you look at the proposal, it requires crypto transfers between virtual/crypto asset service providers to transfer originator and beneficiary name (and some other originator info). However, this data could be carried also outside blockchain.
https://ec.europa.eu/finance/docs/law/210720-proposal-funds-transfers_en.pdf
How could Cardano comply with this upcoming regulation? Could it be done somehow for example via Atala Prism (or other id, like the upcoming EU e-id) , by enabling the e-id owners to consent the VASPs to consume this particular information, when (or actually before) the transaction is carried over the blockchain?
I hope this question falls with the scope of the cardano stackexchange. :)

At the base layer, Cardano can't provide such information because it's not built to do that. Atala Prism could be used to get around that however, you can't force anyone to use that layer to transact any more than forcing someone to reveal their seed phrase.

Agree. Still, the challenge remains. Perhaps Cardano will some day become a 'qualified electronic ledger' in terms of the proposed EU ei-id regulation (yes, another proposed regulation, link below), and even manage then to utilize the Atala Prism within the EU e-id scheme. (https://digital-strategy.ec.europa.eu/en/library/trusted-and-secure-european-e-id-regulation)

Cardano becoming a "qualified electronic ledger" means we'd have to make base layer changes for the EU which won't happen. Governments don't understand that blockchains don't care about them. CCP has all authority in their nation and the best they can manage is incentivizing bitcoin miners to leave and go elsewhere. The EU making dumb laws will be no different.

I understand your point. Yet, my thinking was if Cardano as an advanced blockchain (incl Atala Prism) could more easily adapt, and not necessarily on base layer. For example, I have understood Cardano transactions can carry metadata and b) the payer info need not be carried on chain. Nevertheless, I do not think it is all bad; EU is definitely trying to ban crypto. And if we try to be practical, then thinking how to adapt is ok, while perhaps not in line with strictest maximalism... But consider this closed from my side just wanted to bring this to the light for any opportunites that may exist

EU is not trying to ban crypto, I tried to write. :)

How about storing it in transaction metadata?


text:
Will Hydra (or anything else) reduce transaction times for Cardano in the future?
It's been brought to my attention that Hydra will offer all the scaling necessary but will it also make the blockchain faster?
Is it likely Cardano will ever reach an under 10 second time which could be useful in some areas like gaming.

The short answer is: no.
The longer answer is, Hydra is a layer-2 solution which means that by definition, it operates on top of the existing network and does not require, nor implies, changes to that base layer. It means that any improvements to the settlement time of transaction in the layer 1 won't come from Hydra.
Having said that, Hydra allows you to create parallel networks with smaller sets of participants. So it could be leveraged by a decentralized game to move all their traffic onto that parallel network, only to settle at the end of each day for instance. In that sense, they would be offloading traffic from the layer 1 to the layer 2.

As much as I understand, Hydra is the name of the sharding solution of Cardano. I see it as a form of parallel computation: it can handle separately some unrelated computations/transactions. Parallel computation improves the computation/time rate, but it does so without decreasing the amount of time taken by any elementary operation: ten people wash more dishes in one hour than one, but washing one individual dish still takes as much time with 10 people as with one person. It is probably the same for Hydra, so I guess the answer is no.

Yes, Hydra will reduce tx times. When it's live, you'll be able to have payments that live in a hydra state channel, there you can receive Lovelaces as tips and have it happen instantly while paying low or no fees, that depends on the owner of the channel.
It does this by housing most small tx into hydra channels that will settle with the base layer at a later time.
All Plutus smart contracts will work automatically in hydra channels so no changes have to be made to any contracts existing today.


text:
Convert Stake Key to Address
I am tiring to use Cardano Sterilization Lib to get the Stake/Usable address from Stake Hash or Address Hash.
https://adaex.org/address/addr1q8d27ughqsqras7k9wnr4dlustzjlhadhe9rf6t3tr90u5yc4vxfxvmpr0hfktjc7md2n8er05tnurr676n6yq7khcnss8msq0/all-addresses#data
Address Hash: 01daaf711704003ec3d62ba63ab7fc82c52fdfadbe4a34e97158cafe5098ab0c9333611bee9b2e58f6daa99f237d173e0c7af6a7a203d6be27
Stake Key Hash: e198ab0c9333611bee9b2e58f6daa99f237d173e0c7af6a7a203d6be27
I saw Convert xpub public key from ccvault to bech32 or acct_ public key which showed a way but I couldn't get it to work.
wasm.StakeCredential.from_bytes(new TextEncoder().encode("98ab0c9333611bee9b2e58f6daa99f237d173e0c7af6a7a203d6be27"))
returns  Deserialization failed in StakeCredential because: Invalid cbor: not the right type, expected Array' byte received Text'.
Thanks!

You can try with this line:
wasm.StakeCredential.from_bytes(
 Buffer.from("98ab0c9333611bee9b2e58f6daa99f237d173e0c7af6a7a203d6be27", "hex")
)

Alternatively, you can try using from_keyhash method. This method expects to receive a Ed25519KeyHash, which you can build from the given Stake Key Hash, all in the same instruction, like this:
wasm.StakeCredential.from_keyhash(
 wasm.Ed25519KeyHash.from_bytes(
  Buffer.from("e198ab0c9333611bee9b2e58f6daa99f237d173e0c7af6a7a203d6be27", "hex")
 )
)


text:
Get wallet ID from Daedalus?
Some of the cardano-wallet API endpoints ask for 'walletId'. Does anyone know where to retrieve this value from Daedalus?  I only see wallet public key/wallet multi-sig public key.

cardano-wallet is able to create/store multiple wallets - https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/listWallets
Daedalus wallet IDs have nothing in common with these - I think you need to re-create the wallet in cardano-wallet using either mnemonic words or using account xPub from Daedalus.
Also check out https://github.com/input-output-hk/cardano-addresses which contains examples of deriving various key types and addresses.

Alright that sounds good. Thank you!

As sorki replied you can indeed run a new cardano-node + cardano-wallet instance and restore the desired wallet by specifying its mnemonic sentence and copying the wallet_id shown in the API response.
Since Daedalus already runs cardano-node + cardano-wallet in the background you could perfectly query that API directly. If you're in a *nix system you could run Daedalus from the terminal like this
daedalus-mainnet 2>&1 | sed -u -n '/cardano-wallet/p' | sed -u -n 's/^.* --port \([0-9]*\) .*$/PORT: \1/p'

to get Daedalus cardano-wallet's port. Also since Daedalus' front-end communicates with Daedalus' back-end using a client certificate you'd have to use the very same one. Their location depends where did you install Daedalus, in my case they're located here
CLIENT_CRT='~/.local/share/Daedalus/mainnet/tls/client/client.crt'
CLIENT_KEY='~/.local/share/Daedalus/mainnet/tls/client/client.key'
CA_CRT='~/.local/share/Daedalus/mainnet/tls/client/ca.crt'

Then you can query the list of wallets and get the wallet_id
curl --cert "${CLIENT_CRT}" --key "${CLIENT_KEY}" --cacert "${CA_CRT}" https://localhost:<PORT_NUMBER>/v2/wallets


text:
Can someone who is familiar with Ouroboros explain its fault tolerance threshold?
Ouroboros claims to be <50% Byzantine fault tolerant with regards to persistence. I was wondering why is it that some other PoS systems settle for 33% (e.g. Casper), when 50% is provably achievable?
In the Ouroboros Classic paper, as referenced in this talk by Peter Gazi (https://www.youtube.com/watch?v=PoNaw-Mtxgo), it seems like all that is needed to achieve <50% fault tolerance is simply to have a sequence of random slot leaders create new blocks. That's all the forkability analysis and persistence/liveness conclusion with probabilistic finality seems to depend on (probability of forkability falls exponentially with length of the characteristic string with p = (1-e)/2). So why are some PoS chains out there still 33% BFT? Don't they all pretty much follow a slot leader system like Ouroboros, and thus should also have 50% BFT by this theorem?
I understand that in the Classic paper they assume synchrony. But this assumption is relaxed in Ouroboros Praos, with the same 50% BFT.
Does it have something to do with absolute finality vs probabilistic finality? I.e. does Casper achieve absolute finality, and in doing so have to sacrifice the fault tolerance somehow? Is there another factor?
Thank you!


text:
Hardware requirements for node
Would Raspberry Pi 4 with 4GB with Ubuntu 20.04 LTS. Is that enough to get started running the test mode?

As per the last release of cardano-node.
Minimum System Requirements:

An Intel or AMD x86 processor with two or more cores, at 1.6GHz or faster (2GHz or faster for a stake pool or relay)
16GB of RAM
120GB of free storage (200GB recommended for future growth)

However, you might get away with your setup, but do not be surprised if not :)

I run PGWAD pool on raspberrypi 4.
There is an alliance of pool operators running on raspberry pi.
You can find details here https://armada-alliance.com/
There are guides to help you setup pool.

I run a cardano-node 1.27.0 relay on a Pi4 8GB, and the RAM is often used at around 7-7.5GB.
My x86 relay is now compiled to cardano-node 1.29.0 and after 12 hours seems to be running around 5GB, so perhaps some memory optimizations are in there.
Try it.  If you are just missing enough RAM, maybe zRAM can help.


text:
Listing all cardano tokens using cardano db sync
I am currently starting out with cardano db sync and wanted to ask if it is possible to obtain all native and nft tokens and their metadata using cardano db sync? could someone guide me? I can't seem to find sufficient resources for beginner like me.

You can join the ma_tx_mint and ma_tx_out tables to utxo_view. This will only get you the policyid and asset name (hex encoded) for an asset though and you need to query the metadata server to get any other information about the tokens.