Skip to content

Conversation

@achow101
Copy link
Contributor

@achow101 achow101 commented Oct 2, 2019

bitcoin/bips#849 (not yet merged) adds to BIP 174 proprietary types. This PR changes the PSBT types used in Elements to be in line with the proposed changes to the BIP/

@instagibbs
Copy link
Contributor

concept ACK, will review

@instagibbs instagibbs added the needs port Needs backport to a different branch label Oct 7, 2019
@stevenroose
Copy link
Contributor

Really cool! So the proprietary types are already accepted into the BIP, right?

@stevenroose
Copy link
Contributor

utACK, constant variable name nit.

@stevenroose
Copy link
Contributor

On a second thought. Are current Elements "PSBT"s compatible with Bitcoin's? Since the tx format is already different from Bitcoin's, an Elements "PSBT" won't be parseable by Bitcoin PSBT logic.

Irregardless of using the proprietary keys for out own special fields, shouldn't we update the magic value to something like "pset", perhaps?

@instagibbs
Copy link
Contributor

So the proprietary types are already accepted into the BIP, right?

The PR for it is still open IIRC, but I haven't heard any objections.

shouldn't we update the magic value to something like "pset", perhaps?

Perhaps we should, also to make it clear that we're making breaking changes.

@instagibbs
Copy link
Contributor

Is this missing changes like the compact size wrapper here for non-proprietary fields? bitcoin/bitcoin@6ccda5b#diff-4d99ef1a2a2826595a92ac62c4162790R69

Should we work on upstream merge first to make this simpler?

@achow101
Copy link
Contributor Author

achow101 commented Oct 8, 2019

On a second thought. Are current Elements "PSBT"s compatible with Bitcoin's? Since the tx format is already different from Bitcoin's, an Elements "PSBT" won't be parseable by Bitcoin PSBT logic.

Irregardless of using the proprietary keys for out own special fields, shouldn't we update the magic value to something like "pset", perhaps?

Right, perhaps just change the magic, but keep everything else the same to reduce code drift? I have tried to decode an Elements PSBT with Core, and it fails on decoding the global tx.

Is this missing changes like the compact size wrapper here for non-proprietary fields? bitcoin/bitcoin@6ccda5b#diff-4d99ef1a2a2826595a92ac62c4162790R69

Yes. I noticed that the changes in bitcoin/bitcoin#17034 were largely incompatible or unrelated to these changes, so I decided not to include them.

Should we work on upstream merge first to make this simpler?

Perhaps, but I don't think they are related closely enough.

@instagibbs
Copy link
Contributor

unrelated to these changes

If we're making changes to be near-compatible with new bip174, I feel like we should go "all the way" to reduce drift? Maybe I'm misunderstanding.

@achow101
Copy link
Contributor Author

achow101 commented Oct 8, 2019

If we're making changes to be near-compatible with new bip174,

It is still compatible, the changes to BIP 174 were designed to be compatible with existing implementations.

I feel like we should go "all the way" to reduce drift? Maybe I'm misunderstanding.

Those changes should merge cleanly with the changes (modulo the proprietary types) in Core, so a rebase would be sufficient.

It mostly just didn't make sense to me to PR the same commits to both Elements and Core when Elements will just rebase onto Core and pick up those commits later. They aren't particularly important.

@instagibbs
Copy link
Contributor

fair enough, so pset or whatever, plus my one nit should be enough

Elements PSBTs are incompatible with normal PSBTs due to differing transaction
formats, so use different magic bytes to distinguish.
@achow101 achow101 force-pushed the bip174-proprietary branch from 5a136d8 to 34e1350 Compare October 8, 2019 18:20
@achow101
Copy link
Contributor Author

achow101 commented Oct 8, 2019

Added a commit to use pset as the magic bytes when in elements mode.

@instagibbs
Copy link
Contributor

utACK 34e1350

@stevenroose
Copy link
Contributor

LGTM! I'm gonna merge this despite the failure. It's an unrelated test and I don't have the error when run locally.

ACK 34e1350

stevenroose added a commit that referenced this pull request Oct 9, 2019
…IP 174

34e1350 Use Elements PSBT magic when in Elements mode (Andrew Chow)
3fa355c Change Proprietary types to use the method specified in BIP 174 (Andrew Chow)

Pull request description:

  bitcoin/bips#849 (not yet merged) adds to BIP 174 proprietary types. This PR changes the PSBT types used in Elements to be in line with the proposed changes to the BIP/

Tree-SHA512: 73085a16005448d9f6ad1b74da4a40043ec29738256a439f35106793d11d0e95cb8d728db5cfefe1ddd49cd80367f7f5790d09efaa95bc443e1d6ba295240c4d
@stevenroose stevenroose merged commit 34e1350 into ElementsProject:master Oct 9, 2019
stevenroose added a commit that referenced this pull request Oct 14, 2019
…ed in BIP 174

f72e57a Use Elements PSBT magic when in Elements mode (Andrew Chow)
8be2a9e Change Proprietary types to use the method specified in BIP 174 (Andrew Chow)

Pull request description:

  Backport of #730

Tree-SHA512: d0484639049de772989f4f97cc926fbdea0e5c27a294c1f2b5ec0b0f28ca6e620ac5a6306d029ff90d77c1c390848fbad94b3b51fe5e67d4792bb117b000c07b
apoelstra added a commit to apoelstra/elements that referenced this pull request Nov 6, 2020
apoelstra added a commit to apoelstra/elements that referenced this pull request Nov 9, 2020
apoelstra added a commit to apoelstra/elements that referenced this pull request Nov 10, 2020
stevenroose pushed a commit that referenced this pull request Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs port Needs backport to a different branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants