Let's say my smartcontract needs BuiltinData. Quicksearch in documentation reveals that BuiltinData is in:

  • Plutus.V1.Ledger.Api
  • Plutus.V2.Ledger.Api
  • PlutusTx.Builtins.Internal
  • PlutusTx
  • PlutusTx.Builtins
  • PlutusTx.Prelude
  • ...

How to know which include I should add? Which ones are preferred and why?

1 Answer 1


Some of these are reexported versions of others. This means some of them are not necessary. Also PlutusTx.Prelude should be included in all projects as it maps types into PlutusTx which complies with the bytecode that runs on the chain.

This means if your Data type is in PlutusTx.Prelude, you should not need the other modules in general. The exception is if other parts of your code use that module.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.