Skip to main content
8 votes
Accepted

What's the difference between programmable validators and smart contracts?

You are asking a few questions here, so I'll try my best to point you in the right direction. I feel like KtorZ did a great job explaining it, but it doesn't hurt to put it into different words. ...
Mitchell Turner's user avatar
7 votes
Accepted

Where is the on-chain code actually stored?

As stated by Samuel, the code that a validator runs to check whether a transaction is valid is sent and stored in the transaction body as an input. So all scripts, be they Plutus or Native scripts, ...
Fermat's user avatar
  • 1,892
6 votes
Accepted

Are transaction witnesses stored on the blockchain?

A witness is the public key of the signer and the signature of the txbody using that public key. That is attached to the submitted transaction. It is not possible to query witnesses from db-sync at ...
Samuel Leathers's user avatar
4 votes
Accepted

Can we check signatures of arbitrary data in plutus validators?

I think PlutusTx.Builtins has what you need: {-# INLINABLE verifySignature #-} -- | Verify that the signature is a signature of the message by the public key. verifySignature :: BuiltinByteString ->...
Jey's user avatar
  • 1,549
3 votes

Can we check signatures of arbitrary data in plutus validators?

There is also an oracle for signature verification here
Stanislav Zhdanovich's user avatar
3 votes
Accepted

UnsafeFromData instance for custom type

In order to programmatically generate "FromData" and "ToData" instances for custom data types we have the function unstableMakeIsData present in PlutusTx (https://github.com/input-...
Nikhil Shetty's user avatar
3 votes
Accepted

Can I Use TraceIfFalse in deployment?

it strictly depends on your needs and how your validator is supposed to work. traces in general (trace, traceIfFalse, traceIfTrue, traceError) are known to be one of the causes of larger scripts. so ...
Michele Nuzzi's user avatar
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
Accepted

Confusion regarding findOwnInput function with on-chain code

Calling findOwnInput in a validator returns the value contained in the Script-UTxO that is currently being validated. In your example above it is the one with 2 Ada in it. Your example above is, ...
Jey's user avatar
  • 1,549
2 votes
Accepted

How to Make Sure A Contract Is Signed By a Certain Party?

So, at a high level, you can't make any restrictions on who can create a script, or submit datums to a script address. You can only put restrictions on who can "spend" datum utxos at the ...
Mitchell Turner's user avatar
2 votes

Rising trend in blocks missing: what could be the reason? Should we worry?

I can give you my opinion on the argument, but please note that I'm not assuming to have enough data to give you 100% guarantee mine are the reasons this is appening. I will focus more on your first ...
Michele Nuzzi's user avatar
2 votes
Accepted

How to have a contract on chain for extended periods of time?

Just a guess, but you might be referring to the POSIX time <-> slot conversion, where Lars noted in week 3 (see notes here), that - if you require a definite upper bound for a slot interval - ...
sean's user avatar
  • 1,463
1 vote
Accepted

Are validator script parameters secure? (lobster challenge)

Yes, if you had the script CBOR before, you could have used it to extract the seed and hack the challenge. With aiken, which at this time was probably not available, you can do: echo "...
DaveStrider's user avatar
1 vote
Accepted

Limit the number for each Token (AssetName) within one Currency Symbol (Policy ID)

I think there are two approaches to this, the classical and the cryptographic way of doing this. The classical method: In this method, you do the same as you would do on any computer. You store the ...
Fermat's user avatar
  • 1,892
1 vote

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

Script.validatorHash can not be compiled to Plutus Core (probably for good reason, as it would've resulted in much larger on-chain scripts). As Erik mentioned, if you only need the hash of your ...
keyanm's user avatar
  • 76
1 vote

Do I Need A Contract Monad For a Burn Wallet?

to help clarify, a plutus smart contract does not need a contract monad. A contract monad is used by the plutus PAB to create a client side contract that helps prepare and submits the plutus script ...
lley154's user avatar
  • 297
1 vote
Accepted

How to use plutus script withness in other plutus script

I just had to sleep a night on it. Obviously one can look at the incoming addresses and lookup the validatorhash in the credentials there. For example use filter (\x -> (ScriptCredential . ...
Fermat's user avatar
  • 1,892
1 vote

Ways to ensure at any given time at most one UTxO sitting at the script address that can be consumed

Yes, you can use a policy id as a parameter to that script and say that the script can only be consumed if it contains a token with that policy ID. You then mint an NFT and send it to this script (...
Mateus's user avatar
  • 988
1 vote

How can you use Ledger.Constraints in the Validator?

In short: no. Validator has three arguments: datum, from the utxo considered redemeer, supplied in the tx script context, which is a collection of data about the tx. Nothing else. Any information ...
waalge's user avatar
  • 403
1 vote
Accepted

Validator function in UTxO vs eUTxO model

In the UTxO model, we ARE passing the value into the validation, an output is compromised of both that and the redeemer (witness). The paper just fails to mention that. I believe that is because the ...
Michael's user avatar
  • 50
1 vote

How do I call the amount of ADA sent to a validator script in an Integer

You can not disallow users to send ADA into your smartcontract script address. You can only deny unlocking. However you can check how much of value is being sent with outgoing transaction from txOut ...
KugisMugis's user avatar
1 vote

Verifiying a digital signature in a Plutus script

You can use this function to verify signature from a validator
Stanislav Zhdanovich's user avatar
1 vote
Accepted

How to validate the correctness of another parameterized script address on-chain

You are asking a couple different questions here. This loads in cabal repl without problems. But when executing the EmulatorTrace, it yields the following error: *** Exception: Error: Unsupported ...
Mitchell Turner's user avatar
1 vote

Where is the on-chain code actually stored?

Auxiliary scripts are an attribute in the txbody that can have the validator script in it if it's small enough. You could also have metadata that links your users to the script off-chain.
Samuel Leathers's user avatar

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