Hot answers tagged

8 votes
Accepted

Why not just simply use Haskell instead of Plutus?

There are many reasons. For example: You need tooling for the communication between the on-chain and the off-chain code and many other tasks. You need tooling that generates code where the on-chain ...
Robertino's user avatar
  • 141
8 votes
Accepted

Chain Indexers with Stream Endpoints

Hi there (Kupo's maintainer here)! Given the use case you're describing, Scrolls seems the most suited solution at present -- especially because this is exactly the direction Scrolls is moving into. ...
KtorZ's user avatar
  • 495
5 votes
Accepted

How To Convert Old Plutus Scripts to Vasil Reference Scripts?

The existing V1 Plutus script just needs to be recompiled and serialised as V2. See this example of a minting policy serialised as both V1 and V2 for guidance, https://github.com/james-iohk/plutus-...
james's user avatar
  • 1,380
5 votes

Committing a database to the ledger without storing it on the ledger?

You can use Merkle tree's for this! This is an inverted tree like data structure that uses hashes to create a root hash that is uniquely defined by its leafs, the leafs are the nodes in the lowest ...
Fermat's user avatar
  • 1,812
5 votes

How to properly start a new Plutus project, from scratch

A well formatted question deserves a well formatted answer! I will go into some depths, but also keep some things at a “magical” level. This is a long read so take your time! Before we start, it is ...
Fermat's user avatar
  • 1,812
4 votes
Accepted

What is this Pop Up Screen on Cardano Documentation?

What is this screen? that window comes by default with the haddock documentation I think it should work as a quick "go-to" however for PlutusTx the links do never work (at least to my ...
Michele's user avatar
  • 785
4 votes
Accepted

Is function "isPayToScriptOut" unsafe?

Your deductions are partially correct. isPayToScriptOut looks at the credentials of an address (1) and return true if it is a script address, false if it is a public key credential. It thus does not ...
Fermat's user avatar
  • 1,812
4 votes
Accepted

Plutus V2 Tx Building causing NonOutputSupplimentaryDatums error

I don't use cardano-serialization-lib but I can tell you that NonOutputSupplimentaryDatums is the ledger error thrown when datum is unneceserilly included in the tx when using inline datum. When ...
james's user avatar
  • 1,380
4 votes

How do users interact with smart contract?

You can use cardano serialization lib to write a webapp using react and CSL to build transactions for your vesting contract, like those actions for vesting funds or retrieving funds. These transaction ...
Will's user avatar
  • 1,132
4 votes

How to properly start a new Plutus project, from scratch

Since this question was posted Plutus-alternatives have been developed by the community that allow doing DApp development in JavaScript only. One such library is https://github.com/hyperion-bt/Helios ...
Christian Schmitz's user avatar
4 votes
Accepted

Can a smart contract execute itself automatically?

On Cardano the answer is simple: smart contracts cannot execute themselves automatically. Rather, a smart contract is nothing but a set of rules associated with an address. In a first transaction, Ada ...
Jey's user avatar
  • 1,484
3 votes
Accepted

How To Get Transaction Royalityies on Fungable Tokens

This is not possible. Native Tokens are first class citizens on Cardano. They are not part of a smart contract that could enforce behavior like this but are assets in your wallet like ADA. It's the ...
eddex's user avatar
  • 3,580
3 votes
Accepted

How to hardcode smart contract address in minting policy in Plutus?

If it does not match, it means your off-chain code is using a different address than what you expect on-chain. An address is comprised of two parts, the payment and the staking part. You seem to be ...
Sebastian Nagel's user avatar
3 votes

Calculate tx fees via Blockfrost or any other provider?

Transaction fees are computed based on two factors: size of the transactions, and required resources (memory and CPU steps). As Melroy van den Berg mentioned, transaction size increases the fee ...
keyanm's user avatar
  • 76
3 votes
Accepted

Is there an equivalent of Bitcoin Script Opcodes or the EVM instruction set in Cardano

Yes, there is a lower level code that is used onchain, it is called Untyped Plutus Core (UPLC)! When validators are written in template haskell, they get compiled via 1) GHC: Haskell -> GHC Core 2) ...
Fermat's user avatar
  • 1,812
3 votes
Accepted

Cannot find wrapMintingPolicy after updating to latest release of plutus-apps

You could try to replace Scripts.wrapMintingPolicy with Scripts.mkUntypedMintingPolicy ... import Plutus.Script.Utils.V1.Typed.Scripts qualified as Scripts ... $$(PlutusTx.compile [|| \ ...
Kỳ Anh's user avatar
3 votes
Accepted

Is pure ADA put in a script address locked up forever?

You tADA is locked forever. Luckily it is tADA, not real ADA. The preview network will be re-created in a few week anyway (after preprod, which will be reset on October 19th 2022).
George - APEX Stake Pool's user avatar
3 votes
Accepted

Custom currency error: Cannot build the initial state: Tag "toCardanoPolicyId"

ff is not a valid PolicyId (aka CurrencySymbol). It must be 28 bytes. For examples, see this answer on this similar Github issue https://github.com/input-output-hk/plutus-apps/issues/732#issuecomment-...
james's user avatar
  • 1,380
3 votes

How to deploy the Plutus smart contract

There are two steps you need to follow in order to create a dApp on Cardano. Create the script itself - the on-chain code Create the transaction which will make use of that script, ideally make it ...
Mateus's user avatar
  • 958
3 votes
Accepted

Overuse of resources when comparing for equality of VALUES (==)

Copying my answer from the Github issue here as well: We have hit the same issue lately. It is due to how the == function in the Eq Value instance is implemented. A value is logically a Map ...
Sebastian Nagel's user avatar
3 votes
Accepted

How can I access Haddock documentation for Plutus?

The playground has been discontinued. Haddock can now be accessed at https://input-output-hk.github.io/plutus/master
james's user avatar
  • 1,380
3 votes

Which would be the future language for writing smart-contract?

PlutusTx inherits its qualities from Haskell, and thus has many of the same benefits/drawbacks: Pros: auditability, maintainability, and upgradeability of code. Cons: developers' unfamiliarity with ...
zhekson's user avatar
  • 3,539
3 votes

Can a smart contract execute itself automatically?

To complement Jey's answer and respond to your last question, I don't think that smart contracts can execute automatically as they are just code that is sitting at an address and they need an actual ...
Falcon Stakepool's user avatar
2 votes
Accepted

How do Endpoints work?

In Plutus apps, the mechanism for requesting inputs is called "endpoints". All endpoints that an app wants to use must be declared as part of the type of the app. The set of all endpoints of ...
Falcon Stakepool's user avatar
2 votes

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

There are multiple ways to do that. Option 1: If you have "script-wide" constants, like your mentioned example of an auction house fee, I suggest parameterizing your contract like it is done ...
Will's user avatar
  • 1,132
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

Structure of the Address type from Plutus.V1.Ledger.Address

The sriptAddress is in Base16 (aka Hexadecimal) You need to do a few things to it to transform into an address: Add "70" to the front for Testnet, or "71" for Mainnet The Header ...
D S's user avatar
  • 312
2 votes

ZeroKnowledge Proofs in Plutus?

Yes, Plutus makes it possible to validate zero knowledge proofs as it is a Turing-complete language. However, verifying zero knowledge proofs can be very complex, and go over the execution budget. To ...
azinig's user avatar
  • 31
2 votes
Accepted

Referencing (U)TxO's

The referencing of UTxO is decribed in the CIP 31 (1). There it is stated that Referencing an output still requires the output to be presented as part of the transaction and be unspent, so ...
Fermat's user avatar
  • 1,812
2 votes

How do I test my smart-contract on Cardano

I find that using the plutus PAB simulator is the best way to first test out your smart contract. Once you confirm the smart contract logic is correct, you then move on to a local dev environment ...
lley154's user avatar
  • 297

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