summaryrefslogtreecommitdiff
path: root/bip-0174.mediawiki
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2019-06-09 10:44:32 +0200
committerAndrew Chow <achow101-github@achow101.com>2019-06-09 23:39:25 +0200
commite1f770e23617ddb5d9d78597c7377fd6f956f67d (patch)
treeed686c9e4099d97e6d0a6e8996e5e1e1ec63b6e6 /bip-0174.mediawiki
parent19d3b9dc829ca52133dd71497f0768118d7462d2 (diff)
downloadbips-e1f770e23617ddb5d9d78597c7377fd6f956f67d.tar.xz
bip174: add section describing change detection
Diffstat (limited to 'bip-0174.mediawiki')
-rw-r--r--bip-0174.mediawiki17
1 files changed, 17 insertions, 0 deletions
diff --git a/bip-0174.mediawiki b/bip-0174.mediawiki
index 8c9443e..1dc3b47 100644
--- a/bip-0174.mediawiki
+++ b/bip-0174.mediawiki
@@ -364,6 +364,23 @@ for input,i in enumerate(psbt.inputs):
assert False
</pre>
+====Change Detection====
+
+Signers may wish to display the inputs and outputs to users for extra verification.
+In such displays, signers may wish to identify which outputs are change outputs in order to omit them to avoid additional user confusion.
+In order to detect change, a signer can use the BIP 32 derivation paths provided in inputs and outputs as well as the extended public keys provided globally.
+
+For a single key output, a signer can observe whether the master fingerprint for the public key for that output belongs to itself.
+If it does, it can then derive the public key at the specified derivation path and check whether that key is the one present in that output.
+
+For outputs involving multiple keys, a signer can first examine the inputs that it is signing.
+It should determine the general pattern of the script and internally produce a representation of the policy that the script represents.
+Such a policy can include things like how many keys are present, what order they are in, how many signers are necessary, which signers are required, etc.
+The signer can then use the BIP 32 derivation paths for each of the pubkeys to find which global extended public key is the one that can derive that particular public key.
+To do so, the signer would extract the derivation path to the highest hardened index and use that to lookup the public key with that index and master fingerprint.
+The signer would construct this script policy with extended public keys for all of the inputs and outputs.
+Change outputs would then be identified as being the outputs which have the same script policy as the inputs that are being signed.
+
===Combiner===
The Combiner can accept 1 or many PSBTs.