Comments (8)
I suggest that we can use native token sdk to develop wallet just like imToken does. After all , the native library performs better than dart does :) . imToken 's native Android & iOS SDK address:
token-core-android
token-core-ios
And I 've developed a flutter package integrated with the token core libs above .
token_core_plugin , I'm glad to hear advices from you :) .
from web3dart.
suggestion: use dart:isolate when doing the encrypt/decrypt job.
from web3dart.
Nice library! I can't let web3dart depend on Flutter plugins because it also supports other platforms (web and server), but I'll try to add an API so that 3rd-party wallet implementations can be used together with web3dart.
from web3dart.
I just published a new version, 1.0.0-rc.0
, which can already delegate some work (signing transactions) to a background isolate, but not yet wallets. I'll try to implement isolate-ready isolates soon, but the api is going to change a bit (will be asynchronous).
But 1.0.0 also lets you integrate third-party wallet libraries into web3dart
by implementing the Credentials
class. You would have to override extractAddress()
and signToSignature()
which both will be used by this library. When using @lhalcyon's library, one could also use await web3client.credentialsFromPrivateKey(await TokenCorePlugin.exportPrivateKey(...))
instead of using wallets directly.
from web3dart.
Oh wow, that's indeed terrible. I'll take a look at this. Does this only affect keystores or is the rest of this library similarily slow?
from web3dart.
only test keystore yet
from web3dart.
@simolus3
This is because that the scrpyt lib in pointcastle does not support very well
In the Wallet.dart, var derivator = new _ScryptKeyDerivator(32, 8192, 8, 1, salt),using these parameters to crypt password, it will costs 2 seconds to decrypt.
However, it only costs less then 200 milliseconds theoretically.
https://stackoverflow.com/questions/11126315/what-are-optimal-scrypt-work-factors
from web3dart.
In the current version of the library, one can change the value of 8192
for the work factor when creating a new wallet via the scryptN
parameter of Wallet.createNew
. You can thus reduce it, if needed.
But the encryption being so slow is arguably a problem of Dart in general. You can reduce the work factor to make the encryption reasonably fast in Dart, but it would be easier to brute-force in languages with a faster implementation (although brute-forcing it would still take ages). In fact, the default value of 2ยนยณ
which takes so long is well below the recommended factor from that page for interactive usage. For sensitive storage, which an Ethereum wallet obviously is, it would take forever to decrypt the wallet in Dart.
There is not much I can do about the performance about the used libraries, sadly ๐
from web3dart.
Related Issues (20)
- NFT dapp HOT 1
- How to set a timeout for Web3Client? HOT 1
- intToBytes mistake
- How to decodeParameters
- web3dart
- Ignore non_constant_identifier_names, camel_case_types in generated (.g.dart) files HOT 5
- Test Net HOT 2
- Support ethers.utils functionality HOT 1
- Bug: Zero address returned from contract call causes exception HOT 20
- web3dart: ^2.3.3
- private Api for centralized blockchain HOT 3
- How can i call smart contract functions through web3dart without private key in flutter HOT 2
- getBlockInformation() - Throws Error HOT 1
- Transaction Lists HOT 2
- How a new user can create an account without private key?
- Support for BEP20 Transfer?
- Value not in Range
- On Ganache V 7.0.0 I am receiving an rpc error "Unhandled Exception: RPCError: got code -32700 with msg "Invalid signature v value"." HOT 1
- Getting transactions with eth_getBlockByNumber
- Doesn't work after building project but works fine in debug
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web3dart.