Questions tagged [datum]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer
53 views

Loading specific Datum JSON with Map structure into Plutus type

We have a specific Datum, taken from Orcfax oracle UTXO: https://preprod.cexplorer.io/datum/9ced750ebbb2c9a9eac2e07a91525cadd3bfab23950089faa3e3a55517d1033f the part we are interested in is the very ...
SR - cerra.io's user avatar
0 votes
2 answers
67 views

Different types of Datums

I have a good understanding of the role of Datums in Cardano's Extended UTXO model, including their use in representing the state of a smart contract. However, I'm seeking further clarification on the ...
Markos Girgis's user avatar
0 votes
1 answer
29 views

Unable to convert BuiltinString to JSON

I would like to include a BuiltinString in a datum but am unable to do so as BuiltinString has neither a FromJSON nor a ToJSON instance. Is there an alternative to implementing these instances by hand?...
Eric's user avatar
  • 85
0 votes
1 answer
70 views

What are the differences between different kinds of datums (datum, datumhash, inlineDatum, inlineDatumHash)?

I sent some ADA to a smart contract address with the non inline datum of "1234" and when i queried the utxo with cardano-cli, I got this result. "...
Jelil Akjaly's user avatar
0 votes
1 answer
41 views

Understanding Script Failure Error Relating to Order TxIds - (script hash not known)

trying to claim back the first player bet after deadline in the ZeroOneGame from ppbl gimbalabs course on pre-production_testnet I get an error when trying to build the claim transaction. I have this ...
user3755529's user avatar
0 votes
1 answer
41 views

PlutusV2: Error when spending script output

This is how I spend script's utxos with the Emulator. This one from this example. grab :: forall w s e. AsContractError e => Contract w s e () grab = do utxos <- utxosAt scrAddress ...
Adam's user avatar
  • 343
1 vote
1 answer
112 views

How do you interact with smartcontract on jpg.store

Does anyone know how you interact with smart contract on jpg. store Do we need this? https://github.com/jpg-store/current-jpg-store-contracts if so how do we do so?
Brian Yeap's user avatar
3 votes
1 answer
79 views

Is function "isPayToScriptOut" unsafe?

As far as i understood, function "isPayToScriptOut" assumes every output that has a datum hash is a script output. But what if we create new output with datum, assigned to some pub key (for ...
Anastasia Martyniuk's user avatar
0 votes
2 answers
59 views

Providing a list of mappings from datum hashes to values while creating a transaction

I noticed that TxInfo datatype has a txInfoData field which carries a list of mappings from datum hashes to datum values. This seems very useful for validating transactions with multiple input UTxO's. ...
keyanm's user avatar
  • 76
1 vote
0 answers
27 views

How to Send A Token to an Smart Contract Alongside a Datum?

I asked another question (How to Make Sure A Contract Is Signed By a Certain Party?) and got the answer I expected. It raised the secondary Question of how to send a token with a datum to a smart ...
KryptoKing's user avatar
0 votes
1 answer
108 views

Attaching Datum Value with CSL 10.x

I generate my datum like so: // Build datum const sellerAddressPKH = changeAddressValue.slice(2,58); const datumFields = CSL.PlutusList.new(); datumFields.add(CSL.PlutusData.new_integer(CSL.BigInt....
Latheesan's user avatar
  • 121
1 vote
3 answers
249 views

Get Value of Datum from a UTXO

I currently have a utxo that i am getting like this. initalMatchPool <- Map.filter (findInitalAmount fundAddress) <$> utxosAt scrAddress How do i get the value of the datum attached to this ...
szhang9921's user avatar
1 vote
2 answers
300 views

How to provide Datum value using serialization lib

I am consuming a script output and also create a new one at the same script address. The validator script requires the output producer to provide the datum value due to making assertions on it. ...
Will's user avatar
  • 1,162
0 votes
1 answer
59 views

A Script With Multiple Different Datum Types

I have 4 different Datum Data Types in my script because for 4 different use cases in my script. data FundCreationDatum = FundCreationDatum { vFundOwner :: PaymentPubKeyHash, vPrizeAmount :: ...
szhang9921's user avatar
0 votes
1 answer
44 views

Different Data tyoes for datum

I have two main actions that user can do. They both require sending utxos to a script address. The datum I want produced by these two actions are different. I want one of the datum like this data ...
szhang9921's user avatar
3 votes
2 answers
247 views

PlutusData construction using @emurgo cardano-serialization-lib-browser

I have a JSON format needed for PlutusData serialization (but the format is not a standard datum in a list). The datum is wrapped in Maybe monad, so you'll note the nested lists (an array inside the ...
Eli Selkin's user avatar
0 votes
2 answers
86 views

Using custom datum for `mustPayToOtherScript` in off-chain code

Lets say I on-chain i have a Datum like so: data RandomDatum = RandomDatum { { tn :: !TokenName , cs :: !CurrencySymbol , nn :: !Integer } deriving (Show) Off chain I'm trying to form and ...
KugisMugis's user avatar
1 vote
2 answers
67 views

What is the mkValidator Script

In Plutus scripts there is a mkValidator where it takes in the datum , redeemer , and script context. In the plutus-pionner-program , the plutus scripts they show us uses these three parameters to ...
szhang9921's user avatar
0 votes
1 answer
75 views

Is it possible to send funds to a scriptAddress using a lightweight wallet?

I would like that an user using Yoroi/Nami/etc could send funds to a script address which expected an empty datum: (). EDIT (Pretty obvious, but the UTxO should be spendable later by a transaction) I ...
kindofdev's user avatar
  • 1,304
4 votes
2 answers
401 views

Plutus datum and redeemer on cardano-cli

I'm trying to deploy a smart contract on cardano-cli after its implementation on plutus playground. Imagine that I have: data TradeDatum = StartBid | Bid TradeDetails | Offer TradeDetails ...
pprs's user avatar
  • 101
1 vote
1 answer
291 views

What is the role of datum in spending a transaction

So i am going over the plutus-pionner-program right now and he keeps on iterating this point. Transaction that spends a script output need to provide the datum of that script. Transaction that send ...
szhang9921's user avatar
1 vote
1 answer
78 views

Missing datums in db-sync

From time to time I encounter transactions which contain UTXOs associated to script addresses with datum hashes for which no corresponding entries are available in the datum table of a fully-synched ...
Jesuspc's user avatar
  • 113
1 vote
0 answers
27 views

what info is in datum value and how can we extract it

In the case for spend purposes e.g. Value: {"fields": [{"bytes": "10dc9481577ae0ac7a2b828bae9f2ba163b79ce73069d75fd609bc88"}, {"bytes": "a20a"}], &...
Hud's user avatar
  • 433
1 vote
1 answer
96 views

Documentation for filtering through the inputs of a Plutus Script

I Have 1000 utxo's sitting at a script address with unique datums is there documentation for a validator so that when collectFromScript is called it only pulls 1 utxo based on the user input matching ...
Floof99's user avatar
  • 472
1 vote
1 answer
96 views

What is the correct way to compare DatumHash?

What is the correct way to compare DatumHash? I imported the Eq function from PlutusTx import PlutusTx.Prelude (Eq((==))) ... checkDatumHash :: TxOut -> Bool checkDatumHash txOut = ...
17159's user avatar
  • 21
2 votes
1 answer
142 views

How to create Datum with ownPaymentPubKeyHash?

I have defined two endpoints. One for creating a UTxO at the script address with a Datum that contains the wallet's own PaymentPubKeyHash. And a second endpoint that spends such UTxOs from the script ...
Will's user avatar
  • 1,162
9 votes
2 answers
179 views

What is where executed and when?

To wrap my around what happens when I where, I tried to visualize it. In order to be able to show the interaction between two different systems generating transactions, I have a Generator A and ...
Kurt Sys's user avatar
  • 172
1 vote
1 answer
82 views

How does Constraints.mustHashDatum work?

I'm trying to understand how Constraints.mustHashDatum works but I'm not able to figure out the purpose of this Constraint. Any help would be great.
kindofdev's user avatar
  • 1,304
7 votes
2 answers
180 views

Plutus pattern/technique for finding original datum preimage of TxOutDatumHash?

Every UTXO at a script address must have a TxOutDatumHash (or will be unspendable). To spend the UTXO at the validator you provide a datum and a redeemer, the script must validate with your redeemer, ...
hrpr's user avatar
  • 83
0 votes
2 answers
46 views

Is Redeemer similar to <ScriptSig> in bitcoin context?

In the (e)UTxO model, discussed in the 1st lecture of PPP#3, I am trying to understand the differences between the UTxO model of Bitcoin and the (e)UTxO model of Cardano. From what I understand, the &...
wakathi's user avatar
  • 100
1 vote
1 answer
67 views

How does the final transaction in the auction example know who did the bid?

In the second transaction of the auction example, these are the output EUTxO's. In the final transaction, only wallet 1 and the script are inputs. How does the script know that wallet 3 has done the ...
Kurt Sys's user avatar
  • 172
1 vote
3 answers
240 views

How to pass TxOutDatumNone when building a script transaction with cardano-cli

I'm trying to consume a UTxO from a script address. When querying the script address with cardano-cli query utxo, I have the following UTxO: TxHash ...
Jaanus Varus's user avatar
1 vote
1 answer
225 views

How to add datum to UTXO in nami

Datum is hashed and assigned to an UTXO When you send the transaction you can add optional parameters like metadata and/or datum datum is used by smart contract since it's the only data that smart ...
Danish's user avatar
  • 11
0 votes
1 answer
100 views

Embedding address into the datum using the CLI

I have a validator that uses Address in datum. I also have an address generated (payment.vkey, payment.skey, payment.addr, stake.vkey, stake.skey, stake.addr). I'm able to get PubKeyHash using command ...
ijkl26's user avatar
  • 31
8 votes
2 answers
389 views

Is there complete cardano-cli documentation?

Hello all I can find is the cardano-cli help and https://github.com/input-output-hk/cardano-node/blob/master/doc/reference/cardano-node-cli-reference.md/ I am trying to get information on things like ...
noone392's user avatar
  • 263
5 votes
1 answer
674 views

How do I read the datum of an output?

How do I get the datum of an output from cardano-graphql (or another service)? I have attached it using the --tx-out-datum-embed-file flag already when building the tx using cardano-cli. Thanks!
yoyobigmanyo's user avatar
5 votes
1 answer
182 views

Where is the Datum stored in PAB?

In utxo we store only the hash of the datum, so whenever you work with the Cardano cli to run a transaction - you should provide datum or its hash via tx-out-datum-embed-file, tx-in-datum-file, etc. ...
volodyad's user avatar
1 vote
1 answer
234 views

Ensuring NFT collection uniqueness using counter as asset name?

I would like to be able to mint a collection of NFTs across different transactions that fall under the same policy id. A method I would like to try is making a 'dummy' nft that holds a counter as its ...
Montario's user avatar
5 votes
2 answers
186 views

How can I enforce a datum type to be correct?

Most types in Plutus are simply wrappers around BuiltinByteString. For instance the bytes in PubKeyHash are not serialized/deserialized to an actual pubkey hash and checked for correctness. So ...
Alessandro Konrad's user avatar
3 votes
1 answer
157 views

How can I secure a Datum value in a smart contract?

I am trying to figure out how to write a script where you can make sure the datum value doesn't change each time an output gets consumed. For example, in the auction script in the pioneer program each ...
noone392's user avatar
  • 263
2 votes
2 answers
334 views

How does custom Plutus data type map to cardano-cli --tx-in-datum-file content?

Let's say I have validator, which checks datum against two numbers, hash, time and a string and there are some funds locked at this script address and I would like to unlock these funds using cardano-...
KugisMugis's user avatar
4 votes
2 answers
372 views

How to retrieve the datum added with the option –tx-out-datum-embed-file from the tx witness data

I have been thinking recently about the way we are predominately creating NFTs on Cardano, right now the trend is to add the NFT attributes to the transaction metadata, however, I think this is not ...
AngelCastillo's user avatar
1 vote
1 answer
379 views

How to specify the new output datum value (not hash) using the CLI

I have written a script that basically keeps a counter and every time it is spent increases said counter, the way it guarantees that the counter was increased is by checking the current datum of the ...
AngelCastillo's user avatar