In elements-rust, PartiallySignedTransaction::extract_tx() copies the flagged PSET previous_output_index directly into TxIn.previous_output.vout, while also setting TxIn::is_pegin.
Elements Core removes the pegin/issuance flag bits from the in-memory outpoint and represents them separately. Consequently, SighashCache hashes the flagged outpoint, producing a different SegWit v0 sighash than Elements Core. Signatures created from an extracted pegin PSET are therefore rejected by Elements.
extract_tx() should mask the pegin and issuance bits from previous_output_index when constructing TxIn.previous_output, while retaining is_pegin and issuance state separately.
In elements-rust,
PartiallySignedTransaction::extract_tx()copies the flagged PSET previous_output_index directly intoTxIn.previous_output.vout, while also settingTxIn::is_pegin.Elements Core removes the pegin/issuance flag bits from the in-memory outpoint and represents them separately. Consequently,
SighashCachehashes the flagged outpoint, producing a different SegWit v0 sighash than Elements Core. Signatures created from an extracted pegin PSET are therefore rejected by Elements.extract_tx()should mask the pegin and issuance bits from previous_output_index when constructingTxIn.previous_output, while retainingis_peginand issuance state separately.