guardaco / zcash-SPV

Zcash Grant SPV library (Sapling)
https://guarda.co/
MIT License
17 stars 2 forks source link

SPV library API discussion #1

Open AndrewGuarda opened 6 years ago

AndrewGuarda commented 6 years ago

Dear Z-Cash foundation and community.Guarda is doing Z-Cash grant SPV library and Wallet Android project #https://github.com/ZcashFoundation/GrantProposals-2017Q4/issues/16. We'd like to have the communications in a transparent and community-oriented way. It will be really great to have any valuable feedback regarding SPV function and methods that we are going to implement. Please leave your comments below and we'll take it into the account.

AndrewGuarda commented 6 years ago

Terms of reference Z-Cash wallet functions:

OS requirements: from Android 4.4 and higher

The list of SPV library methods:

BlinkyStitt commented 6 years ago

Why are you sending change back to the senders address? Address reuse should be avoided if possible. Generating change addresses with an HD wallet is pretty simple and there are already standards for it.

garethtdavies commented 6 years ago

@WyseNynja there is a good post here https://forum.z.cash/t/i-dont-want-too-many-own-addresses-in-my-wallet/22497/2?u=garethtdavies discussing this issue.

garethtdavies commented 6 years ago

In the history for z-addr method should the destination be displayed? See this earlier discussion https://github.com/zcash/zcash/issues/1438

bitcartel commented 6 years ago

@guardaco Is there a reason to support Android 4.4 instead of targeting the latest Android 8.0 and taking advantage of the latest frameworks and toolchain?

chaserileyroberts commented 6 years ago

How is the RNG of generateNewPrivateKey implemented or accessed? It might be a good idea to allow dependency injection in case we learn later that the RNG is compromised.

AndrewGuarda commented 6 years ago

@WyseNynja thank you for the feedback. For the mobile wallet, it's not so useful to have the list of HD addresses, the number of addresses will grow for each outgoing transaction. Finally, the addresses long list will almost useless in mobile interfaces. That's why we decide to use origin address for receiving unspent.

AndrewGuarda commented 6 years ago

@bitcartel there is a number of restrictions for the wallet functionality on 4.4 and early, I'm afraid it will be impossible to have the full wallet functions in that case. For my own opinion the market share of such devices mapped for ZEC users will not so great. Do you have any ideas why we need to support 4.4 and early devices?

Uche32 commented 6 years ago

the amount of Android 8.0 and + are so limited that a former version is the best way, but 4.4 seems a bit to far back in the time. if someone uses still Android 4.4 then he probably should not be into cryptocurrency, just a thought.

mineZcash commented 6 years ago

Are you planning on restricting functionality for devices that have less RAM? Or having some sort of way for the app to detect the hardware?

Generation of a Z-transaction currently takes 1.7GB of RAM and 40seconds to complete.

Newer Android phones have 4GB of system RAM standard (and up to 8GB) but many older Android phones only have 2GB standard.

How do you plan on ensuring that you don't lock up or crash older devices?

AndrewGuarda commented 6 years ago

@mineZcash you're right absolutely. As far as we are doing non-custodial solution, we are not able to use any external wallet services for operations with spending key. So there is no way to generate Z-transaction out of the device. It will be done by the SPV library on the device.

It will take some time, but nobody can avoid it in case of shielded transactions. We'll try to make the process transparent and clear for customers to avoid claims.

For the old devices, we'll do the performance tests and check the results. We can make the limitations or restrictions for z-transactions in case there is no chance to complete it. We'll consult with @lindanlee regarding the best user experience for that users.

I hope Sapling and z2-addr will help to reducу the resources consumption.

bitcartel commented 6 years ago

Android 8 also targets low-end devices. https://www.android.com/versions/oreo-8-0/go-edition/

Android 4.4 is only 12% of the market. https://developer.android.com/about/dashboards/index.html

All those people with old phones running Android 4 will probably upgrade soon, especially as more mobile apps drop support in order to take advantage of latest OS features.

Whilst Google still provides security patches, consider that the last OS release was 4.4.4 (KTU84Q) on July 7, 2014 - almost 4 years ago.

I don't think you need to support Android 4. I do think you should target Android 8 and by the time you have launched the wallet later this year, Android 9 will be out.

daira commented 6 years ago

Doesn't it depend completely on which features are provided by each release since 4.4? There's no point in artificially depending on a release with features that you don't actually need.

daira commented 6 years ago

@AndrewGuarda wrote:

I hope Sapling and z2-addr will help to reducу the resources consumption.

Just a minor point: the prefix for Sapling addresses on mainnet will be "zs".

BlinkyStitt commented 6 years ago

I think Nathan's comment about change addresses is missing several important factors.

I've replied at the official forums: https://forum.z.cash/t/i-dont-want-too-many-own-addresses-in-my-wallet/22497/4?u=wysenynja

AndrewGuarda commented 6 years ago

@WyseNynja thank you so much for the addresses issue. We'll try to implement our best in terms of a mobile wallet

AndrewGuarda commented 6 years ago

@bitcartel you're absolutely right. As far as we'll have z-addr we need to run the application at the high-end devices in terms to get suitable performance.

AndrewGuarda commented 6 years ago

@Thenerdstation RNG is a good point. At the moment we're planning to use built-in RNG. I'm not sure that most users will be ready to use external RNG and can understand why they need it. Almost the same issue with using own blockchain node. It sounds like the expert-level features. Definitely, we need to think about such features in later releases. I appreciate your feedback.

AndrewGuarda commented 6 years ago

Hello all,

we've released in beta our t-addr Zcash wallet. The beta is available at the Play Market https://play.google.com/store/apps/details?id=com.guarda.zec for Zcash community review. I'll appreciate any valuable feedback.

mineZcash commented 6 years ago

Nice work @AndrewGuarda

AndrewGuarda commented 6 years ago

Dear all, please find t-addr SPV-library repository https://github.com/guardaco/zcash-SPV

@mineZcash