Questions tagged [plutus]

A programming language based on Haskell used to write smart contracts on the Cardano blockchain.

46 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8
votes
1answer
141 views

Append metadata to transaction from Plutus code

Is there a way to append metadata to transactions that are send from plutus code? Right now we send transactions from the contracts like follows (or something alike): ledgerTx <- ...
7
votes
1answer
88 views

Plutus Pioneer Cohort 2 Lecture 3

I was going through the lecture on Youtube and this is the one with Vesting example where: wallet 1 gifts 20 ADA to wallet 2 in 2 different slots wallet 1 gifts 10 ADA to wallet 3 in a slot later on, ...
6
votes
1answer
89 views

Fetching all Tokens that belong to a Minting Policy

Is there a way to programmatically get all the TokenNames belonging to a CurrencySymbol with Plutus?
5
votes
1answer
118 views

How to run smart contracts in the Cardano Blockchain?

I know that since Alonzo was launched smart contracts can be published in the blockchain now, but I have no idea how to do it. I have read some articles about the Plutus Application Backend though, it'...
5
votes
1answer
90 views

Where is the on-chain code actually stored?

I've just read something that suggests Validators aren't actually kept on the blockchain. To save the space, only the hash of the Validator is kept at the UTxO and users willing to spend it must ...
5
votes
0answers
83 views

How to spend two outputs of two different scripts

I've got a problem. I've tried to implement a logic which can spend 2 outputs of 2 different scripts and create 2 new utxos like a following lookups = Constraints.typedValidatorLookups instance1 ...
4
votes
0answers
115 views

Is there a good tutorial to mint Cardano NFT using plutus script?

I used to mint Cardano NFT using "Time locking" following this guide https://developers.cardano.org/docs/native-tokens/minting-nfts/. But I know the more formal way is to use plutus script ...
4
votes
1answer
63 views

How to convert BuiltinData to BuiltinString?

Since I just started to write Plutus code, I want to make some tests of Plutus. For example, I'd like to know what exactly my redeemer :: BuiltinData value is. However I can't convert BuiltinData to ...
4
votes
0answers
54 views

Invoking lock endpoint on the plutus-starter guessing game is giving me "endpoint not available" error

Using the nix-shell approach, I'm able to build and execute the plutus starter PAB project, which includes the guessing game contract. GIT repo link In a separate terminal window, I can run the GET ...
3
votes
0answers
41 views

Question about plutus-pab

I am trying to understand plutus-pab. I read in the documentation that PAB will give to a wallet an unsigned and unbalanced transaction, then the wallet will balance and sign it and then will send it ...
3
votes
0answers
36 views

PAB recovering from Errors

In the current version of the Plutus starter repo (commit a85818 which uses plutus-1.0.9), it seems difficult to know where to handle errors. For example, using the Game contract after initialization ...
3
votes
0answers
27 views

Test for logError in Trace monad

How do I write a Tasty unit-test for an error that may be logged from inside the Trace monad? import Control.Monad.Freer.Extras (logError, throwError) trace1 :: Input -> Trace.EmulatorTrace () ...
3
votes
0answers
37 views

SOLVED: Plutus-Start for Windows - Cannot get the docker repository to run (A mount config is invalid.)

I am following : https://github.com/input-output-hk/plutus-starter I have downloaded VSCode and Docker. I downloaded the Remote Development extension in VSCode. I then ran "mkdir -p ~/.cabal/...
3
votes
0answers
30 views

Launch.json for VSCode/Haskell? Learning Haskell Plutus

I have VSCode all set up with the necessary Haskell plugins (except I have GHCI 9.x installed via Chocolatey and the plugins want 8.x, ouch! Unfortunately Chocolatey won't accept an 8.x "--...
3
votes
0answers
40 views

How to make payment to a payment address using Plutus?

In Plutus, Ledger.Constraints has the following Constraints mustPayToOtherScript, mustPayToPubKey, mustPayToTheScript, Is there a similar constraint that can used send funds to a payment address in ...
3
votes
0answers
33 views

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 ...
3
votes
1answer
24 views

Slow settlement for safe wallet in Plutus

The problem I'm trying to solve -- I want to move my crypto off exchange, but I'm afraid I will be hacked or lose my keys. Solution -- wallet that takes 1 day to settle every outgoing transaction. ...
3
votes
1answer
72 views

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 ...
3
votes
1answer
103 views

How to solve the Plutus scalability issue?

This issue is one that'll plague projects trying to build on Cardano. Let's consider Lecture 10 of the first iteration of the Plutus Pioneers Program (https://www.youtube.com/watch?v=Dg36h9YPMz4&...
3
votes
1answer
66 views

awaitTxConfirmed not returning

Under what conditions does awaitTxConfirmed not return? It stopped returning since I updated my cabal.project file to make use of the latest plutus tag plutus-starter-devcontainer/v1.0.7. It worked ...
3
votes
1answer
65 views

Setting up Plutus environment for Apple Silicon computer

I'm trying to setup dependencies to write and test plutus contracts, but I'm worried that the dependencies may not be compatible with the M1 chip. I have been following these instructions https://www....
3
votes
0answers
74 views

ZeroKnowledge Proofs in Plutus?

From what I heard Plutus / Smart Contracts will bring also the possibility to do Zero Knowledge Proofs. But I struggled to find further Details in the Documentation. So here are my Questions: Anyone ...
3
votes
1answer
84 views

Implementing a nested state machine

I am trying to implement a nested state machine with plutus and I'm wondering if it is even a possibility.
3
votes
0answers
94 views

Using Plutus PAB for development instead of Playground

trying to migrate away from the playground and seems like PAB is the way to go. The plutus starter repository orignally seems to be the best place to start but it seems to be outdated (i.e. still ...
2
votes
1answer
45 views

How to return funds from a smart contract

If I have assets (can be just ADA for simplicity) locked in a contract, how can I release the funds to the previous owners most efficiently? Some more context regarding the question. I created a pay ...
2
votes
0answers
53 views

What is achieved by invoking endpoint for wallet in the emulator?

As per entire code below, give always mandates that Wallet 2 be given: thePkh :: PubKeyHash thePkh = pubKeyHash $ walletPubKey $ Wallet 2 theVal :: Value theVal = ADA.toValue (ADA.Lovelace 3_000_000) ...
1
vote
0answers
20 views

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 ...
1
vote
0answers
30 views

PAB webserver not working

Trying to connect to the PAB webserver on port 8080 gives: Error: connect ECONNREFUSED 127.0.0.1:8080 Output from running cabal exec MyPAB: [INFO] Slot 0: TxnValidate ...
1
vote
1answer
95 views

What is the recommended way of implementing an NFT sale?

I'm pretty new to crypto development (I've been a professional software engineer for 5+ years now) and would like to get into NFT development using Cardano. Currently, I'd like to start a collab with ...
1
vote
0answers
27 views

Plutus Pioneer Program Week01 : Installing plutus - Unable to start server if syncing plutus with plutus-pioneer-program version

In the plutus-pioneer-program/code/week01 folder, I got the tag as tag: ea0ca4e9f9821a9dbfc5255fa0f42b6f2b3887c4 The git log tag for plutus was 9879b31579d0deb863f3cdf27f93419deec3b4bb So I used git ...
1
vote
0answers
57 views

Prefund wallets for PAB

How does one prefund wallets for PAB (Plutus Application Backend)? I do not want to introduce minting code just for this purpose.
1
vote
0answers
51 views

Specify balance during wallet creation in PAB simulator

Using the PAB Simulator from the plutus-starter (version 1.0.9, commit: a85818c27926f34d627225636f463cc6698706fc), I'm getting some odd behavior in terms of wallet creation. I've created a simple ...
1
vote
1answer
35 views

Getting the address of a parameterized contract from within the validator of another script

Suppose I have one contract, Contract 1, that is parameterized by type Contract1Params{ tokenName :: BuiltinByteString } and I have a minting policy that will only mint a token with tokenName tn ...
1
vote
0answers
16 views

Error Starting plutus-playground-client

I'm having error running the plutus-playground-client. Not sure where to look, here is the complete error log. Any suggestions on how to fix? 0 info it worked if it ends with ok 1 verbose cli [ 1 ...
1
vote
1answer
78 views

How to submit a script transaction using `cardano-cli`

I'm trying to go through the Alonzo Testnet exercises to get more familiar with the deployment process for Plutus contracts. I've gotten confused by the instructions in sheet 3: Download the pre-...
1
vote
0answers
87 views

Weird behavior on validation of outputs

So I have a validator that, in particular, checks how many outputs are produced. os = txInfoOutputs info mkValidator :: ... mkValidator = traceIfFalse "Wrong outputs" checkOutput where ...
1
vote
1answer
33 views

How to get latest version of Plutus in project file of plutus-starter-devcontainer

I've been trying to get the latest version of plutus on my project but I get the following error message when I run nix-shell: error: attribute '8a20664f00d8f396920385947903761a9a897fe0' missing, at /...
1
vote
1answer
124 views

Is there any eth_sign equivalent signing method in plutus?

I want to use my private key to sign a message, and submit the message and signatures to third party server, the third party server can verify that signatures through plutus smartcontract. In ethereum ...
0
votes
0answers
16 views

How do I parse multiple values stored in datum in Plutus

So I am storing multiple values in my datum but I don't know how to read them in Plutus code. Also I am very new to Haskell so explain it in a simple way please. 😅
0
votes
0answers
22 views

Cross-chain Hydra

Been thinking about the Taproot upgrade and what it means for bundling validation into Bitcoin transactions. While Hydra requires three validation scripts in Plutus, the similiarities between EUTxO ...
0
votes
2answers
46 views

Right way to get the Wallet ID when creating?

Having trouble with with the plutus-starter template. The following return null after starting the pab: export WALLET_ID_1=`curl -s -d '' http://localhost:9080/wallet/create | jq '.wiWallet....
0
votes
0answers
18 views

`Constraints.unspentOutputs` in `lookup`

I have a question regarding lookups, there is an option Constraints.unspentOutputs, why is it needed? Because in the txConstraint MustSpendScriptOutput I already supply TxOutRef as an input. The ...
0
votes
0answers
14 views

Can a function be passed in as an endpoint argument?

Can a function be passed in as an endpoint argument? IOW,how can I instantiate a function for FromJSON?
0
votes
1answer
37 views

PAB requesting CONFIG_FILE on CLI

Trying to run PAB by executing: cabal exec -- myapp-pab webserver returns the following error: [Error] The --config option is required However, the lecture by Prof. Lars (PPP Lecture 6) didn't make ...
0
votes
0answers
40 views

Why Cabal will not build Cardano api?

Hi I was just following lecture 1 when trying to build the Auction contract. Plutus commit: ea0ca4e9f9821a9dbfc5255fa0f42b6f2b3887c4 I ran Cabal clean, Cabal update, then added brew install libsodium-...
0
votes
0answers
55 views

Verifying user data sent to a smart contract

so i've got a fun idea to use an in game puzzle and the infinite solutions possible as a method to mine a coin. Essentially i want the gamer to create a system, and however long it runs for without ...