Questions tagged [datum]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
15 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. ...
user avatar
  • 1
1 vote
0 answers
12 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 ...
user avatar
0 votes
1 answer
55 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....
user avatar
  • 111
1 vote
3 answers
97 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 ...
user avatar
1 vote
1 answer
52 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. ...
user avatar
0 votes
1 answer
33 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 :: ...
user avatar
0 votes
0 answers
15 views

Parsing Values in a Nested Datum Type

I am filtering through transactions like this.Datum is represented as d in the below function. utxos <- Map.filter (isSuitable (cpFund cp)) <$> utxosAt scrAddress isSuitable :: Integer -> ...
user avatar
0 votes
0 answers
15 views

Applying filter function on a datum with two different data types

I am filtering through transactions like this. utxos <- Map.filter (isSuitable (cpFund cp)) <$> utxosAt scrAddress isSuitable :: Integer -> ChainIndexTxOut -> Bool isSuitable fundRound ...
user avatar
0 votes
1 answer
16 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 ...
user avatar
2 votes
2 answers
98 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 ...
user avatar
0 votes
2 answers
42 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 ...
user avatar
1 vote
2 answers
24 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 ...
user avatar
0 votes
1 answer
41 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 ...
user avatar
  • 1,196
2 votes
2 answers
97 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 ...
user avatar
  • 69
0 votes
1 answer
51 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 ...
user avatar
1 vote
1 answer
40 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 ...
user avatar
  • 113
1 vote
0 answers
16 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"}], &...
user avatar
  • 433
1 vote
1 answer
54 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 ...
user avatar
  • 456
1 vote
1 answer
48 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 = ...
user avatar
  • 21
2 votes
1 answer
84 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 ...
user avatar
9 votes
2 answers
159 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 ...
user avatar
  • 172
1 vote
1 answer
66 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.
user avatar
  • 1,196
7 votes
2 answers
138 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, ...
user avatar
  • 83
0 votes
2 answers
40 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 &...
user avatar
  • 100
1 vote
1 answer
62 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 ...
user avatar
  • 172
0 votes
3 answers
144 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 ...
user avatar
1 vote
1 answer
150 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 ...
user avatar
  • 11
0 votes
1 answer
53 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 ...
user avatar
  • 31
8 votes
2 answers
259 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 ...
user avatar
  • 253
5 votes
1 answer
290 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!
user avatar
4 votes
1 answer
146 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. ...
user avatar
1 vote
1 answer
128 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 ...
user avatar
5 votes
2 answers
142 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 ...
user avatar
2 votes
0 answers
57 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 ...
user avatar
  • 253
2 votes
2 answers
211 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-...
user avatar
3 votes
2 answers
184 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 ...
user avatar
1 vote
1 answer
230 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 ...
user avatar