Arkade Syntax
Syntax reference for the Arkade Script language
Experimental Technology
The Arkade Language is experimental technology in active development. All code and examples presented here are for exploration and proof of concept purposes only. Do not use in production environments.
Arkade Syntax
Arkade Script uses a familiar syntax inspired by modern programming languages like Solidity, with specific adaptations for Bitcoin’s UTXO model. The syntax is designed to be readable and expressive while maintaining a close relationship to the underlying Bitcoin Script.
Influences
Arkade Script’s syntax draws inspiration from several existing Bitcoin smart contracting languages:
- CashScript: A high-level language for Bitcoin Cash smart contracts
- Ivy: A smart contract language for Bitcoin
- Solidity: The most widely used smart contract language (for Ethereum)
Basic Structure
An Arkade Script contract consists of:
Comments
Arkade Script supports single-line and multi-line comments:
Options Block
The options block configures contract-wide settings:
Available options:
server
: Specifies which parameter contains the server public keyrenew
: Specifies the renewal timelock in blocksexit
: Specifies the exit timelock in blocks
Contract Declaration
Contracts are declared with a name and parameters:
Parameters define the values needed to instantiate the contract and are accessible throughout the contract body.
Functions
Functions define spending paths for the contract:
Functions can be marked as internal
to indicate they are helper functions and not spending paths:
Variables and Assignments
Variables can be declared and assigned values:
Control Flow
Arkade Script supports if-else statements:
Expressions
Arithmetic Operations
Comparison Operations
Logical Operations
Bitwise Operations
Require Statements
The require
statement is used to enforce conditions:
If the condition is false, the script execution fails with the provided error message.
Transaction Introspection
Arkade Script provides access to transaction data:
Signature Verification
Hash Functions
Timelock Verification
Script Template
Arkade Script provides a built-in template for deriving the taproot output key:
Error Handling
Arkade Script uses the require
statement for error handling:
If the condition is false, the script execution fails with the provided error message.
Conclusion
This syntax reference provides an overview of Arkade Script’s language features. For more detailed information on specific language elements, refer to the following pages:
- Arkade Types: Detailed information on data types
- Arkade Functions: Reference for built-in functions