This repo is a cumulative developments and exploration of the radixdlt. The purpose is to show case a prototype of off-ledger snapshot polling on the radix network. It started off as an exploration of using on-ledger smart contracts from radix-simple-vote to represent votes and evolved into off-ledger snapshot polls.
Radix serves as the underlying distributed ledger technology for this project. To better understand and utilize Radix, consult the following relevant resources (in-order):
- Radix Documentation: The official Radix documentation provides comprehensive insights into the technology, its features, and its usage.
- Scrypto: Although not mandatory for snapshot polling due to its off-ledger nature, the Scrypto section offers an excellent introduction and conceptual understanding of Radix's built-in components and workflows.
- Transaction Manifests: This section defines the specification for constructing transaction manifests. Transaction manifests consist of sequential instructions that enable a single transaction to execute multiple tasks or smart contract calls.
- Radix Wallet & Mobile App and Browser Extension Installation: The quickest way to set up a wallet with the testnet (RCnetV2 or Ansharnet) is to request and install the preview mobile wallet. Additionally, the Radix Connector extension facilitates communication between dApps and the wallet.
- Radix dashboard: Introduction and usage of the dashboard. The dashboard allows submission of transactions with arbitrary manifests and managing dApp definitions. It can also be employed as an explorer to investigate accounts, transactions, and resources.
- Radixdlt discord: For information that may not be explicitly documented, you can often find insights within existing threads or directly inquire in the discord channel. The #scrypto channel is particularly suitable for addressing development-related questions.
The easiest way to interact with the radix network would be to use the provided typescript sdks:
- Radix engine toolkit: This toolkit furnishes essential lower-level functionalities by wrapping the Rust Radix engine compiled to WebAssembly (WASM).
- Gateway SDK: Wraps gateway API endpoints to submit and query the public gateway Base URL for the RCnetV2.
- Core API SDK: Wrap Core API endpoints for lower level queries directly to a running node. Use the testnet-node docker compose to run a local node.
- Radix dApp toolkit: Intended for dApp front-ends. Wraps the gateway sdk and the connector browser extension to allow data requests and wallet interaction.
Snapshot polling is a governance mechanism predominantly executed off-ledger. It enables decentralized applications (dApps) to employ a specific token for vote verification during polling. The polling process is outlined as follows:
- An administrator or user initiates a poll by defining the governance token and the time the poll will close.
- Users holding the designated governance token can cast their votes and provide proof of their address ownership.
- After reaching the designated close time, the poll concludes. Subsequently, the system checks the current ledger snapshot to validate that voters genuinely possess the specified governance token.
- Post verification, a report is generated to display the final vote count and results.
To develop on this repo, a flake.nix is provided, put together from the Nix wiki to make available rust tooling for scrypto on-ledger development. It also provides NPM and nodejs for the typescript implementations of snapshot polling. Note that rust tooling is not required to run snapshot polling and any of the off-ledger code. For that the only dependency NodeJS and NPM.
Conains the front-end for snapshot polling. Provides simple interface to create polls, vote and close polls. Link to the connector extension for authentication of accounts.
Contains the backend for snapshot polling. Responsible for management of polls, authentication and voter verification.
Contains services and a library for querying historical data on account balances. Its purpose to be a narrower, but more performant replacement for the Gateway API from Gateway SDK.
For more details and deployment instructions please check out docs.