Hot answers tagged

14 votes
Accepted

What exactly is a Redeemer?

From https://iohk.io/en/blog/posts/2021/04/13/plutus-what-you-need-to-know/: When validating an address, the script will access the data being carried by the output, the transaction being validated, ...
user avatar
  • 1,488
11 votes

What exactly is a Redeemer?

In simple terms, redeemer is the data that the user of the smart contract provides to the smart contract. In the simple UTxO model, redeemer is your signature. By providing your signature, you prove ...
user avatar
5 votes

Can ADA locked on a script be staked?

An Ada address is made up of 2 separate credentials, one for payment and one for staking. These are both treated independently and one, the other or both can be script hashes instead of plain key ...
user avatar
5 votes

What exactly is a Redeemer?

Before (E)UTxO - There Was UTxO Understanding how a UTxO model works (such as BTC) may help you understand the implementation of (E)UTxO in Cardano. The UTxO Model A UTxO model, meaning: unspent ...
user avatar
  • 201
3 votes

Plutus script execution at every end of epoch

As mentioned by Jey earlier, blockchains and smart contracts remain latent until triggered by a user submitted transaction. One way you could pull this off is that you could use the cardano-cli ...
user avatar
3 votes
Accepted

Hash script data

The missing step would be converting the ScriptData into CBOR prior to hashing. In the case of ScriptDataNumber 42 the CBOR Hex is "182a" which is a bit simplified for Numbers vs more ...
user avatar
  • 46
2 votes
Accepted

Re-Implementing Policy Hashing in Python

It seems I was close, but the str.encode() function was not the correct one to use. Also a zero byte needs to be prepended to the data to be hashed. Thanks to user bwbush from the cardano forum for ...
user avatar
  • 80
2 votes

How to get Policy Script for a specific policy-ID

As stated in other answers the minting policy script is used as a witness in the minting transaction and thus available on chain. Community members made tools for extracting such data. Here is a great ...
user avatar
  • 803
2 votes

Can ADA locked on a script be staked?

Yes. There are a few projects doing this, one of them is StakingDAO, which is in Catalyst Fund 7. I cannot give you details about how this is done, but I heard a few other people saying this is ...
user avatar
2 votes
Accepted

How to build a script transaction if the validator expects it to be signed

I am afraid that via the cardano-cli, you will not be able to do that. Indeed the cli evaluates the execution units before you get to sign the transaction. Signatories are however available in the ...
user avatar
  • 365
2 votes

How to obtain wallet addresses of stake pool delegators?

You were onto the right idea, try the blackfrost approach again. After calling /accounts/{stake-address}/addresses endpoint you will see a list of addresses linked to the stake address. Pick any ...
user avatar
2 votes
Accepted

How to PlutusTx.compile work with multiple arguments to mkPolicy

We have wrapMintingPolicy :: UnsafeFromData r => (r -> ScriptContext -> Bool) -> WrappedMintingPolicyType. In the first case, we can spell out the details like: policy :: PaymentPubKeyHash ...
user avatar
2 votes
Accepted

Can ADA locked on a script be staked?

When you create an output with a script address, you can put whatever staking key you like on it. That staking key behaves exactly like staking keys do in all other outputs. Scripts can see staking ...
user avatar
2 votes
Accepted

Script to only accept payments in 100 Ada

Cardano is a decentralized system, anyone can send anything to any address with any datum attached to it (no one can be censored). There is no way of stopping anyone from sending something to an ...
user avatar
  • 803
2 votes
Accepted

How to Get Started with Cardano Native Script

You can find fairly extensive documentation on Cardano Native Script (aka Simple Script) here. In short, you can define a JSON object with a simple set of rules known as scripts to validate operations ...
user avatar
  • 326
1 vote

How to determine the order of transaction input (in the order of the TxIds)?

Looks like all --tx-in is not in the order like it is provided in cardano-cli command and rather is order ascending by transaction id.
user avatar
  • 369
1 vote
Accepted

How to achieve a minting policy script that locks after certain number of images (assets) have been minted on the fly

You could use a combination of a plutus validator script with a specific datum and a minting policy. The minting policy just checks for the validator script has ran. And the validator script checks ...
user avatar
1 vote

checkDeadline function always returning False

Make sure you are adding your time constraints in your off-chain code as well. Here is an example of the constraints in the auction contract. Background: This can be kinda unintuitive to some people, ...
user avatar
1 vote

Script Witness Not Validating for Multisig

Finally I was able to sort this out. You can use this library to create the multisig: https://github.com/tango-crypto/cardano-wallet-js The code I ran was the following: multisig.js const { ...
user avatar
1 vote

Plutus script execution at every end of epoch

Scripts are executed as part of a transaction validation. That means: no transaction -> no script execution. The blockchain has no mechanism of timed or automatic script execution. What you can do ...
user avatar
  • 1,256
1 vote

Discovering the script source based on address

Firstly, the address you referenced in your question is a Byron address, as pointed out by Samuel. Byron addresses are payment only, and are not associated with scripts (smart contracts) or staking. ...
user avatar
  • 2,961
1 vote

Discovering the script source based on address

That's a Byron address, not a plutus script address. Likely being sent to an exchange.
user avatar
1 vote

Contract deployment in week03 is failing with "beneficiary signature missing"

Turns out I was using the wrong vesting.addr - so the gotchas here were NEED TO "cabal repl" after updating the deploy.hs get the correct vesting.addr and use it in the give.sh and grab.sh ...
user avatar
  • 31
1 vote

How to obtain wallet addresses of stake pool delegators?

What I do is query & grab all the data I need from: https://cardanoscan.io/pool/f8e64037e3917cd7cb94969a5374e11b9e6c939b4b69118a8eb4509f?tab=delegators And then send whatever I want using cardano-...
user avatar
1 vote

Verifiying a digital signature in a Plutus script

You can use this function to verify signature from a validator
user avatar
1 vote

How to split transaction into many different UTXOs?

off-chain scripts just instruct on what to do and has no influence under transaction output. You should be able to specify multiple outputs going to the script address in your off-chain code. Just ...
user avatar
1 vote
Accepted

How to get Policy Script for a specific policy-ID

When minting a token in Cardano, we sign (witness) the transaction with the input credentials for consuming the input, and ALSO it is required to provide the minting native script (token policy) as a ...
user avatar
1 vote

How to get Policy Script for a specific policy-ID

You can't get that information, unless the creator publish it because the policy id is the hash of the policy script. For example, here: Spacebudz policy and here Spacebudz FAQ - Is this actually an ...
user avatar
  • 1,624
1 vote
Accepted

nix-build alonzo mainnet

You're doing the right thing. "syncProgress" refers to the percentage of the chain you've synced. Once you get to around 70% it will say "Shelley" and only the most recent epoch ...
user avatar
1 vote

Transaction Notification

You want to poll the list transaction endpoint: https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/listTransactions
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible