What is a Transaction and Script?

  • Updated

Transaction: A transaction is a cryptographically signed data message that contains a set of instructions to update the Flow state. It is a basic unit of computation that gets executed by execution nodes. Transactions on Flow are fundamentally different from those on Ethereum. The main purpose of a transaction is not to send funds but to contain code that gets executed. Transactions can modify the data on the blockchain. This makes transactions very flexible and powerful. They require a fee to be included in the Flow blockchain.

Script: A script is a request made to the blockchain that returns information about the state of your dApp's smart contracts. Scripts are essential to any blockchain application as they allow interaction with the blockchain. Unlike transactions, scripts only view the data on the blockchain and do not modify it. Importantly, scripts do not cost any money to execute.

The key difference between transactions and scripts is that transactions modify the data on the blockchain, while scripts only view the data.

More information can be found on our Developer Documentation for Transactions and Scripts.