Skip to content

Commit b31b9c6

Browse files
authored
Merge pull request #22 from jgriffiths/pset_global_genesis
elip: add ELIP-101 allowing context-free signing of taproot inputs
2 parents 7e9bf83 + 38193be commit b31b9c6

File tree

2 files changed

+107
-0
lines changed

2 files changed

+107
-0
lines changed

README.mediawiki

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ Having an ELIP here does not make it a formally accepted standard until its stat
3333
| Standards Track
3434
| Draft
3535
|- style="background-color: #ffcfcf"
36+
| [[elip-0101.mediawiki|101]]
37+
| Applications
38+
| Genesis Blockhash for Partially Signed Elements Transaction Format
39+
| Jon Griffiths
40+
| Standards Track
41+
| Draft
42+
|- style="background-color: #ffcfcf"
3643
| [[elip-0102.mediawiki|102]]
3744
| Applications
3845
| LiquiDEX extensions for Partially Signed Elements Transaction Format

elip-0101.mediawiki

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
<pre>
2+
ELIP: 101
3+
Layer: Applications
4+
Title: Genesis Blockhash for Partially Signed Elements Transaction Format
5+
Author: Jon Griffiths <jon_p_griffiths@yahoo.com>
6+
Comments-Summary: No comments yet.
7+
Status: Draft
8+
Type: Standards Track
9+
Created: 2025-02-04
10+
License: BSD-2-Clause
11+
</pre>
12+
13+
==Introduction==
14+
15+
===Abstract===
16+
17+
This document describes a new, conditionally optional global field for the Partially Signed Elements Transaction (PSET) format, which contains the genesis blockhash of the chain the transaction is intended to be signed for.
18+
19+
A genesis blockhash uniquely identifies an instance of an Elements chain. Elements Segwit v1 taproot support takes advantage of this fact by including the genesis blockhash in the data used to sign a transaction. This ensures that signatures are different between chain instances and can be used to ensure that the expectations of transaction creators and signers are aligned.
20+
21+
Code/hardware that performs signing may operate either with or without the context of the current chain. For example, Elements nodes are configured to run on a specific chain and thus when signing always know the chain they are signing for. In contrast, libraries or utilities that provide PSET signing may run in multiple contexts, and may not have a global state representing the current chain. In this latter case, the chain must be provided to the signer in the form of the new field this ELIP proposes.
22+
23+
In the following text, "context available" refers to code having an understanding of the current chain as in the Elements example above.
24+
25+
While this field must be included if the PSET contains taproot inputs, it may optionally be included when no taproot inputs are present. This allows signers with context available to reject signing transactions that are not intended for their configured chain.
26+
27+
===Copyright===
28+
29+
This ELIP is licensed under the 2-clause BSD license.
30+
31+
==Specification==
32+
33+
The Partially Signed Elements Transaction (PSET) format extends the BIP 370 PSBT format and is defined at https://github.com/ElementsProject/elements/blob/master/doc/pset.mediawiki. This document extends the PSET format directly, and as such the document above should be updated if and when this ELIP is approved.
34+
35+
The new global field is defined as follows:
36+
37+
{|
38+
! Name
39+
! <tt><keytype></tt>
40+
! <tt><keydata></tt>
41+
! <tt><keydata></tt> Description
42+
! <tt><valuedata></tt>
43+
! <tt><valuedata></tt> Description
44+
! Versions Requiring Inclusion
45+
! Versions Requiring Exclusion
46+
! Versions Allowing Inclusion
47+
|-
48+
| Genesis Blockhash
49+
| <tt>PSBT_ELEMENTS_GLOBAL_GENESIS_HASH = 0x02</tt>
50+
| None
51+
| No key data
52+
| <tt><hash></tt>
53+
| The 32 byte genesis hash of the Elements chain this transaction is for.
54+
| 2(*)
55+
| -
56+
| 2
57+
|}
58+
59+
(*) Note that required inclusion is conditional as described below.
60+
61+
===Handling Duplicated Keys===
62+
63+
Duplicate or repeated values of the new field are not allowed. When merging multiple PSETs, if any input PSET has this field, the resulting PSET must also. If more than one value for this field is present or would result, merging must fail. These are the standard rules for existing fields and should not require special handling.
64+
65+
Logically, a PSET must either explicitly belong to a given chain (the field is present), or not explicitly belong to any chain (the field is absent).
66+
67+
==Roles==
68+
69+
For all roles, when a PSET is received and the field is present, it should be validated if context is available. If the genesis hash does not match the current context, the operation must fail.
70+
71+
The field must not ever be removed, even after finalization, since it can be used to prevent further processing or broadcast on the wrong chain.
72+
73+
Otherwise, the PSET Roles are updated as follows:
74+
75+
===Creator/Updater===
76+
77+
May add the field to any PSET they process, if context is available.
78+
79+
If taproot inputs are added, they must add the field.
80+
81+
If the PSET already contains taproot inputs and the field is not present, an updater should add it if context is available.
82+
83+
===Signer===
84+
85+
If present, the field must be validated if context is available.
86+
87+
If not present, signers may sign taproot inputs with their current chain if context is available.
88+
89+
If any inputs of any type are signed the field should be added, and must be added if taproot inputs are present (whether signed or not).
90+
91+
92+
<references/>
93+
94+
==Backwards Compatibility==
95+
96+
The new field is backwards compatible due to the ignore/round trip behavior for new fields inherited from the PSBT specification. Conforming implementations are expected to carry through the new field and its contents even if they do not support this ELIP.
97+
98+
==Reference implementation==
99+
100+
Implemented in libwally-core v1.4.0: https://github.com/ElementsProject/libwally-core/releases/tag/release_1.4.0

0 commit comments

Comments
 (0)