PSBT proprietary key system matching BIP 174#471
PSBT proprietary key system matching BIP 174#471apoelstra merged 2 commits intorust-bitcoin:masterfrom BP-WG:feat/psbt-keytypes
Conversation
|
Again, could this perhaps be rebased on master? |
|
@stevenroose done |
|
Build fails b/c something strange with fuzztests, can't understand what's wrong |
stevenroose
left a comment
There was a problem hiding this comment.
I think the fuzz failure is due to the bug that I pointed out in the ProprietaryKey type.
src/util/psbt/raw.rs
Outdated
There was a problem hiding this comment.
This will not roundtrip. I think if you want a default type, it should be pub struct ProprietaryType(u8); so that you can roundtrip the actual byte.
src/util/psbt/raw.rs
Outdated
There was a problem hiding this comment.
Alternatively, you could make ProprietaryKeyType a marker trait:
pub trait ProprietaryTypeKey: Copy + From<u8> + Into<u8> {}But the plethora of naming will soon become confusing (ProprietaryType, ProprietaryTypeKey, ProprietaryKey).
There was a problem hiding this comment.
If we would not use generic here this will allow using of conflicting proprietary key type systems, which is undesirable
| }, | ||
| version: 0, | ||
| xpub: Default::default(), | ||
| proprietary: Default::default(), |
There was a problem hiding this comment.
nit: You have mixed usage of Default::default() and BTreeMap::new() in this file.
This is a companion PR to #478 and a part of epic #473
This PR is based on previous PRs for BIP 32 binary serialization and versioning from #469 and #470 (which must be merged first) and includes commits from them. Commits specific to this PR starts from 325f323
Once #478 will be merged, I will add constant key name for the new hash key types into this PR