elements icon indicating copy to clipboard operation
elements copied to clipboard

PSET is missing `asset` field in pegin witness data

Open apoelstra opened this issue 2 years ago • 2 comments

In PSET we have broken out all the fields of the pegin_witness field of a transaction input, except for the pegin asset type. I seem to recall the reason for this being that it was too complicated for Core to handle different pegin assets, and that no real blockchain would ever have multiple of these, so it had limited value.

However, for non-Elements finalizers, this field needs to exist, because it's used to construct the pegin witness.

It's fine if Elements rejects PSETs whose pegin assets don't match the consensus value, the field should just exist.

cc @achow101

apoelstra avatar Feb 09 '22 22:02 apoelstra

Are non-elements finalizers expected to not know the peg-in asset? If they understand these fields, I would expect they know what the peg-in asset would be.

In any case, it's just another field, and given that it is not involved in the rest of the signing stuff, it should not be hard to add.

achow101 avatar Feb 09 '22 22:02 achow101

@achow101 the trick here is that they actually don't need to understand these fields at all, they just throw them onto the pegin witness stack as byte vectors

(The specific application here is libwally, which as a library, is not bound to any particular blockchain)

apoelstra avatar Feb 09 '22 22:02 apoelstra