Experimental TechnologyThe 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 Types
Arkade Script provides a rich set of data types designed specifically for Bitcoin smart contracts. These types help ensure contract correctness and provide clear semantics for working with Bitcoin’s UTXO model.Primitive Types
Boolean
Thebool
type represents a boolean value (true or false):
Integer
Theint
type represents a signed integer:
Cryptographic Types
Public Key
Thepubkey
type represents a Bitcoin public key:
Signature
Thesignature
type represents a Bitcoin signature:
checkSig
or checkMultisig
functions.
Byte Arrays
Generic Bytes
Thebytes
type represents an arbitrary byte array:
Fixed-Size Bytes
Fixed-size byte arrays specify the exact number of bytes:bytes20
: Typically used for RIPEMD-160 hashes or Hash160 resultsbytes32
: Typically used for SHA-256 hashesbytes33
: Typically used for compressed public keys
Asset Types
Asset
Theasset
type represents an Asset:
Complex Types
Arrays
Arrays can hold multiple values of the same type:Structs
Structs group related data together:Type Conversion
Explicit Conversion
Explicit type conversion is performed using casting syntax:Implicit Conversion
Some types can be implicitly converted:- Integer literals to
int
- String literals to
bytes
- Hex literals to
bytes
or fixed-size byte arrays
Special Types
Transaction
Thetx
object provides access to transaction data:
Input
Theinput
type represents a transaction input:
Output
Theoutput
type represents a transaction output:
Type Properties
Size
The size of a value in bytes can be obtained using thesize
property:
Type Checking
The type of a value can be checked at runtime:Null Values
Some types can be null, indicating the absence of a value:Type Safety
Arkade Script is statically typed, meaning type checking is performed at compile time:Memory Layout
Understanding how types are represented in memory can be important for advanced contract development:bool
: 1 byte (0 for false, 1 for true)int
: 8 bytes (little-endian)pubkey
: 33 bytes (compressed) or 65 bytes (uncompressed)signature
: 64 bytes (Schnorr) or 71-73 bytes (ECDSA)bytes
: Variable length with size prefix