Skip to content

Commit 310acf4

Browse files
committed
Set rules for PSBT serializer backcompat
The serializers are not thoroughly documented, but we want to keep their backward compatibility. However, we reserve the right to update their semantics to more fitting types once we implement them (e.g. script tree leaf class)
1 parent 75d6f71 commit 310acf4

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

Changes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ Revision history for Perl extension Bitcoin::Crypto.
3838
- serialization of transactions with zero inputs and zero outputs is allowed (as required by some test cases)
3939

4040
[Breaking changes]
41-
- PSBT_IN_FINAL_SCRIPTWITNESS is now serialized as an array reference of bytestrings
42-
- PSBT_IN_TAP_LEAF_SCRIPT value is now serialized as an instance of Bitcoin::Crypto::Script::Tree::Leaf
41+
- PSBT_IN_FINAL_SCRIPTWITNESS value serializer is upgraded to use an array of bytestrings
42+
- PSBT_IN_TAP_LEAF_SCRIPT value serializer is upgraded to use an instance of Bitcoin::Crypto::Script::Tree::Leaf
4343

4444
4.005 Thu Apr 23, 2026
4545
[Public interface changes]

lib/Bitcoin/Crypto/PSBT/Field.pm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,13 @@ holds the descriptions of what is the type after deserialization (and before
250250
serialization). Reading the source of L<Bitcoin::Crypto::PSBT::FieldType> may
251251
be required if it isn't clear how they are implemented for a specific field.
252252
253+
Even though specific serializers aren't documented, they will be kept
254+
backward-compatible with the same rules as any other part of Bitcoin::Crypto
255+
(see L<Bitcoin::Crypto::Manual/Backward compatibility>), with an exception of
256+
upgrading their behavior to more fitting types when they are implemented. If
257+
you are unsure whether the given serializer will be modified in the future, you
258+
can use C<raw_*> attributes and serialize/deserialize manually.
259+
253260
Reading the value through L</raw_value> will return a bytestring, but reading
254261
through C<value> will use the deserializer. Calling C<set_value> will use the
255262
serializer to update L</raw_value>. The field only holds raw data and uses

0 commit comments

Comments
 (0)