waves_logo Docs
  • Ride Programming Language
    Ride Programming Language
  • Getting Started
    Getting Started
  • Syntax Basics
    • Directives
      Directives
    • Definition
      Definition
    • Expression
      Expression
    • Constant
      Constant
    • Variable
      Variable
    • Function
      Function
    • Exception
      Exception
    • Comment
      Comment
    Syntax Basics
  • Script Types
    • dApp Script
      • Annotations
        Annotations
      • Callable Function
        Callable Function
      • Verifier Function
        Verifier Function
      dApp Script
    • Account Script
      Account Script
    • Asset Script
      Asset Script
    Script Types
  • Standard Library
    • Version 5: What’s New
      Version 5: What’s New
    Standard Library
  • Data types
    • Any
      Any
    • BigInt
      BigInt
    • Boolean
      Boolean
    • ByteVector
      ByteVector
    • Int
      Int
    • String
      String
    • Unit
      Unit
    • List
      List
    • Tuple
      Tuple
    • Union
      Union
    Data types
  • Structures
    • Script Actions
      • BinaryEntry
        BinaryEntry
      • BooleanEntry
        BooleanEntry
      • Burn
        Burn
      • DeleteEntry
        DeleteEntry
      • IntegerEntry
        IntegerEntry
      • Issue
        Issue
      • Lease
        Lease
      • LeaseCancel
        LeaseCancel
      • Reissue
        Reissue
      • ScriptTransfer
        ScriptTransfer
      • SponsorFee
        SponsorFee
      • StringEntry
        StringEntry
      Script Actions
    • Common Structures
      • Address
        Address
      • Alias
        Alias
      • Asset
        Asset
      • AssetPair
        AssetPair
      • AttachedPayment
        AttachedPayment
      • BalanceDetails
        BalanceDetails
      • BlockInfo
        BlockInfo
      • Invocation
        Invocation
      • Order
        Order
      • Transfer
        Transfer
      Common Structures
    • Transaction Structures
      • BurnTransaction
        BurnTransaction
      • CreateAliasTransaction
        CreateAliasTransaction
      • DataTransaction
        DataTransaction
      • ExchangeTransaction
        ExchangeTransaction
      • GenesisTransaction
        GenesisTransaction
      • InvokeScriptTransaction
        InvokeScriptTransaction
      • IssueTransaction
        IssueTransaction
      • LeaseCancelTransaction
        LeaseCancelTransaction
      • LeaseTransaction
        LeaseTransaction
      • MassTransferTransaction
        MassTransferTransaction
      • ReissueTransaction
        ReissueTransaction
      • SetAssetScriptTransaction
        SetAssetScriptTransaction
      • SetScriptTransaction
        SetScriptTransaction
      • SponsorFeeTransaction
        SponsorFeeTransaction
      • TransferTransaction
        TransferTransaction
      • UpdateAssetInfoTransaction
        UpdateAssetInfoTransaction
      Transaction Structures
    Structures
  • Built-in Variables
    Built-in Variables
  • Built-in Functions
    • Account Data Storage Functions
      Account Data Storage Functions
    • Blockchain Functions
      Blockchain Functions
    • Byte Array Functions
      Byte Array Functions
    • Converting Functions
      Converting Functions
    • dApp-to-dApp Invocation Function
      dApp-to-dApp Invocation Function
    • Data Transaction Functions
      Data Transaction Functions
    • Decoding Functions
      Decoding Functions
    • Encoding Functions
      Encoding Functions
    • Exception Functions
      Exception Functions
    • Hashing Functions
      Hashing Functions
    • List Functions
      List Functions
    • Math Functions
      Math Functions
    • String Functions
      String Functions
    • Union Functions
      Union Functions
    • Verification Functions
      Verification Functions
    Built-in Functions
  • Operators
    Operators
  • Pattern Matching: match-case
    Pattern Matching: match-case
  • Iterations with FOLD<N>
    Iterations with FOLD<N>
  • dApp-to-dApp Invocation
    dApp-to-dApp Invocation
  • Limitations
    • Complexity
      Complexity
    • Data Weight
      Data Weight
    Limitations
  • Version 6 (Testnet, Stagenet)
    • Callable Function
      Callable Function
    • Structures
      • Invocation
        Invocation
      Structures
    • Built-in Functions
      • Byte Array Functions
        Byte Array Functions
      • Converting Functions
        Converting Functions
      • Hashing Functions
        Hashing Functions
      • Math Functions
        Math Functions
      • String Functions
        String Functions
      • Verification Functions
        Verification Functions
      Built-in Functions
    • Limitations
      Limitations
    Version 6 (Testnet, Stagenet)
  • Previous Versions: 4 and 3
    • Callable Function
      Callable Function
    • Data types
      • Boolean
        Boolean
      • ByteVector
        ByteVector
      • Int
        Int
      • String
        String
      • Unit
        Unit
      • List
        List
      • Tuple
        Tuple
      • Union
        Union
      Data types
    • Structures
      • Script Actions
        • BinaryEntry (v4)
          BinaryEntry (v4)
        • BooleanEntry (v4)
          BooleanEntry (v4)
        • Burn (v4)
          Burn (v4)
        • DataEntry (v3)
          DataEntry (v3)
        • DeleteEntry (v4)
          DeleteEntry (v4)
        • IntegerEntry (v4)
          IntegerEntry (v4)
        • Issue (v4)
          Issue (v4)
        • Reissue (v4)
          Reissue (v4)
        • ScriptTransfer (v3 and v4)
          ScriptTransfer (v3 and v4)
        • SponsorFee (v4)
          SponsorFee (v4)
        • StringEntry (v4)
          StringEntry (v4)
        Script Actions
      • Script Results (v3)
        • ScriptResult
          ScriptResult
        • TransferSet
          TransferSet
        • WriteSet
          WriteSet
        Script Results (v3)
      • Common Structures
        • Address
          Address
        • Alias
          Alias
        • Asset
          Asset
        • AssetPair
          AssetPair
        • AttachedPayment
          AttachedPayment
        • BalanceDetails
          BalanceDetails
        • BlockInfo
          BlockInfo
        • Invocation
          Invocation
        • Order
          Order
        • Transfer
          Transfer
        Common Structures
      • Transaction Structures
        • BurnTransaction
          BurnTransaction
        • CreateAliasTransaction
          CreateAliasTransaction
        • DataTransaction
          DataTransaction
        • ExchangeTransaction
          ExchangeTransaction
        • GenesisTransaction
          GenesisTransaction
        • InvokeScriptTransaction
          InvokeScriptTransaction
        • IssueTransaction
          IssueTransaction
        • LeaseCancelTransaction
          LeaseCancelTransaction
        • LeaseTransaction
          LeaseTransaction
        • MassTransferTransaction
          MassTransferTransaction
        • ReissueTransaction
          ReissueTransaction
        • SetAssetScriptTransaction
          SetAssetScriptTransaction
        • SetScriptTransaction
          SetScriptTransaction
        • SponsorFeeTransaction
          SponsorFeeTransaction
        • TransferTransaction
          TransferTransaction
        • UpdateAssetInfoTransaction
          UpdateAssetInfoTransaction
        Transaction Structures
      Structures
    • Built-in Variables
      Built-in Variables
    • Built-in Functions
      • Account Data Storage Functions
        Account Data Storage Functions
      • Blockchain Functions
        Blockchain Functions
      • Byte Array Functions
        Byte Array Functions
      • Converting Functions
        Converting Functions
      • Data Transaction Functions
        Data Transaction Functions
      • Decoding Functions
        Decoding Functions
      • Encoding Functions
        Encoding Functions
      • Exception Functions
        Exception Functions
      • Hashing Functions
        Hashing Functions
      • List Functions
        List Functions
      • Math Functions
        Math Functions
      • String Functions
        String Functions
      • Union Functions
        Union Functions
      • Verification Functions
        Verification Functions
      Built-in Functions
    • Operators
      Operators
    • Limitations
      • Data Weight
        Data Weight
      Limitations
    Previous Versions: 4 and 3
  • Import Libraries
    Import Libraries
  • Ride Components
    Ride Components
      • English
      • Русский
      On this page
        • Script Types
        • Blockchain Operation
        • Predictable Computational Cost
        • Getting Started
        • Useful Links
      waves_logo Docs

          # About Ride

          Ride is a straightforward, developer-friendly functional programming language for smart contracts and decentralized applications (dApps) on the Waves blockchain.

          # Script Types

          Waves smart contracts are scripts written in Ride. Scripts can be assigned to accounts or tokens (assets). An account with a script assigned to it becomes a dApp or smart account. An asset with a script assigned to it becomes a smart asset.

          Script functionality depends on its type:

          • dApp script enables you to define callable functions that can perform various actions on the blockchain and a verifier function that allows or denies transactions and orders that are sent on behalf of the dApp account.
          • Account script allows or denies transactions and orders that are sent on behalf of the account.
          • Asset script allows or denies transactions involving the asset.

          # Blockchain Operation

          Ride is created specifically for execution within a blockchain environment and optimized for this purpose. Since the blockchain is a distributed ledger, located on many computers all around the world, there is no way to access the filesystem or display anything in the console. Instead, Ride functions can read data from the blockchain:

          • Entries in account data storages (both dApp or smart account and any other account).
          • Balances of accounts.
          • Parameters of tokens.
          • The current blockchain height.
          • Headers of blocks.
          • Transfer transactions (by transaction ID).

          Appropriate functions are described in the Account Data Storage Functions and Blockchain Functions articles.

          Callable functions of a dApp script can accept payments to the dApp and also perform actions applied to the blockchain:

          • Add, modify or delete entries of the dApp account data storage.
          • Transfer token from the dApp balance.
          • Issue, reissue, burn token on behalf of the dApp, sponsorship setup.

          Available script actions depend on Standard library version used.

          # Predictable Computational Cost

          The complexity is defined for each Ride function and operator. The complexities of the used functions and operators make up the script complexity. There are no loops in Ride, so the script complexity can be calculated in advance. The maximum script complexity is limited. Due to these limitations, Waves has low and predictable fees for script execution.

          Because of the lack of loops, the Ride language is not Turing complete. That's why it is not always possible to implement the necessary logic within a single script call. However, it is still possible to perform Turing-complete computations if the algorithm is split into several functions (or even several smart contracts) and invoked sequentially using several transactions.

          # Getting Started

          Learn the language syntax with the Introduction to Ride.

          # Useful Links

          • Ride White Paper (opens new window) (2018)
          • Developer Tools
          • How to Create and Launch dApp: Complete Tutorial
          • Mastering Web3 with Waves (opens new window): a hands-on course.
          Getting Started
          Getting Started