New answers tagged

0

I can't speak for yoroi, but nami is another light wallet. It interfaces with the chain using the blockfrost api. This handles talking to the nodes. Nami now lets you point it at a node of your choice https://twitter.com/pernistoken/status/1485563609560551428 Other light wallets do something analogous.


0

You're correct - Daedalus runs a full node on the local PC, so transactions initiated on Daedalus are submitted through the local running node. The same is true for transactions submitted using cardano-cli or cardano-wallet - they use a locally running node. For other wallet software(s) like Yoroi, Nami, etc that are browser extensions, they submit ...


2

It is provided by haskell.nix. See: https://github.com/input-output-hk/plutus/blob/184f27c67dc696f4dfd558e0ccdfef0f054b519b/nix/pkgs/haskell/materialized-linux/default.nix#L224


1

"Unpaired digit" is an error from the fromHex function, which needs pairs of hexadecimal digits. So I think the error comes from your fifth argument "a12".


0

Plutus provides its own patched version of GHC (8.10.4.20210212) through Nix.


1

Calling findOwnInput in a validator returns the value contained in the Script-UTxO that is currently being validated. In your example above it is the one with 2 Ada in it. Your example above is, however, not correctly formulated: UTXO4 is in fact UTXO2 and UTXO5 is UTXO3, also UTXO7 and UTXO4 are not necessary.


0

• Couldn't match expected type ‘Contract w s e (Data.Map.Internal.Map TxOutRef ChainIndexTxOut)’ with actual type ‘[Integer] -> [TxOutRef]’ • Probable cause: ‘map’ is applied to too few arguments This is saying that it expects a Contract monad but it's getting a function [Integer] -> [...


0

Because this is a utxo system all utxo's must be consumed and the outputs must balance. In the above case, if I understand your code correctly, the redeemer is the unit () which always passes. As such, any input/output consuming the contract would be accepted. You could send 1 ada to someone and send the rest back to the contract's script address (with fees ...


0

This was Lars response to this question in the ppp Q&A on 25/Jan/22. Recording timestamp 0:43:17 You cant retrieve all redeemers at once, You can only see your own redeemer, You are always in the context of validating your specific input, There maybe one or more script inputs, but for each script input the validator is run, and it gets the datum, ...


0

I asked my question in Q&A session 2 (3 cohort) to Lars. His response was that currently is not possible to do it (store only the UTXO's DatumHash (not Datum) in the chain) using PAB. However it is possible using with Cardano Cli.


0

Validators are compiled into Plutus Core language which is human-unreadable. It's not possible to compile something that will be only available at run-time because it's literally not there to be compiled. You can log variables that are available at compiler. GHC Core to PLC plugin: E043:Error: Reference to a name which is not a local, a builtin, or an ...


1

On if it's possible to decode the Plutus code of a given contract, there's a possible duplicate of this question here: Can blockchain viewers read the source code of a smart contract if they know its address?. In case that you want to verify that a compiled code sitting in the blockchain is what their creators claim to be (given that it comes from an open-...


1

The SimpleEscrow use case uses it: https://playground.plutus.iohkdev.io/doc/haddock/plutus-use-cases/html/src/Plutus.Contracts.SimpleEscrow.html#refundEp Another example is the Crowdfunding use case: https://playground.plutus.iohkdev.io/doc/haddock/plutus-use-cases/html/src/Plutus.Contracts.Crowdfunding.html#contribute


0

Yes, I can't think of a reason why they won't work together.


0

Possibly the server part of the playground is not running properly. It could either be it hasn't started correctly and needs another start attempt. Retry the steps here to start the plutus-playground-server https://docs.plutus-community.com/ (or if you're on a new mac, take a look here: https://github.com/renzwo/cardano-plutus-apps-install-m1). The server ...


0

on endpoint call sends 1 to the caller and then the rest back to the contract Remember, the on-chain portion of a contract doesn't do anything actively, it only validates transactions. So a more accurate way to phrase this would be, "the script only validates transactions that spend 1 ADA and return the rest to the script." I think everything you ...


0

As of GitHub commit: cc9b567f3acd813c81e105c074ebd783719c74364c88a78c3c22638322354f6d you can specify extended keys as required signers.


2

Yes. Using ghci in Plutus repo I'll show you how. I will use fully qualified functions for clarity, and don't forget to :set -XOverloadedStrings. Plutus observes all tokens in an output using txOutValue of TxOut. To define our own Value we can do (taken from PPP Lecture#5): > let v = Plutus.V1.Ledger.Value.singleton "a8ff" "ABC" 7 <&...


3

Datums are stored in a hash map per transaction, so if a transaction uses the same datum multiple times, the datum is stored once and only the hashes are stored multiple times. The same goes for redeemers. (I don't understand all the questions, but this is at least a partial answer. Feel free to add to this answer.)


2

You can now use fee estimator at https://testnets.cardano.org/en/testnets/cardano/tools/plutus-fee-estimator/


0

On casual search I think what you need is Ledger.TxConstraint: https://playground.plutus.iohkdev.io/doc/haddock/plutus-ledger-constraints/html/src/Ledger.Constraints.TxConstraints.html


1

This should not be thought of as a scalability problem, but more as a design parameter for whatever smart contract you are building. There are many creative ways in which projects are trying to make the liquidity pools work. SundaeSwap is using the Scooper model, which you can read about here. It goes over the tradeoffs for each popular type of DEX, and why ...


1

Currently, only datum hashes are able to be a part of the UTXO, so you are only able to verify a datum value on chain. Retrieving the datum itself is therefore on off-chain process. However CIP-32 is coming very soon (likely end of February/March) and will enable attaching the datum itself to a UTXO, rather than only the datum hash.


1

I think a misunderstanding here may lie in the fact that the metadata generally is attached to transactions and not directly to the tokens. The way an NFT is connected to its metadata is by looking back at the minting transaction of a token (the transaction that created the token in the first place). And by doing so there is no problem in moving the tokens ...


0

Not entirely sure what you mean by the second part of your question. However, keep in mind that a UTXO is nothing more than the output of a previous transaction. This means that a single UTXO can contain an arbitrary amount of data (currently limited by the transaction size limit). It can be a combination of many different tokens, as well as metadata. The ...


1

Yes. You can just write a grab transaction where the whole 100ADA utxo gift is consumed by creating 2 utxo outputs: 1ADA for the grabber and 99ADA back to the script perhaps with a script update pointing to new output address. If the 100ADA gifts are made up of smaller UTXOs then just choose from those.


0

No, it's a utxo system, so any inputs need a corresponding output. Now, the output could be to the script address itself depending on how the smart contract is written. The NFT auction from week 1 of Plutus pioneers showed how this is done for example.


0

I received this error when running nix-shell from the plutus repository. To fix I exited that nix-shell, navigated to plutus-apps repository, and checked out the appropriate hash from the cabal.project file found in the cabal.project file. Then ran nix-shell from plutus-apps instead of plutus. source-repository-package type: git location: https://github....


0

You want to run GC_DONT_GC=1 npm start We're working on improving this UX going forward, but many community members have been able to get this to work with this flag.


1

I found this /etc/nix/nix.conf to work for my macOS i7 Monterey (v12.1). It was recommended to turn the sandbox FALSE because 'not recommended' per Ref #1 below. build-users-group = nixbld 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+...


1

You should read Plutus starter PAB testnet notes and Hosted PAB setup for Alonzo testnet gist.


1

Interesting, I haven't found one either. If you need the PubKey to compute the hash you can use ownPaymentPubKeyHash


2

You should use ownPaymentPubKeyHash here is the source code. It will work by just replacing ownPubKeyHash with ownPaymentPubKeyHash and return type PubKeyHash to PaymentPubKeyHash.


0

This is my beginner takeaway about Constraints.mustHashDatum after reading about TxContraints and TxConstraint and mustHashDatum at the Ledger.Constraints documentation link below. I will also be interested in the responses so that I can know the answer too. Here are my thoughts. It seems like when we're creating a transaction, we can dictate that one of ...


0

For some reason checking for equality with the TokenName type isn't possible on-chain (at least that's my theory, maybe TokenName itself is not acceptable). Still, you can define your token as a builtin byte string and then compare that to the token name using pattern mathcing. So you would have {-# INLINABLE ivyToken #-} ivyToken :: BuiltinByteString ...


1

It seems like this is a single user installation. Are you running the nix command as the same user that installed nix? That would explain the unable to open database file error. You could validate this looking at the permissions/ownership of the sqlite file in question. To allow nix-command and flakes, you can create /etc/nix/nix.conf with the contents: ...


3

I believe the metadata in a Cardano NFT is not set in stone. As in you can decide what it contains. Using a reference to an ipfs storage location is one convenient way to add the actual content of the NFT. You can read more about the technical process of minting NFT's here: https://developers.cardano.org/docs/native-tokens/minting-nfts/ There's also an ...


0

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


0

the coresponding version for you can find there $cd ~/code/haskell/plutus-pioneer-program/code/week01/ $less cabal.project and there is a tag with right version


2

Let's say you have a Datum like this one: let d = MyDatum { someField = 1 , someOtherField = 2 } And a script: let lookups = typedValidatorLookups myScriptInstance <> otherScript myScriptValidator Then you can call the function as follows: let tx = mustPayToTheScript d $ Ada.lovelaceValueOf 1_000_000 And ...


3

That sounds correct. However, you're very flexible in who composes the transaction and who actually submits it to the network. In general at some point a transaction needs to be signed by the end user's wallet (which holds the private key to your funds) - and this is the step that requires some sort of interface that is the DApp connector (possibly also to ...


0

It's the mustPayToPubKey fn. It takes the hash of the public key of the wallet. From the validator fn: let tx = mustPayToPubKey (ppRecipient pp) $ lovelaceValueOf $ ppLovelace pp where pp is constructed in the off chain code like this (note the use of pubKeyHash fn): payTrace :: Integer -> Integer -> EmulatorTrace () payTrace x y = do h1 <- ...


0

there is a workaround how to replace that error by GHC Core to PLC plugin; E043:Error Haskell Language Server - linker error: symbol sqlite3_fts3_may_be_corrupt other error should be solvable using this: https://github.com/input-output-hk/plutus-apps/blob/main/doc/plutus/troubleshooting.rst but it didn't work for me


0

When you create a transaction to transfer ADA from an address to another address, you also pay the transaction fees. If you mean other type of "seller" and "buyer", please give more details. Alice sends ADA to Bob for 1 of Bob's NFT token. Alice is buyer and Bob is seller. But now I can see that Bob can't sell anything anyway without the ...


0

What I saw in the English Auction sample is that who executes the action pays that action's fees. The Start action is paid by who starts the action. The Bid fees are paid by each bidder respectively


0

When you create a transaction to transfer ADA from an address to another address, you also pay the transaction fees. If you mean other type of "seller" and "buyer", please give more details.


0

Build was actually successful it seems - was just taken a back by the compiler warning. I re-ran cabal build and then it just game me an output Up to date


2

Since they're not defined directly in EnglishAuction.hs, they must be imported from somewhere else. You can see all the imports starting on line 32. The haddock docs for Plutus can give some more information. Look at the index for the letter "T" and scroll down until you start seeing things that start with "tx". For example, ...


0

This is a minutxo failure. Likely wallet 1 doesn't have enough Lovelace in the initial genesis for holding the minted NFT. Try assigning at least 2000000 (2 Ada) to that wallet.


0

I had success by uninstalling/removing Nix, and then installing it again Uninstalling: remove the . "$HOME/.nix-profile/etc/profile.d/nix.sh" line in your ~/.profile or ~/.bash_profile rm -rf $HOME/{.nix-channels,.nix-defexpr,.nix-profile,.config/nixpkgs} sudo rm -rf /nix Reinstalling: sh <(curl -L https://nixos.org/nix/install) --no-daemon . ...


Top 50 recent answers are included