Level 1: Parallax Virtual Machine
The Parallax Virtual Machine (PVM) is the runtime environment for smart contracts on Parallax. All smart contracts and state changes on the Parallax blockchain are executed by transactions. The PVM handles all of the transaction processing on the Parallax network. As with any virtual machine, the PVM creates a level of abstraction between the executing code and the executing machine (a Parallax node). Under the hood, the PVM uses a set of opcode instructions to execute specific tasks. These (140 unique) opcodes allow the PVM to be Turing-complete, which means the PVM is able to compute just about anything, given enough resources. As a dapp developer, you don’t need to know much about the PVM other than it exists and that it reliably powers all applications on Parallax without downtime.Level 2: Smart contracts
Smart contracts are the executable programs that run on the Parallax blockchain. Smart contracts are written using specific programming languages that compile to PVM bytecode (low-level machine instructions called opcodes). Not only do smart contracts serve as open source libraries, they are essentially open API services that are always running and can’t be taken down. Smart contracts provide public functions which users and applications (dapps) may interact with, without needing permission. Any application may integrate with deployed smart contracts to compose functionality, such as adding data feeds or to support token swaps. Additionally, anyone can deploy new smart contracts to Parallax in order to add custom functionality to meet their application’s needs. As a dapp developer, you’ll need to write smart contracts only if you want to add custom functionality on the Parallax blockchain. You may find you can achieve most or all of your project’s needs by merely integrating with existing smart contracts, for instance if you want to support payments in stablecoins or enable decentralized exchange of tokens.Level 3: Parallax nodes
In order for an application to interact with Parallax, it must connect to a Parallax node. Connecting to a node allows you to read blockchain data and/or send transactions to the network. Parallax nodes are computers running software - a Parallax client. A client is an implementation of the Parallax protocol that verifies all transactions in each block, keeping the network secure and the data accurate. Parallax nodes are the Parallax blockchain. They collectively store the state of the Parallax blockchain and reach consensus on transactions to mutate the blockchain state. By connecting your application to a Parallax node (via the JSON-RPC API), your application is able to read data from the blockchain (such as user account balances) as well as broadcast new transactions to the network (such as transferring laxes between user accounts or executing functions of smart contracts).Level 4: Parallax client APIs
Many convenience libraries allow your applications to connect to and communicate with the Parallax blockchain. If your user-facing application is a web app, you may choose tonpm install
a JavaScript API directly in your frontend. Or perhaps you’ll choose to implement this functionality server-side, using a Python or Java API.
While these APIs are not a necessary piece of the stack, they abstract away much of the complexity of interacting directly with a Parallax node. They also provide utility functions (e.g. converting Laxes to Gwei) so as a developer you can spend less time dealing with the intricacies of Parallax clients and more time focused on the functionality specific to your application.
Level 5: End-user applications
At the top level of the stack are user-facing applications. These are the standard applications you regularly use and build today: primarily web and mobile apps. The way you develop these user interfaces remains essentially unchanged. Often users will not need to know the application they’re using is built using a blockchain.Ready to choose your stack?
Check out our guide to set up a local development environment for your Parallax application.Further reading
- The Architecture of a Web 3.0 application - Preethi Kasireddy