Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This amend adds a new milestone and update the value of the milestone 3, we underestimated the effort required to support signed transactions, I detailed the new challenges below:
1. Lack of documentation and inconsistencies
Many important components necessary for implement signed extrinsics are not documented or have ambiguous implementations, one example is Substrate BIP-39, while the original Bitcoin BIP39 is well documented, substrate's BIP39 have no documentation at all, so we must rely on the code as reference, it is also fragmented between substrate-bip39 and Substrate repos, and there's a lot of complexity and tiny details there, such as derivation is algorithm dependent, the usage of specific strings for key derivation. Another issue is that the implementation between polkadot-api and subkey are not consistent, example:
Now using Substrate's Subkey:
Both generate different addresses when the junction have more than 64bits. I believe we are the only solution in the ecosystem besides Substrate that correctly implements the Substrate-BIP39 standard:
https://github.com/rankanizer/polkadart/tree/main/packages/substrate_bip39
We found some complexity we didn't anticipate implementing other components too:
2. No Schnorrkel Library for Dart
Some cryptographic libraries like schnorrkel only exists in Rust, Polkadot-api uses native rust compiled to wasm for signing transactions, we cannot do the same in dart because Flutter runs on web, mobile and desktop devices, we can't assume a native Wasm Runtime like polkadot-api does, and creating native bindings in flutter is not trivial either, it requires us to create one binding for each platform (iOS, Android, Windows, Web, MacOs, etc), and using native bindings requires Flutter developers to have the rust toolchain installed in order to use our library. Another solution is rewrite the schnorrkel in pure dart, we are still deciding how to approach this issue.
3. Extra work for Signed Extrinsics
Substrate metadata itself doesn't provide all necessary info for building a valid transaction, RPC modules and Signed Extensions must be implemented individually for each chain [link], we had to refer to different repos to understand how to properly fill up the signed extensions.
The new Plan
While we have a lot of talented Dart/Flutter developers working in this Project, just a few of them have the necessary experience and understanding of Substrate's codebase to effectively porting it to Dart. Also I would like to highlight that Polkadart is as complex as polkadot-api and capi.
Below the new plan and current development status, we decide to split the milestone 3 in two parts, where on milestone 4 we will focus on Sr25519 and other minor functionalities.
Milestone 3:
Milestone 4:
We are very proud of Polkadart, even without signed extrinsics, we already have external contributors and the project is being used in production already. Thanks to Polkadart many Flutter developers joined the Substrate ecosystem. We would love to keep supporting this project, count on us to get this done!