mjg-foundation / passport2-monero

v2.x.x series of firmware for Passport, rebuilt for monero
Other
29 stars 3 forks source link

Mobile Wallet with Airgapped Signing #3

Open mjg-foundation opened 1 year ago

mjg-foundation commented 1 year ago

Currently, no monero wallets support airgapped signing. We need mobile and desktop wallets to connect with, otherwise this effort will be pointless. The UI should be similar to passport's bitcoin signing flow:

  1. Connect with passport by importing the monero private view key via QR or microSD
  2. Build a transaction on the mobile wallet (format TBD in #13 )
  3. Output an unsigned transaction via UR2 or microSD
  4. Passport imports the transaction, displays details, and signs the transaction
  5. Passport exports the transaction via UR2 or microSD
  6. The mobile wallet publishes the transaction to the network

The bounty for this issue is for the first (FOSS) mobile wallets, supporting Android and/or IOS, to support this functionality. If others want to make bounties for other wallets ITT, feel free.

Bounty: 1.4 XMR for Android, .6 XMR for IOS, .25 XMR for the first mobile wallet on either mobile OS to be compatible with feather wallet or CLI wallet cold signing

Payout upon merge of a PR to a wallet, an APK to test for Android, and/or release on app store for IOS

rbrunner7 commented 1 year ago

Not sure, but maybe it would be worth to connect and possibly coordinate or even work together with somebody who, as far as I understand, currently implements something similar: https://twitter.com/MoneroSigner

The project was funded by the community through the CCS, with a bit more than 55 XMR: https://ccs.getmonero.org/proposals/MoneroSigner.html

r4v3r23 commented 1 year ago

iOS support seems like an unnecessary requirement for this

mjg-foundation commented 1 year ago

iOS support seems like an unnecessary requirement for this

I'd like a mobile wallet that has as much reach as possible. I understand how limiting this can be, so if you like, you could specify your own bounty here

r4v3r23 commented 1 year ago

iOS support seems like an unnecessary requirement for this

I'd like a mobile wallet that has as much reach as possible. I understand how limiting this can be, so if you like, you could specify your own bounty here

Android has over 70% market share, and this feature is definitely geared more toward power users, who will almost always be using an open source OS like Android.

consider making iOS optional with a bonus bounty to incentivize Android devs to pick this up

mjg-foundation commented 1 year ago

Good idea, will update OP

r4v3r23 commented 1 year ago

also, looks like steps 1, 4 & 5 require XMR support on the passport

is payout for a working mobile wallet that supports airgapped txs in general, or specifically with the passport?

mjg-foundation commented 1 year ago

Ideally devs can simulate passport's end by building out the microSD UI, and working with the monero wallet CLI as described in #13 . Just be careful to keep abstraction between the microSD UI and the signing functionality, so UR support can be added more easily. Payout is dependent on passport and #6 , but can be developed in parallel.

Monero-HackerIndustrial commented 1 year ago

One thing to note is that monero transactions are bigger than a bitcoin transaction. Monero transactions are bigger than the data limit of the QR standard. This tx size might be bigger or smaller in the future and should be something to plan for. As part of my work on Monerosigner I have worked on a simple protocol called "Portable Monero QR" to have some standard for arbitrary data transfer through QR codes. (https://github.com/Monero-HackerIndustrial/PortableMoneroQR )

How does it work?

The Portable QR code standard breaks larger files into smaller frames of encoded data. Each frame is a QR code. The QR code can be animated at a variable fps offset which starts fast but gets slower over time. The fps offset is optimized for slow row res cameras but doesn't hinder faster quality cameras as it starts with a faster fps and eventually slows down to slower for slower cameras.

A simple transfer like that is basically a base64 json with the following data in each frame:

frame = {
"index" = 0,
"total" = 8,
"data" = base64(data)
}

The frame data is included with each frame which means order received for the data doesn't matter as the end application can reconstruct the data and decode it.

The protocol is still being built and not set in stone yet. The goal is a simple QR transfer protocol for arbitrary sized data and non sequential transfer. Implementing this for QR codes might be beneficial since the monero unsinged txs are rather large.

mjg-foundation commented 1 year ago

You might want to look into the UR standard made by blockchain commons, there may be some duplication of work here. UR is already in passport

r4v3r23 commented 1 year ago

Ideally devs can simulate passport's end by building out the microSD UI, and working with the monero wallet CLI as described in #13 . Just be careful to keep abstraction between the microSD UI and the signing functionality, so UR support can be added more easily. Payout is dependent on passport and #6 , but can be developed in parallel.

Ok, just so I understand the requirements of this bounty: its for the monero equivalent of Passport's Envoy app that doesn't store private spend key. The app should be able to: create unsigned tx to pass to a cold wallet for signing, then broadcast that signed tx.

Since Passport currently doesn't support monero and can't act as the signing device, it would have to be tested with another wallet that supports airgapped transactions, like Feather Wallet (desktop). Would using this app to successful spend an airgapped tx usng Feather as the signing wallet be enough to claim the bounty?

mjg-foundation commented 1 year ago

Ideally devs can simulate passport's end by building out the microSD UI, and working with the monero wallet CLI as described in #13 . Just be careful to keep abstraction between the microSD UI and the signing functionality, so UR support can be added more easily. Payout is dependent on passport and #6 , but can be developed in parallel.

Ok, just so I understand the requirements of this bounty: its for the monero equivalent of Passport's Envoy app that doesn't store private spend key. The app should be able to: create unsigned tx to pass to a cold wallet for signing, then broadcast that signed tx.

Since Passport currently doesn't support monero and can't act as the signing device, it would have to be tested with another wallet that supports airgapped transactions, like Feather Wallet (desktop). Would using this app to successful spend an airgapped tx usng Feather as the signing wallet be enough to claim the bounty?

Only if #13 results in us documenting and adopting the format that wallet exports the unsigned transaction info in. You could get 99% of this done with feather wallet's format, abstract out your formatter, and swap it with the format we adopt to complete the bounty. I'll throw in a extra bounty of .25 XMR for the first mobile wallet to get to that point, with either feather or wallet2's formats (idk if theyre the same)

r4v3r23 commented 1 year ago

Ideally devs can simulate passport's end by building out the microSD UI, and working with the monero wallet CLI as described in #13 . Just be careful to keep abstraction between the microSD UI and the signing functionality, so UR support can be added more easily. Payout is dependent on passport and #6 , but can be developed in parallel.

Ok, just so I understand the requirements of this bounty: its for the monero equivalent of Passport's Envoy app that doesn't store private spend key. The app should be able to: create unsigned tx to pass to a cold wallet for signing, then broadcast that signed tx. Since Passport currently doesn't support monero and can't act as the signing device, it would have to be tested with another wallet that supports airgapped transactions, like Feather Wallet (desktop). Would using this app to successful spend an airgapped tx usng Feather as the signing wallet be enough to claim the bounty?

Only if #13 results in us documenting and adopting the format that wallet exports the unsigned transaction info in. You could get 99% of this done with feather wallet's format, abstract out your formatter, and swap it with the format we adopt to complete the bounty. I'll throw in a extra bounty of .25 XMR for the first mobile wallet to get to that point, with either feather or wallet2's formats (idk if theyre the same)

sounds good. i've got everything needed to make it happen, just need more bounties to help cover the costs. ill check back soon once this has gotten more interest

vdo commented 1 year ago

I add 1XMR to the bounty

mjg-foundation commented 1 year ago

I add 1XMR to the bounty

Cool! Which bounty?

raypeat commented 1 year ago

I'll add 0.5 XMR to the Android bounty

vdo commented 1 year ago

I add 1XMR to the bounty

Cool! Which bounty?

Android one

detherminal commented 1 year ago

I am working on adding this into Stack Wallet

mjg-foundation commented 1 year ago

I am working on adding this into Stack Wallet

Cool! Are you targeting feather wallet or wallet2 to start with as the cold signer?

detherminal commented 1 year ago

I will be using monero-wallet-cli to cold sign the transactions

mjg-foundation commented 1 year ago

I will be using monero-wallet-cli to cold sign the transactions

@detherminal As you're doing that work, if you're able to document the input and output formats the cli wallet uses, you could contribute to and possibly win #13

detherminal commented 1 year ago

Hey @mjg-foundation How can I communicate with you, can you give me your Discord address if you have? I have some questions.

mjg-foundation commented 1 year ago

Hey @mjg-foundation How can I communicate with you, can you give me your Discord address if you have? I have some questions.

Message me on twitter @ShrtCrct6201 , I don't want my personal discord/email everywhere

detherminal commented 1 year ago

The Stack Wallet team is working on this issue and will be implemented but will take time because of its complexity. Regards.

r4v3r23 commented 1 year ago

Hey @mjg-foundation How can I communicate with you, can you give me your Discord address if you have? I have some questions.

Message me on twitter @ShrtCrct6201 , I don't want my personal discord/email everywhere

can you message me to this handle on telegram? i dont have twitter.

MrCyjaneK commented 1 year ago

Hey! I've worked on this functionality for the Anonero wallet, here is the pull request: http://git.anonero5wmhraxqsvzq2ncgptq6gq45qoto6fnkfwughfl4gbt44swad.onion/ANONERO/ANON/pulls/11 apk: https://upload.stulpy.sk:5281/file_share/sdZJC_PGf1ieDwGrlnqIWWdH/app-viewonlymainnet-release.apk (link expires after ~2 weeks) so people from future - grab release from somewhere more official than this link.

Updated .apk: https://github.com/mjg-foundation/passport2-monero/issues/3#issuecomment-1598425212

mjg-foundation commented 1 year ago

I'll try it out when I get the chance! If any other anons can review the code and test signing, that'd be great

r4v3r23 commented 1 year ago

Hey! I've worked on this functionality for the Anonero wallet, here is the pull request: http://git.anonero5wmhraxqsvzq2ncgptq6gq45qoto6fnkfwughfl4gbt44swad.onion/ANONERO/ANON/pulls/11 apk: https://upload.stulpy.sk:5281/file_share/sdZJC_PGf1ieDwGrlnqIWWdH/app-viewonlymainnet-release.apk

i can confirm @MrCyjaneK's PR works and is compatible with the official cli wallet. here are the steps:

1) select "Export outputs" from the 3-dot menu on the wallet's main screen & save the file to the device 2) select "Import key images" from same menu & choose file from device 3) so to "Send" screen, construct a transaction, & save file to the device 4) select "Broadcast" tx & choose file from device

excellent work! :metal:

r4v3r23 commented 1 year ago

@vdo @raypeat there is a working Android app posted by MrCyjanek for offline transactions compatible with feather/CLI/GUI - is that sufficient for payout or do you require to wait for full monero support on passport?

keep in mind UI/UX will be updated and improved with UR2 support

mjg-foundation commented 1 year ago

I've decided to personally pay the anonero team 1 XMR in advance of signing with passport, as a reward for their completed work, along with the .25 XMR reward for signing with the CLI wallet, because there was a misunderstanding in the bounty instructions. The anonero team believed they would be receiving the full android bounty of 1.4 XMR due to the use of the word "or" in the bounty requirements. Both UR2 and microSD signing must be supported to claim the full bounty of 1.4 XMR, which is still available to competing developers.

raypeat commented 1 year ago

@vdo @raypeat there is a working Android app posted by MrCyjanek for offline transactions compatible with feather/CLI/GUI - is that sufficient for payout or do you require to wait for full monero support on passport?

keep in mind UI/UX will be updated and improved with UR2 support

I can send payout now. Where shall I send it?

MrCyjaneK commented 1 year ago

@raypeat this is my xmr address: 85WSSmQ99XeHRBeQ5hgKEuAZVYBsyYrmpCGvbXi3sekJMvfP87KLpGahHdvkaBCmJ3HrR6vSVyVKpPW4bTKkoSVTHeXxJBb

raypeat commented 1 year ago

@raypeat this is my xmr address: 85WSSmQ99XeHRBeQ5hgKEuAZVYBsyYrmpCGvbXi3sekJMvfP87KLpGahHdvkaBCmJ3HrR6vSVyVKpPW4bTKkoSVTHeXxJBb

Thank you. 0.5 XMR sent

MrCyjaneK commented 1 year ago

Hey @raypeat @vdo @mjg-foundation I've updated the Anonero wallet with some minor fixes (most notably: crashes when signing multiple transactions). And create an extra feature in the wallet to allow it to function as fully offline cold wallet - if you want to test it you can now use one android device. Online view-only wallet (for this bounty): https://upload.stulpy.sk:5281/file_share/BcsnWwFghFSBEBOzXVBLdFgr/app-viewonlymainnet-release.apk Cold wallet (for testing the implementation while we wait for passport support): https://upload.stulpy.sk:5281/file_share/v-u5hdNXV3OcRw_268YDEr1f/app-mainnet-release.apk

(link expires after ~2 weeks) so people from future - grab release from somewhere more official than this link.

the process got tested by @r4v3r23 on multiple configurations (including anon-anon, anon-cli and anon-feather (i think?)).

r4v3r23 commented 1 year ago

Hey @raypeat @vdo @mjg-foundation I've updated the Anonero wallet with some minor fixes (most notably: crashes when signing multiple transactions). And create an extra feature in the wallet to allow it to function as fully offline cold wallet - if you want to test it you can now use one android device. Online view-only wallet (for this bounty): https://upload.stulpy.sk:5281/file_share/BcsnWwFghFSBEBOzXVBLdFgr/app-viewonlymainnet-release.apk Cold wallet (for testing the implementation while we wait for passport support): https://upload.stulpy.sk:5281/file_share/v-u5hdNXV3OcRw_268YDEr1f/app-mainnet-release.apk

(link expires after ~2 weeks) so people from future - grab release from somewhere more official than this link.

the process got tested by @r4v3r23 on multiple configurations (including anon-anon, anon-cli and anon-feather (i think?)).

can confirm these apks are compatible with CLI cold signing: they can both propose transactions for the CLI cold wallet to sign, and sign transactions created by CLI view-only

mjg-foundation commented 1 year ago

I sent 1.25 XMR to @MrCyjaneK using Anonero and the CLI wallet as the cold signer

mjg-foundation commented 1 year ago

@MrCyjaneK now that you're familiar with the format the CLI wallet uses for airgapped signing, would you be able to complete #13 ?

MrCyjaneK commented 1 year ago

@mjg-foundation I have already looked at this issue but I may be wrong person to contact here - I am not sure how unsigned_transaction file is generated, I just call the relevant wallet2_api.h call and get the file out. Unsigned transaction is generated on the view only online wallet. I assume that you want to parse the transaction on the device to show amounts/addresses of the tx - which I didn't dig into.

Also providing a more than 3'000 words documentation on that that will get approval from the core team is much more demanding task than this issue.

most likely will involve digging into c++ code of monero to see how it actually works.

mjg-foundation commented 1 year ago

Ok, no worries. I don't expect 3000 words, but at least a concise layout of the file and its fields would make parsing and signing on passport possible.

vdo commented 11 months ago

Sorry for the delay, and thanks @r4v3r23 for the heads up. I'm mostly using another username fir GitHub these days.

I'm transferring the bounty now to:

85WSSmQ99XeHRBeQ5hgKEuAZVYBsyYrmpCGvbXi3sekJMvfP87KLpGahHdvkaBCmJ3HrR6vSVyVKpPW4bTKkoSVTHeXxJBb

MrCyjaneK commented 11 months ago

Got it! Thanks @vdo

r4v3r23 commented 11 months ago

ANONERO has released v0.6 with airgapped transactions using UR: https://monero.town/post/223593

8BQFYQTDMr9ibTsi3QMutG4EW3Gwv9a8N1XRLV95QBrg5THWSAt8no6GKgXErgEYzAUMiEoqZ6zHYUewj27bmvRD7JBCGmf

mjg-foundation commented 11 months ago

ANONERO has released v0.6 with airgapped transactions using UR: https://monero.town/post/223593

8BQFYQTDMr9ibTsi3QMutG4EW3Gwv9a8N1XRLV95QBrg5THWSAt8no6GKgXErgEYzAUMiEoqZ6zHYUewj27bmvRD7JBCGmf

Just sent the remaining 0.4 for Android UR-based signing

mjg-foundation commented 11 months ago

@r4v3r23 now that anonero has both created and signed airgapped transactions, would you or anyone who worked on it be able to detail the formats of the unsigned and signed transactions for #13 ?

r4v3r23 commented 11 months ago

@r4v3r23 now that anonero has both created and signed airgapped transactions, would you or anyone who worked on it be able to detail the formats of the unsigned and signed transactions for #13 ?

i think #monero-dev on IRC would be the place to find some one for this

mjg-foundation commented 8 months ago

Updating the bounty amount to 0.6 left for iOS support

MrCyjaneK commented 4 months ago

Hey! Is there an option to adjust the iOS bounty to not require publishing to App Store? I could get a demo in xcode simulator on an old iMac, but I don't own an iPhone and I have not paid the necessary fees to Apple to publish to App Store (99$/year).

mjg-foundation commented 4 months ago

Hey! Is there an option to adjust the iOS bounty to not require publishing to App Store? I could get a demo in xcode simulator on an old iMac, but I don't own an iPhone and I have not paid the necessary fees to Apple to publish to App Store (99$/year).

Sure. Is testflight not free either?