Skip to content

Conversation

@sipa
Copy link
Member

@sipa sipa commented Jul 20, 2018

This PR adds "key origin" (master fingeprint + key path) information to what is exposed from SigningProviders, allowing this information to be used by the generic PSBT code instead of having the RPC pull it directly from the wallet.

This is also a preparation to having PSBT interact with output descriptors, which can then directly expose key origin information for the scripts they generate.

@sipa sipa force-pushed the 201807_key_origin_provider branch from db01d22 to 2585c57 Compare July 20, 2018 07:28
@practicalswift
Copy link
Contributor

Concept ACK

Thanks for taking another look at this code

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

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

Partial utACK. Nice refactors that improve code readability. Some nits regarding code style.

Copy link
Contributor

Choose a reason for hiding this comment

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

Commit "Make SigningProvider expose key origin information"

nit CKeyID& keyid.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

Commit "Make SigningProvider expose key origin information"

nit, remove.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

Commit "Make SigningProvider expose key origin information"

nit, CKeyID& address.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

Commit "Generalize PublicOnlySigningProvider into HidingSigningProvider"

nit, CKeyID& keyid.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

Commit "Generalize PublicOnlySigningProvider into HidingSigningProvider"

nit, CScriptID& scriptid and some more below.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@sipa sipa force-pushed the 201807_key_origin_provider branch 5 times, most recently from 8afec13 to 8cd99d5 Compare July 20, 2018 18:58
Copy link
Member

@achow101 achow101 left a comment

Choose a reason for hiding this comment

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

Concept ACK

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this change be part of the earlier " Generalize PublicOnlySigningProvider into HidingSigningProvider" commit?

Copy link
Member Author

Choose a reason for hiding this comment

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

It could be, but doesn't matter. There is no bip32 information in SignatureData until this commit.

@sipa sipa force-pushed the 201807_key_origin_provider branch from 8cd99d5 to 8bfa106 Compare July 20, 2018 20:44
Copy link
Member

Choose a reason for hiding this comment

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

In commit "Make SigningProvider expose key origin information"

You should change address to keyid in this commit instead of "Generalize PublicOnlySigningProvider into HidingSigningProvider"

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@sipa sipa force-pushed the 201807_key_origin_provider branch from 8bfa106 to f6ba1ca Compare July 20, 2018 23:40
@DrahtBot
Copy link
Contributor

DrahtBot commented Jul 22, 2018

Note to reviewers: This pull request conflicts with the following ones:

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@laanwj
Copy link
Member

laanwj commented Jul 23, 2018

utACK f6ba1ca1e51d044b6fc8398edfa4dd03061572c4
verified that [MOVEONLY] Move ParseHDKeypair is move-only

@sipa sipa force-pushed the 201807_key_origin_provider branch from f6ba1ca to 8df185b Compare July 24, 2018 21:58
@sipa
Copy link
Member Author

sipa commented Jul 24, 2018

Rebased.

@sipa sipa force-pushed the 201807_key_origin_provider branch from 669d72f to 917353c Compare August 13, 2018 15:46
}

void AddKeypathToMap(const CWallet* pwallet, const CKeyID& keyID, std::map<CPubKey, std::vector<uint32_t>>& hd_keypaths)
void AddKeypathToMap(const CWallet* pwallet, const CKeyID& keyID, std::map<CPubKey, KeyOriginInfo>& hd_keypaths)
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this is no longer called.

@laanwj
Copy link
Member

laanwj commented Aug 28, 2018

re-utACK 917353c

@laanwj laanwj merged commit 917353c into bitcoin:master Aug 28, 2018
laanwj added a commit that referenced this pull request Aug 28, 2018
917353c Make SignPSBTInput operate on a private SignatureData object (Pieter Wuille)
cad5dd2 Pass HD path data through SignatureData (Pieter Wuille)
03a9958 Implement key origin lookup in CWallet (Pieter Wuille)
3b01efa [MOVEONLY] Move ParseHDKeypath to utilstrencodings (Pieter Wuille)
81e1dd5 Generalize PublicOnlySigningProvider into HidingSigningProvider (Pieter Wuille)
84f1f1b Make SigningProvider expose key origin information (Pieter Wuille)
611ab30 Introduce KeyOriginInfo for fingerprint + path (Pieter Wuille)

Pull request description:

  This PR adds "key origin" (master fingeprint + key path) information to what is exposed from `SigningProvider`s, allowing this information to be used by the generic PSBT code instead of having the RPC pull it directly from the wallet.

  This is also a preparation to having PSBT interact with output descriptors, which can then directly expose key origin information for the scripts they generate.

Tree-SHA512: c718382ba8ba2d6fc9a32c062bd4cff08b6f39b133838aa03115c39aeca0f654c7cc3ec72d87005bf8306e550824cd8eb9d60f0bd41784a3e22e17b2afcfe833
UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request Jun 7, 2021
kwvg added a commit to kwvg/dash that referenced this pull request Jul 13, 2021
PastaPastaPasta added a commit to dashpay/dash that referenced this pull request Jul 13, 2021
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants