Tezos Developer Documentation

website·Indexed 33 days ago

https://opentezos.com/

Developer resources for the Tezos blockchain protocol, including guides on smart contract development with Michelson, SmartPy, and LIGO. Features documentation for the Tezos Unity SDK, Dapp frontend integration, octez-client CLI, RPC interaction, and blockchain indexing with Que Pasa.

Tokens
134.3K
Snippets
450
Records
933
Agent score
68%

What's inside Tezos

  1. Overview of Tezos Unity SDK core objects

    The Tezos Unity SDK utilizes three primary objects to facilitate Tezos integration within a Unity project:

    1. TezosAPI: The main interface providing methods for executing Tezos-related tasks.
    2. DataProviderConfigSO: A ScriptableObject used to configure the indexer from which Tezos information is retrieved.
    3. TezosConfigSO: A ScriptableObject used to store connection details, specifically the RPC node address and the Pinata API key.
  2. Overview of FA2 Token Standards in Tezos

    Tezos supports various token types, primarily Fungible tokens (interchangeable commodities like in-game currency) and Non-fungible tokens (NFTs, unique assets). The FA2 standard is the most commonly supported format, allowing tokens to be compatible across games, wallets, and block explorers. Unity applications are encouraged to use FA2 tokens for this interoperability. To implement FA2 tokens, you must deploy an FA2-compatible smart contract.
  3. Overview of Tezos formal verification with Coq

    Formal verification of Tezos smart contracts involves modeling a Michelson script as a theorem within the Coq proof assistant. This is achieved using the Mi-Cho-Coq library, which provides the formal proof of the Michelson language based on the Curry-Howard isomorphism. The process consists of two main parts using the Gallina language: 'Terms' for specifying logical objects (theorems, axioms, specifications) and 'Vernacular' for writing the proof using tactics.
  4. Overview of Tezos Liquid Proof-of-Stake (LPoS)

    Liquid Proof-of-Stake (LPoS) is an evolution of Delegated Proof-of-Stake (DPoS) used by Tezos (specifically the 'Tenderbake' version since the Ithaca protocol).

    Key characteristics:

    • Bakers: Validators are called 'bakers'. Any user with sufficient coins can become a baker.
    • Delegation: Users without enough coins can delegate their tez and voting rights to a baker.
    • Liquidity: Delegated tez contribute to the baker's rights but are not frozen or at risk of slashing (unless explicitly staked for higher rewards), meaning they remain 'liquid' for the delegator.
    • Minimum Threshold: A validator needs at least 6,000ꜩ to participate in consensus.
  5. Overview of Tezos Blockchain Indexers

    Blockchain indexers are used in Tezos app development to efficiently query and retrieve blockchain data that would otherwise be difficult to search through raw blocks. Indexers on Tezos are generally categorized into two types: full indexers and selective indexers.

    Commonly used Tezos indexers include:

    • Full Indexers: TzKT and TzStats.
    • Selective Indexers: Que Pasa, DipDup, and Dappetizer.
  6. Overview of the SmartPy framework

    SmartPy is a Python library used to construct smart contracts for the Tezos blockchain. It utilizes meta-programming, where Python scripts are used to generate the contract logic which is then translated into Michelson code for execution on-chain. Because Python's native control statements cannot be overloaded, SmartPy provides its own set of commands (e.g., sp.if, sp.else, sp.for, sp.while) that must be used instead of native Python keywords to ensure the code can be compiled to Michelson.
    import smartpy as sp
    
    # Example of a SmartPy command
    sp.if self.data.x > 2:
        self.data.x += 1
  7. Overview of Tezos smart contracts

    A Tezos smart contract is an immutable piece of code stored on the blockchain consisting of a set of instructions and rules. Tezos uses a stateful accounts model with two types of accounts: Classic accounts (starting with tz) used to store tez, and Smart contract accounts (starting with KT1) which store both code and tez. Smart contracts are immutable once deployed; while their internal state (storage) can change, the underlying code cannot. They cannot interact with the outside world directly and require decentralized applications (Dapps) to provide external interfaces.
  8. Overview of the Mi-Cho-Coq library

    Mi-Cho-Coq is a formalization of the Michelson language using the Coq interactive theorem prover. It acts as a bridge between Tezos smart contracts and formal proofs, allowing developers to produce a 'Modeling theorem' for a Michelson script. The library provides a formal definition in Gallina for the Michelson type system, syntax (instructions), semantics (evaluator), and lexing/parsing.
  9. Overview of the SmartPy development workflow

    SmartPy is a high-level smart contract library based on Python that allows developers to write Tezos smart contracts without writing low-level Michelson code directly. The compilation process follows this pipeline:

    1. SmartPy (Python): The developer writes the contract using Python syntax.
    2. SmartML (OCaml): The Python code is evaluated and translated into SmartML, which are abstract syntax trees handled by the SmartEngine OCaml library.
    3. Michelson: The SmartML is compiled into a single Michelson file, which is the low-level, stack-based language actually deployed on the Tezos network.
  10. Overview of Decentralized Autonomous Organizations (DAOs) on Tezos

    A DAO is an organization that utilizes open-source smart contracts to automate and distribute decision-making, reducing the risk of human error or manipulation by removing centralized control. However, users should be aware that DAOs carry risks associated with smart contract vulnerabilities, where coding errors can lead to significant loss of funds.
  11. Overview of the LIGO Testing Framework

    LIGO includes a built-in Testing Framework that allows developers to write tests using the LIGO language itself. Because LIGO flavors are compatible, it is possible to write tests in one flavor (e.g., mligo) to test source code written in another flavor (e.g., jsligo).
  12. Overview of the TzKT Indexer

    TzKT is a full blockchain indexer developed by Baking Bad. It uses a PostgreSQL database to store recognized on-chain data. Key features include:

    • Real-time Updates: Supports WebSocket API for new transactions and contract calls.
    • Token Support: Assigns identifiers to tokens and indexes off-chain metadata from IPFS (recognizing TZIP-12 ledger structures).
    • Fast Deployment: Supports database snapshots to avoid indexing the blockchain from scratch.
    • Automatic Rollbacks: Handles blockchain reorganizations by rolling back affected rows without corrupting the database structure.