Building Client-side Apps
As with any blockchain, building decentralized applications (dApps) is a significant part of how a developer can build on Polkadot.
As an application developer, you can compose your front-end apps in a few different ways. Because the relay chain and its parachains are all built using the Polkadot SDK. You can often use the same SDK to communicate with the relay chain, a parachain, or any other Substrate-based chain.
Please see the SS58 registry to see which chain corresponds to a given prefix, and which prefixes are available.
SDKS & Libraries
If one aims to develop a dApp (Decentralized App), the Polkadot ecosystem contains various SDKs to tap into the relay chain and parachains. There are several languages already supported - see the tooling page for a detailed overview of different SDKs and libraries that are available.
Frameworks & Toolkits
For front-end applications, several options exist for interfacing with Substrate-based chains (parachains, relay chains, etc.) and smart contracts. These will often interact with the RPC of a Substrate node:
- Polkadot.js
- Polkadot-API
- Reactive DOT
- Subxt
- React Hooks for ink!
- ink!athon Boilerplate
- Polkadot Cloud
Promise and RxJS APIs around Polkadot, Kusama, and other Substrate-based chains via RPC calls. It is dynamically generated based on what the Substrate runtime provides regarding metadata. Full documentation & examples available here.
Polkadot-API will serve as a replacement for Polkadot JS. Full documentation & examples available here.
A reactive library for building Substrate front-ends. Full documentation & examples available here.
Query and submit extrinsics (transactions) to a Substrate node via RPC using Rust. Also referred to as Rust Parity. Full documentation & examples available here.
React hooks library for ink! smart contracts that abstract the functionality of polkadot.js. Full documentation & examples available here.
ink!athon is a starter kit for full-stack dApp development with ink! smart contracts and a React-based frontend in one place. With convenient helper scripts and a pre-configured project setup, you can quickly scaffold any dApp. Live example & full documentation available here.
Polkadot Cloud hosts a library of assets, ranging from data sources, graphical elements, to fully functional components, for app developers to plug and play into their codebases. Learn more here.
Oracle Options
In the blockchain context, an oracle is a way to bring real-world data onto the blockchain so that it can be used by a decentralized application.
Oracles serve many purposes for application builder, as they allow for outside data (price feeds, the ability to make HTTP requests, etc) to enter the decentralized world.
Oracle solutions range from centralized and trusted to decentralized and game-theory based. On the centralized end of the spectrum, an oracle could be a single account that has the authority to dictate the real-world data on-chain. On the decentralized end, a complex game of "chicken" can be played among various staked actors who risk getting slashed if they don't submit the same data as everyone else.
- Chainlink
- Acurast
Solutions such as Chainlink fit somewhere in the middle, where the amount of trust you put into the reporting oracles can be adjusted based on your preferences. A Chainlink Feed Pallet is available to allow smart contracts across smart contract-enabled parachains to access price reference data and is available as a Substrate oracle pallet.
Solutions such as Acurast enables developers to delegate oracle requests to their network of phones, which provide off-chain data and computation to the Acurast Pallet. Acurast supports both Substrate (WASM) and EVM environments.
When using an oracle in your application you should be aware of the benefits and risks that are baked into its specific model.
Decentralized Storage Options
Storage is an integral part of modern computer systems, and the same is true for distributed and decentralized systems like a blockchain. When interacting with the Polkadot ecosystem, it will be helpful if you familiarize yourself with the current Web3 approach towards decentralized storage.
DCS (Decentralized Cloud Storage)
The key attribute that characterizes centralized cloud storage is the location of data. In decentralized cloud storage, the key attribute becomes the data itself instead of the data's location. This can be viewed as the shift from the centralized location-centric storage approach to the decentralized content-centric approach.
- IPFS (Interplanetary File System)
- Crust Storage
- Filebase
IPFS is a peer-to-peer distributed file system that seeks to connect all computing devices with the same system of files, by utilizing features such as content-addressing, content-signing, and enhanced security methods through encryption. IPFS aims to address the current hurdles of the HTTP-based Internet.
Crust Network provides a Web3.0 decentralized storage network for the Metaverse. It is designed to realize core values of decentralization, privacy, and assurance. Crust supports multiple storage-layer protocols such as IPFS, and exposes instant accessible on-chain storage functions to users. Crustʼs technical stack is also capable of supporting data manipulating and computing.
Crust provides a native cross-chain communication pallet based on XCMP, called xStorage.
The protocol also supports most smart contract platforms, including Ethereum, with its cross-chain dStorage solution.
To learn more about Crust, check out the Crust Network Wiki. Try integrating with Crust by following their Crust Storage 101 guide.
Filebase is the first S3-compatible object storage platform that allows you to store data in a secure, redundant, and performant manner across multiple decentralized storage networks.
Filebase offers a geo-redundant IPFS pinning service that allows you to pin files to IPFS across multiple diverse geographic locations. All files uploaded to IPFS through Filebase are automatically pinned to the Filebase infrastructure with 3x replication across the globe. This ensures that your data is globally available and redundant at all times.
Filebase acts as an easy on-ramp to IPFS and decentralized storage by offering a user-friendly web console dashboard, making drag-and-dropping files onto Web3 simple and easy. Filebase also provides an S3-compatible API for widespread integrations and configurations in current workflows.
To learn more about Filebase, check out the Filebase Documentation, and specifically the documentation on deploying Polkadot dApp on decentralized storage. You can get started with Filebase by signing up here.