Skip to main content

Polkadot-Dart

  • Proposer: Michael So

  • Payment Address: 3PbhNyWhiSTwb58fc5uYhg2mV2vJ34KwAJ

  • Status: Terminated

Project Overview 📄

Overview

Dart has advantages in native development.

Dart is a computer programming language developed by Google, which is used in the development of web, server, mobile apps and the IoT. Dart is an object-oriented, class-defined, single-inheritance language. Dart is a general programming language developed by Google, which was later recognized as a standard by ECMA (ECMA-408). It is used to build web, server, desktop and mobile applications. Its syntax is similar to C language and can be translated into JavaScript, interfaces, mixins, abstract classes, reified generics, optional typing and sound type system .

Dart is very positive for Polkadot. Currently Polkadot-JS (hereinafter referred to as JS API) provides developers with a complete JS API for interacting with the Polkadot. Both Web and App can call JS API. But the problem is that in App development and design, developers must provide a built-in browser interface on the front end, and then use JavaScript to implement JS API calls. The web is embedded in the app, which will cause the front-end page to load slowly, the development framework is not easy to maintain, and the native functions cannot be fully invoked.

Flutter and Dart are born for cross-platform applications development. As Dart is using in the development of Flutter, we propose that using Dart language to develop tools for Polkadot/Substrate will be a better solution.

As a new framework, there are not many blockchain SDKs suitable for Flutter. Ethereum provides web3dart, which is a relatively complete Dart implementation. It contains important features such as JSON RPC encapsulation, offline signature, ABI encoding and decoding, and its goal is to provide a dart version of web3.js, which can meet the needs of most Flutter applications to connect to the Ethereum blockchain.

Similarly, we also found that there is currently no Polkadot SDK suitable for the development of the Flutter framework, although we have seen that some members of the community use Flutter/Dart to implement some wallets or some scattered tools, which is not a complete interactive implementation. For example, encoding and decoding, crypto standards, api design, etc., should all follow the design of Polkadot-JS and be completely migrated to the Dart language.

Similar to polkaj (Java version), we will develop the Dart version and name it Polkadot-Dart.

Project Details

To complete the porting, we follow the project structure of Polkadot-JS.

There are some differences between Dart and Javascript, and the project needs to be compatible. For example, The "wasm" compiled by Rust-lang is used in Polkadot-JS . As for dart, we use dart:ffi for communication. All Rust-native libraries will be compiled to .so for Linux/Android system, .a or .framework for iOS/MacOS, and .dll for Windows.

And for the extension packages, we must realize that it is only available for WebApp based on JavaScript browsers. As for Dart/Flutter, we have to find another way to interact with WebApp and have other solutions for JavaScript app/Dapp, please refer to Pocket4D WIKI .

Therefore, we defined Dart project like Polkadot-JS .

Polkadot-JSPolkadot-Dart
wasmRust bindings
@polkadot/wasmcrypto
common
@polkadot/utilsutils
@polkadot/util-cryptoutil_crypto
@polkadot/keyringkeyring
@polkadot/networksnetworks
@polkadot/x-fetch* not needed
@polkadot/x-randomvalues* not needed
@polkadot/x-textdecoder* not needed
@polkadot/x-textencoder* not needed
api
@polkadot/api-contractapi_contract
@polkadot/api-deriveapi_derive
@polkadot/apiapi
@polkadot/metadatametadata
@polkadot/rpc-corerpc_core
@polkadot/rpc-providerrpc_provider
@polkadot/typegen* not needed
@polkadot/type-known* not needed
@polkadot/typestypes

Technology Stacks

Dart/Flutter, Rust

Ecosystem Fit

Similar projects:

We have created Polkadot-Dart, which, combined with Flutter framework, can greatly reduce the barrier to participation for cross-platform developers, as well as reduce the complexity of cross-platform application development and maintenance. In addition, the cross-platform experience of Polkadot-Dart's users is also improved.

Team 👥

Team members

  • Michael So
  • Zhongdan Wei

Team Website

SHANGHAI NIEPAN INFORMATION TECHNOLOGY CO., LTD., a startup company focusing on blockchain development in China.

Team's experience

  • Michael So, founder of FireStack, Serial entrepreneur. He devoted to blockchain for many years, leading token investment, wallet, blockchain game platform and other projects, and has accumulated rich experience in blockchain theories and practice.
  • Zhongdan Wei, front-end architect, proficient in Flutter. As a leading member in Hellobike, he led the team to develop the Mobike Applications and makes it easy and fast to add flutter to existing mobile applications.

Team Code Repos

Team LinkedIn Profiles

None.

Development Roadmap 🔩

Overview

  • Total Estimated Duration: 5 months
  • Full-time equivalent (FTE): 5.3
  • Total Costs: 1.48 BTC

Milestone 1 — Porting common and wasm

  • Estimated Duration: 1 month
  • FTE: 2
  • Costs: 0.56 BTC
NumberDeliverableSpecification
0LicenceMIT
1bindings/cryptoRust binding and implements @polkadot/wasm
2util_cryptoPorting and implements @polkadot/util-crypto
3utilsPorting and implements @polkadot/utils
4keyringPorting and implements @polkadot/keyring
5networkPorting and implements @polkadot/network
6testsUnit tests for deliverables above

Milestone 2 — Porting api

  • Estimated Duration: 1 month
  • FTE: 1
  • Costs: 0.00 BTC
NumberDeliverableSpecification
0migrationmigrate all existing code to Null Safety
1rpc_corePorting and implements @polkadot/rpc
2rpc_providerPorting and implements @polkadot/rpc_provider
3metadataPorting @polkadot/metadata

Milestone 3 — Porting api

  • Estimated Duration: 1.5 month
  • FTE: 1
  • Costs: 0.00 BTC
NumberDeliverableSpecification
0typesPorting @polkadot/types
1api_derivePorting @polkadot/api-derive
2api_contractPorting @polkadot/api-contract
3apiPorting @polkadot/api
4testsUnit tests for deliverables above
5pub.devPublish to pub.dev for v1.0.0-dev1

Milestone 4 — Publishing

  • Estimated Duration: 1.5 month
  • FTE: 1.3
  • Costs: 0.92 BTC
NumberDeliverableSpecification
0testsIntegration tests for all milestones
1documentationsDocumentations for all packages
2pub.devPublish to pub.dev for v1.0.0

Community Engagement

We are buiding our community on https://www.yuque.com/?language=en-us and newsletters will be regularly updated soon.

What has been done so far?

Milestone 1

StatusNumberDeliverableSpecification
0LicenceApache 2.0
1bindings/cryptoRust binding and implements @polkadot/wasm
2util_cryptoPorting and implements @polkadot/util-crypto
3utilsPorting and implements @polkadot/utils
4keyringPorting and implements @polkadot/keyring
5networkPorting and implements @polkadot/network
6testsUnit tests for deliverables above

Future Plans

Maintainance

  1. Keep following the upgrade of Polkadot-JS and Substrate, and supporting latest upgrades as soon as possible.
  2. Seperate the rust/dart binding libs and other implementations to serveral packages, the native binding libs should be minimize and stable for long term, just like @polkadot/wasm does. And we should be focusing on upgrading the features.

Products and ecosystems

  1. We have a plan of making a wallet app, using Polkadot-Dart as its main dependency, which has been communicated with many parachains, to prepare for linking into Parachains and lowering the threshold for users to use.
  2. We also have another substrate-based project called Pocket4D, combining Polkadot-Dart and other components, we plan to build a new decentralized network. And Polkadot-Dart will be one of our client side core dependency.
  3. The main purpose of this lib is to co-operate with ecosystem partners, especially Parachains, we need to build and test with them and fit their needs.

Additional Information ➕

Are there are any teams who have already contributed (financially) to the project?

No.

Have you applied for other grants so far?

Pocket4D