@@ -1040,8 +1040,8 @@ func NewGKRCustomSubtreeRootRecord(root *chainhash.Hash) tlv.Record {
1040
1040
// hash may represent either a single leaf or the root hash of an entire
1041
1041
// subtree.
1042
1042
//
1043
- // If `custom_root_hash` is not provided, it defaults to a 32-byte zero-filled
1044
- // array . In this case, no valid script spending path can correspond to the
1043
+ // If `custom_root_hash` is not provided, it defaults to a bare `[OP_RETURN` as
1044
+ // well . In this case, no valid script spending path can correspond to the
1045
1045
// custom subtree root hash due to the pre-image resistance of SHA-256.
1046
1046
//
1047
1047
// A sibling node is included alongside the `custom_root_hash` node. This
@@ -1067,7 +1067,8 @@ func NewGKRCustomSubtreeRootRecord(root *chainhash.Hash) tlv.Record {
1067
1067
// 1. It cannot be misinterpreted as a genesis asset ID leaf.
1068
1068
// 2. It optionally includes user-defined script spending leaves.
1069
1069
// - <custom_root_hash> is the root hash of the custom tapscript subtree.
1070
- // If not specified, it defaults to a 32-byte zero-filled array.
1070
+ // If not specified, it defaults to the same [OP_RETURN] that's on the left
1071
+ // side.
1071
1072
// - [OP_RETURN] is a non-spendable script leaf containing the script
1072
1073
// `OP_RETURN`. Its presence ensures that [tweaked_custom_branch] remains
1073
1074
// a branch node and cannot be a valid genesis asset ID leaf.
@@ -1108,7 +1109,7 @@ func NewGroupKeyTapscriptRoot(genesisAssetID ID,
1108
1109
// hash of the custom tapscript subtree.
1109
1110
//
1110
1111
// If a custom tapscript subtree root hash is provided, we use it.
1111
- // Otherwise, we default to an empty hash (a zero-filled byte array) .
1112
+ // Otherwise, we default to an empty non-spendable leaf hash as well .
1112
1113
emptyNonSpendLeaf , err := NewNonSpendableScriptLeaf (nil )
1113
1114
if err != nil {
1114
1115
return GroupKeyRevealTapscript {}, err
@@ -1117,7 +1118,7 @@ func NewGroupKeyTapscriptRoot(genesisAssetID ID,
1117
1118
// Compute the tweaked custom branch hash.
1118
1119
tweakedCustomBranchHash := TapBranchHash (
1119
1120
emptyNonSpendLeaf .TapHash (),
1120
- customRoot .UnwrapOr (chainhash. Hash {} ),
1121
+ customRoot .UnwrapOr (emptyNonSpendLeaf . TapHash () ),
1121
1122
)
1122
1123
1123
1124
// Next, we'll combine the tweaked custom branch hash with the genesis
0 commit comments