Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADD: AOPP #2915

Merged
merged 1 commit into from
Apr 17, 2021
Merged

ADD: AOPP #2915

merged 1 commit into from
Apr 17, 2021

Conversation

limpbrains
Copy link
Collaborator

@limpbrains limpbrains commented Apr 5, 2021

aopp.mov

closes #2861

tests/integration/aopp.test.js Outdated Show resolved Hide resolved
tests/integration/aopp.test.js Outdated Show resolved Hide resolved
@limpbrains limpbrains force-pushed the limpbrains-aopp branch 2 times, most recently from d41ab06 to 4529fc1 Compare April 6, 2021 11:06
@limpbrains limpbrains removed the WIP label Apr 6, 2021
@lclc
Copy link

lclc commented Apr 6, 2021

Two tiny things:

  1. The title "SelectWallet" should probably be "Select Wallet"
  2. The other title "Select address" should probably also be TitleCase like the rest of the Window titles -> "Select Address"

@limpbrains
Copy link
Collaborator Author

Two tiny things:

1. The title "SelectWallet" should probably be "Select Wallet"

2. The other title "Select address" should probably also be TitleCase like the rest of the Window titles -> "Select Address"

fixed, thanks for testing!

@@ -60,6 +62,16 @@ const SignVerify = () => {
try {
const newSignature = wallet.signMessage(message, address);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC to make this work with AOPP segwit signatures the options variable needs to be set to undefined

const options = this.segwitType ? { segwitType: this.segwitType } : undefined;

as described in https://github.com/bitcoinjs/bitcoinjs-message#about-electrum-segwit-signature-support

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. But I'm not sure what type of signature should BlueWallet generate by default.
I think since we are using bitcoinjs-message we should stick with their defaults.
Anyway to increase AOPP adoption, you need to try both variants on a backend.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "electrum signature type" is the one bitcoin core uses too. So currently, BlueWallet signatures are not compatible with bitcoin core's.

I read that trezor supports both signature types by now because they wanted to be compatible with bitcoin core. Which means that everyone is supporting "electrum signature types" but not the trezor one.

Because AOPP is brand new I would really like to keep this ambiguity out of the protocol and just stick with the "electrum signature types". I hope that you can see the value of having a clean protocol. I'm aware that the spec is not clear on that but I'm happy to propose a commit for that.

(I'm using "electrum signature types" here to be consistent with the bticoinjs-message terminology. To me, those are just bitcoin core message signatures)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@limpbrains maybe we should introduce "electrum/bitcoincore compatible format" checkbox on sign/verify screen so user could choose..? and ofcourse when signature is requested by aopp - only produce aopp compatible signature (don't even show the checkbox)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Overtorment
I feel like we should switch to "electrum" format by default.
what do you think ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@limpbrains whatever you feel is right, I'm not good with sign/verify topic. id say default should be whats the majority of software supports..?

screen/wallets/aopp.js Outdated Show resolved Hide resolved
@@ -60,6 +62,16 @@ const SignVerify = () => {
try {
const newSignature = wallet.signMessage(message, address);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@limpbrains maybe we should introduce "electrum/bitcoincore compatible format" checkbox on sign/verify screen so user could choose..? and ofcourse when signature is requested by aopp - only produce aopp compatible signature (don't even show the checkbox)

screen/wallets/signVerify.js Outdated Show resolved Hide resolved
}, []); // eslint-disable-line react-hooks/exhaustive-deps

const handleChoose = address =>
navigation.navigate('SignVerify', {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why navigate to signVerify when we have the wallet, we have the address, we could sign right on the spot? no changes to screen/wallets/signVerify.js necessary

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we need to show user what is he actually signing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"I like cocks"

screen/wallets/aopp.js Outdated Show resolved Hide resolved

await a.send({ address, signature });
});
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noice. i love tests

@Overtorment
Copy link
Member

i missed this when reading the spec. is there a scenario when server already knows our address, and we just need to find appropriate wallet that owns this address and do the signature with it..?

@toxeus
Copy link

toxeus commented Apr 11, 2021

@Overtorment wrote:

i missed this when reading the spec. is there a scenario when server already knows our address, and we just need to find appropriate wallet that owns this address and do the signature with it..?

@limpbrains had some interesting ideas for such scenarios that I think are worthwhile taking a closer look. However, for the initial version the goal is to have a narrow scope such that the effort is minimized on the wallet side to allow for quick adoption. Hence, those scenarios are candidates for an upcoming version.

@limpbrains
Copy link
Collaborator Author

Let's merge it.

Copy link
Member

@Overtorment Overtorment left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly lgtm. just conflicts

screen/wallets/aopp.js Outdated Show resolved Hide resolved
@GladosBlueWallet
Copy link
Collaborator

♫ This was a triumph. I'm making a note here: HUGE SUCCESS ♫

[android in browser] https://appetize.io/app/0f3z34g1d6cc52n8xdbkhu6xcw

download apk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implementation of AOPP
5 participants