Skip to main content

Prerequisites for Developing on OP_NET

Before starting development on the OP_NET metaprotocol, ensure your environment meets the following requirements. These tools and dependencies are essential to interact with the OP_NET ecosystem efficiently.


System Requirements

Software

  1. Node.js (v22.x) - Not lower or higher

  2. Rust (latest version)

    • Required for compiling and running specific packages, such as @btc-vision/op-vm and @btc-vision/unit-test-framework.
    • Installation Steps for Rust:
      1. Open your terminal.
      2. Run the following command:
        curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
      3. Follow the on-screen instructions.
      4. Verify installation with:
        rustc --version

Essential NPM Packages

The OP_NET ecosystem includes the following NPM packages that streamline development:

Important Packages

  1. opnet

    • The official OP_NET JavaScript SDK for interacting with the metaprotocol.
  2. @btc-vision/transaction

    • A library for creating and signing transactions within the OP_NET environment.
  3. @btc-vision/bitcoin

    • A Bitcoin library like bitcoinjs-lib but specifically designed for OP_NET.
    Important Note

    DO NOT USE bitcoinjs-lib or any other Bitcoin library. Use @btc-vision/bitcoin, which is specifically designed for OP_NET.

  4. @btc-vision/op-vm

    • A virtual machine runtime for OP_NET smart contracts.
    • Requires Rust (latest version) for installation and usage.
  5. @btc-vision/unit-test-framework

    • A testing framework designed for projects utilizing @btc-vision/op-vm.
    • Requires Rust (latest version) for installation and usage.

Hardware Recommendations

  • Processor: Multi-core CPU recommended for faster compilation.
  • Memory: Minimum 8 GB RAM for smooth development.
  • Storage: At least 10 GB of free disk space for dependencies and project files.

Important Warnings

TypeScript Usage

While it is possible to use JavaScript for developing on OP_NET, it is highly recommended to use TypeScript. TypeScript provides type safety, which helps prevent runtime errors and improves code maintainability. Without TypeScript, developers may encounter unexpected issues and errors in their projects.

To get started with TypeScript:

  1. Install TypeScript globally:

    npm install -g typescript
  2. Verify the installation:

    tsc --version

What’s Next?

Once you’ve met these prerequisites, proceed to Setting Up Your Development Environment to start building with OP_NET.

Note

Failure to meet these requirements, especially Node.js v22.x or the latest Rust version, may result in errors during package installation or runtime.