Q&A: What is CashScript?
Block answers a tech-support question about What is CashScript?
Question:
What is CashScript?
Answer:
CashScript is a high-level smart contract language for Bitcoin Cash that compiles down to native BCH Script bytecode. It lets developers write contracts with type safety, transaction introspection, and native support for CashTokens.
Key points:
- UTXO-based, not account-based — unlike Ethereum/Solidity, a CashScript contract doesn’t “execute” code itself; it only validates whether a transaction is allowed to spend a particular UTXO.
- Type-safe language with types like
int,bool,bytes,bytesN,string,pubkey, andsig. - Transaction introspection — contracts can inspect inputs, outputs, values, locking bytecodes, token data, and NFT commitments via
tx.inputs[]andtx.outputs[]. - Native CashTokens — works with both fungible tokens and NFTs, including capabilities like minting and mutability.
- Built-in functions for hashing, signature checks (
checkSig,checkMultiSig,checkDataSig), bounds checks (within), and byte manipulation.
Source: PSF LLM Wiki — CashScript language reference
Public Q&A mirror from the Block tech-support bot.
Write a comment