Hot answers tagged

15 votes
Accepted

What 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, ...
Matthias Sieber's user avatar
  • 1,547
11 votes

What 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 ...
Jelil Akjaly's user avatar
7 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 ...
Samuel Leathers's user avatar
6 votes

What 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 ...
Dilworth's user avatar
  • 211
4 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 ...
keefie's user avatar
  • 431
3 votes
Accepted

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 ...
Bharat Mallapur's user avatar
3 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 ...
BETTR Stake Pool's user avatar
3 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 ...
Will's user avatar
  • 1,142
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 ...
Luigy's user avatar
  • 46
3 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 ...
Fermat's user avatar
  • 1,852
3 votes

Is it possible to call the `mkValidator` inside the same / another `mkValidator` function for script composibility?

In this case, when compiling your validator, compiler is trying to compute a value (which is only available after successfully compiled your validator) to complete compiling your validator, thus, it's ...
Tuvshintsenguun's user avatar
2 votes

Convert Plutus Address Credential to real-net address

Check here please: https://cardano.stackexchange.com/a/8808/6196 I answered a similar question in a different post
D S's user avatar
  • 312
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 ...
tycl's user avatar
  • 190
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 ...
George - APEX Stake Pool's 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 ...
KtorZ's user avatar
  • 495
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 ...
Mihai Codescu's user avatar
2 votes

Discovering the script source based on address

You can't get the Smart contract code starting from its address. As @zhekson already mentioned, smart contract addresses are hashes of the code (the serialization of the untyped Plutus core to be ...
Michele Nuzzi's 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 ...
Fermat's user avatar
  • 1,852
2 votes
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 ...
Will's user avatar
  • 1,142
2 votes
Accepted

Plutus Script Validation Metadata

If the NFT was minted using a transaction with metadata (cardano-cli), then the Plutus script won't be able to access this information. This is because you can only feed UTxOs to Plutus validator ...
Falcon Stakepool's user avatar
2 votes
Accepted

Whats Your Mental Model For Monads?

Just read one definition: A monad is just the minimal amount of structure needed to overload a function composition in a way that performs an extra computation on the intermediate value. My ...
KryptoKing's user avatar
2 votes

Whats the python script to check if an cardano address has a script flag?

PyCardano can help you to find the address type. For example, addr1wyzynye0nksztrfzpsulsq7whr3vgh7uvp0gm4p0x42ckkqqq6kxq is the script address of Spacebudz. You can decode it into an Address object ...
Jerry's user avatar
  • 403
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 ...
Jey's user avatar
  • 1,529
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, ...
Mitchell Turner's user avatar
1 vote
Accepted

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 { ...
Falcon Stakepool's user avatar
1 vote

How to generate script address from plutus script cborhex

I've answered this here, but as a reference I'll copy my answer below: Plutus-Core script bytes are wrapped twice in a CBOR bytearray. Use the following steps to calculate the script address: unwrap ...
Christian Schmitz's user avatar
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. ...
zhekson's user avatar
  • 3,599
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.
Samuel Leathers's 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 ...
specpro's 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-...
Tygar Pool's user avatar

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