cake_wallet icon indicating copy to clipboard operation
cake_wallet copied to clipboard

decred: Add decred.

Open JoeGruffins opened this issue 1 year ago • 12 comments

part of #986

This pr adds a decred simple payment verification wallet. It does this by taking code at https://github.com/decred/dcrwallet and packaging it with https://github.com/decred/libwallet into a c library that we then use in cake. All private info is kept locally. The wallet will download and verify all block headers and c filters that it uses to find transactions. Thus initial sync can take a bit, depending on bandwidth. After initial sync subsequent syncs and other wallet functions are pretty fast.

There are still some points that need to be resolved that are listed in the body of #986 but this pr is big enough. We hope to get this into master before starting on those.

JoeGruffins avatar Mar 07 '24 06:03 JoeGruffins

Updated the dcrwallet version and now we can always sync from the wallet birthday which is encoded in the mnemonic.

JoeGruffins avatar Jun 27 '24 04:06 JoeGruffins

possible bugs found by @ukane-philemon review:

The following is fixed: ~~- Cannot view address when losing peers but was synced:~~ ~~DCR Wallet address is not shown when the wallet is disconnected or it just reconnected but we were already on the view address page. (I think we should still show the wallet address connected or not, btc does)~~

~~- Missing tx history:~~ ~~Missing transaction history: I sent 500 and 45 dcr to the same address at the same time. But got only the transaction history for the first transaction.~~

~~- Importing the same wallet from seed twice:~~ ~~Importing a wallet whose seed already exists works (for dcr and btc). (intenended?)~~ ~~The wallet becomes watch-only and users are not able to send from it. However, the send and exchange btns remains active and the user gets an error:~~

We suspect this one is an upstream issue... ~~- Can't use address book:~~ ~~Address book is bugged. it creates a new field entry and uses the title as the wallet address and error~~

JoeGruffins avatar Jul 17 '24 06:07 JoeGruffins

Another possible huge bug found by @ukane-philemon

  • wallet is not found on ios:
  1. I've noticed that creating a dcr wallet on iphone takes a considerable amount of time to finish, ~70sec+.
  2. There's something wrong with the wallet data path(as observed on iphone). You create a wallet, restart the app and the wallet dir no longer exists. I've investigated the issue but I've got only some information. a. Even when a new wallet is created, args["dataDir"] does not exist. b. args["dataDir"] is the same as walletInfo.dirPath.
flutter: create walletflutter: create wallet
flutter: /var/mobile/Containers/Data/Application/4B56953B-9A65-49F4-82B0-6BABCF5D4253/Documents/wallets/decred/Cylindrical Layer # print(args["dataDir"]!);
flutter: false # print(File(args["dataDir"]!).existsSync());
flutter: create wallet end
flutter: /var/mobile/Containers/Data/Application/4B56953B-9A65-49F4-82B0-6BABCF5D4253/Documents/wallets/decred/Cylindrical Layer # print(args["dataDir"]!);
flutter: false # print(File(args["dataDir"]!).existsSync());
flutter: create wallet end

After a restart:

flutter: load wallet
flutter: /var/mobile/Containers/Data/Application/4B56953B-9A65-49F4-82B0-6BABCF5D4253/Documents/wallets/decred/Cylindrical Layer # print(args["dataDir"]!)
flutter: false # print(File(args["dataDir"]!).existsSync();
flutter: load wallet end

JoeGruffins avatar Jul 19 '24 22:07 JoeGruffins

@mkyq @OmarHatem28

Can you guys review this? Decred community is eager to be on Cake.

exitus1 avatar Sep 02 '24 05:09 exitus1

Hi All, let's get it release please!

cyangibm avatar Sep 02 '24 05:09 cyangibm

Hello, please integrate Decred to Cake Wallet :)

AllRiseDecredandMonero avatar Sep 02 '24 05:09 AllRiseDecredandMonero

This would be great for cake wallet and Decred. Can you guys review

gregpent avatar Sep 02 '24 05:09 gregpent

Cake is used by many in the privacy community I can't foresee this integration being anything other than positive for DCR. Looking forward to seeing activity here. Keep up the great work devs and thank you for all you do. We know it isn't easy.

jason-at-github avatar Sep 02 '24 07:09 jason-at-github

Decred would be a great addition to Cake wallet

areyoufooled avatar Sep 02 '24 18:09 areyoufooled

Any news on this?

MyWay avatar Sep 02 '24 22:09 MyWay

Can we have someone look at this since all the devving has been done and waiting for a while now?

artikozel avatar Sep 03 '24 12:09 artikozel

Decred community would appreciate a review 🙏

norwnd avatar Sep 26 '24 09:09 norwnd

Just rebased. Will probably put all suggested changes in a new commit.

Also, I'm currently unable to test ios/mac as I do not own one. I have been relying on @itswisdomagain and @ukane-philemon there but they have not tested the current rebase yet. It may or may not work presently. Will let you know if they have been able to test.

JoeGruffins avatar Dec 26 '24 06:12 JoeGruffins

Removed the commit to do with checking if a wallet exists. Addressed most comments as well as I can. Added another commit from wisdom about imports. https://github.com/cake-tech/cake_wallet/compare/5e465c97f635d6dba62f4fcb170a68cfd138f942..05de46bee95532ba5013ecc9831592a31bdab24b

I'm still looking at what we need to do with addresses. We need to supply some number to cake? We can get nearly infinite if we need for something. the internal dcrwallet is handling which are used and won't reuse old ones. Are we showing the old ones somewhere?

I hope to add all changes to this last commit so it will probably be updated more.

JoeGruffins avatar Dec 27 '24 09:12 JoeGruffins

Removed the commit to do with checking if a wallet exists. Addressed most comments as well as I can. Added another commit from wisdom about imports. https://github.com/cake-tech/cake_wallet/compare/5e465c97f635d6dba62f4fcb170a68cfd138f942..05de46bee95532ba5013ecc9831592a31bdab24b

I'm still looking at what we need to do with addresses. We need to supply some number to cake? We can get nearly infinite if we need for something. the internal dcrwallet is handling which are used and won't reuse old ones. Are we showing the old ones somewhere?

I hope to add all changes to this last commit so it will probably be updated more.

~yup, like mentioned here, we do show old addresses in the receive screen for the initial generated addresses it depends on how decred would work, but mainly we tend to give the user a few addresses (maybe 10 or 20) so that he can use them willingly before we auto-generate new addresses when needed~

Edit: nevermind this, yes we can skip it in case of decred you are right

OmarHatem28 avatar Dec 30 '24 03:12 OmarHatem28

@JoeGruffins there are dcrwallet.log and external.log, how can we disable that log files, these are very large in size.

MrCyjaneK avatar Mar 21 '25 16:03 MrCyjaneK