<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.runcraft.io/index.php?action=history&amp;feed=atom&amp;title=Pay_server</id>
	<title>Pay server - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.runcraft.io/index.php?action=history&amp;feed=atom&amp;title=Pay_server"/>
	<link rel="alternate" type="text/html" href="https://wiki.runcraft.io/index.php?title=Pay_server&amp;action=history"/>
	<updated>2026-11-14T11:46:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>https://wiki.runcraft.io/index.php?title=Pay_server&amp;diff=540&amp;oldid=prev</id>
		<title>Zhell at 18:48, 22 September 2026</title>
		<link rel="alternate" type="text/html" href="https://wiki.runcraft.io/index.php?title=Pay_server&amp;diff=540&amp;oldid=prev"/>
		<updated>2026-09-22T18:48:45Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 18:48, 22 September 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l16&quot; &gt;Line 16:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 16:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#client signs their input, sends to payserver again&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#client signs their input, sends to payserver again&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#payserver signs their funding input + broadcast (ex with /finalize endpoint)&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#payserver signs their funding input + broadcast (ex with /finalize endpoint)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;h2 class&lt;/del&gt;=&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;mwt-heading&amp;quot; &amp;gt;&lt;/del&gt;&amp;#039;&amp;#039;&amp;#039;Pourquoi pay() doit avoir lieu avant les autres signatures&amp;#039;&amp;#039;&amp;#039;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/h2&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;= &lt;/ins&gt;&amp;#039;&amp;#039;&amp;#039;Pourquoi pay() doit avoir lieu avant les autres signatures&amp;#039;&amp;#039;&amp;#039; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;Engagement de signature&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;: Les signatures Bitcoin hachent l’intégralité de la structure de la transaction (inputs, outputs, montants, scripts). Modifier quoi que ce soit après la signature invalide les signatures (le hash change).&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;Engagement de signature&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;: Les signatures Bitcoin hachent l’intégralité de la structure de la transaction (inputs, outputs, montants, scripts). Modifier quoi que ce soit après la signature invalide les signatures (le hash change).&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Dans les transactions multi-parties :&amp;lt;br&amp;gt;La fonction&amp;amp;nbsp;&amp;lt;code&amp;gt;pay()&amp;lt;/code&amp;gt;&amp;amp;nbsp;modifie la transaction (elle ajoute des inputs/outputs pour les frais) → elle&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;doit&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;donc intervenir&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;avant&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;les signatures finales sur ces nouvelles parties.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Si une partie signe en premier, puis que&amp;amp;nbsp;&amp;lt;code&amp;gt;pay()&amp;lt;/code&amp;gt;&amp;amp;nbsp;ajoute des inputs → les signatures sont cassées (elles s’étaient engagées sur l’ancien hash).&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;Dans les transactions multi-parties :&amp;lt;br&amp;gt;La fonction&amp;amp;nbsp;&amp;lt;code&amp;gt;pay()&amp;lt;/code&amp;gt;&amp;amp;nbsp;modifie la transaction (elle ajoute des inputs/outputs pour les frais) → elle&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;doit&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;donc intervenir&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;avant&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;les signatures finales sur ces nouvelles parties.&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;== &lt;/ins&gt;Pourquoi ne pas utiliser &amp;#039;&amp;#039;&amp;#039;SIGHASH_ANYONECANPAY ?&amp;#039;&amp;#039;&amp;#039; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;Si une partie signe en premier, puis que&amp;amp;nbsp;&amp;lt;code&amp;gt;pay()&amp;lt;/code&amp;gt;&amp;amp;nbsp;ajoute des inputs → les signatures sont cassées (elles s’étaient engagées sur l’ancien hash).&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;SIGHASH_ANYONECANPAY&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;permettrait théoriquement au client de signer&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;avant&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;le&amp;amp;nbsp;&amp;lt;code&amp;gt;pay()&amp;lt;/code&amp;gt;, mais voici pourquoi&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;Run n’utilise pas SIGHASH_ANYONECANPAY&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;dans son code par défaut :&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Le protocole&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;Run&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;(avant RunCraft) utilise exclusivement&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;SIGHASH_ALL&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;pour garantir l’intégrité des jigs.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;Sécurité et engagement&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;:&amp;lt;br&amp;gt;SIGHASH_ANYONECANPAY permet à n’importe qui d’ajouter des inputs plus tard sans casser les signatures existantes. C’est très utile pour des transactions collaboratives comme les atomic swaps ou les coinjoins, mais c’est&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;risqué&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;pour le système de jigs de Run.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Les jigs/tokens sont&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;stateful&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;(propriété, méthodes, références dans OP_RETURN, etc.), donc Run veut un&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;engagement total&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;sur la transaction pour empêcher toute manipulation.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Si un client signait avec ANYONECANPAY, un PayServer malveillant (ou un intermédiaire) pourrait ajouter des inputs/outputs malveillants (ex. : voler des fonds).&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;SIGHASH_ALL&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;garantit que le signataire accepte&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;exactement&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;la forme de la transaction telle qu’elle est au moment de la signature.# Markdown syntax guide&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/p&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;h3 class&lt;/del&gt;=&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;mwt-heading&amp;quot; &amp;gt;&lt;/del&gt;Pourquoi ne pas utiliser &amp;#039;&amp;#039;&amp;#039;SIGHASH_ANYONECANPAY ?&amp;#039;&amp;#039;&amp;#039;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/h3&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;SIGHASH_ANYONECANPAY&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;permettrait théoriquement au client de signer&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;avant&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;le&amp;amp;nbsp;&amp;lt;code&amp;gt;pay()&amp;lt;/code&amp;gt;, mais voici pourquoi&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;Run n’utilise pas SIGHASH_ANYONECANPAY&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;dans son code par défaut :&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;Le protocole&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;Run&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;(avant RunCraft) utilise exclusivement&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;SIGHASH_ALL&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;pour garantir l’intégrité des jigs.&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;Sécurité et engagement&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;:&amp;lt;br&amp;gt;SIGHASH_ANYONECANPAY permet à n’importe qui d’ajouter des inputs plus tard sans casser les signatures existantes. C’est très utile pour des transactions collaboratives comme les atomic swaps ou les coinjoins, mais c’est&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;risqué&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;pour le système de jigs de Run.&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;___ ACTUALLY this might not be exact because:&amp;lt;p&amp;gt;It depends on which base sighash flag you combine ANYONECANPAY with — ANYONECANPAY only changes the &amp;#039;&amp;#039;&amp;#039;input&amp;#039;&amp;#039;&amp;#039; commitment, not the output commitment. The output behavior is governed by the base type (ALL / SINGLE / NONE):&amp;lt;/p&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;Les jigs/tokens sont&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;stateful&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;(propriété, méthodes, références dans OP_RETURN, etc.), donc Run veut un&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;engagement total&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;sur la transaction pour empêcher toute manipulation.&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;*&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;SIGHASH_ALL | ANYONECANPAY&amp;#039;&amp;#039;&amp;#039; — all outputs (including your output0 with the OP_RETURN) are hashed into the sighash. Your signature commits to that exact OP_RETURN, so a counterparty changing it would invalidate your signature. Only the input list is left open (others can add more inputs).&amp;lt;/p&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;Si un client signait avec ANYONECANPAY, un PayServer malveillant (ou un intermédiaire) pourrait ajouter des inputs/outputs malveillants (ex. : voler des fonds).&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;*&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;SIGHASH_SINGLE | ANYONECANPAY&amp;#039;&amp;#039;&amp;#039; — only the output at the &amp;#039;&amp;#039;same index&amp;#039;&amp;#039; as the input you&amp;#039;re signing is committed. So if your input is at index 0, then yes, output0 (your OP_RETURN) is locked and can&amp;#039;t be changed. But if your input is at a different index than 0, output0 is &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; committed at all and the other party is free to modify it.&amp;lt;/p&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;SIGHASH_ALL&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;garantit que le signataire accepte&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;exactement&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;la forme de la transaction telle qu’elle est au moment de la signature.# Markdown syntax guide&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;*&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;SIGHASH_NONE | ANYONECANPAY&amp;#039;&amp;#039;&amp;#039; — no outputs are committed. Anyone can change any output, including output0, without invalidating your signature.&amp;lt;/p&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;p&amp;gt;So: if you want to guarantee output0&amp;#039;s OP_RETURN can&amp;#039;t be tampered with by the next party, use &amp;#039;&amp;#039;&amp;#039;SIGHASH_ALL | ANYONECANPAY&amp;#039;&amp;#039;&amp;#039; (safest, commits everything except letting others add inputs), or make sure your signed input is at index 0 and use &amp;#039;&amp;#039;&amp;#039;SIGHASH_SINGLE | ANYONECANPAY&amp;#039;&amp;#039;&amp;#039;. Anything with SIGHASH_NONE, or a SINGLE where your input index ≠ 0, leaves output0 open to modification.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;One gotcha with SIGHASH_SINGLE: if there&amp;#039;s no output at the same index as your input, the &amp;quot;SIGHASH_SINGLE bug&amp;quot; applies in legacy Bitcoin (signs the value &amp;lt;code&amp;gt;0000...0001&amp;lt;/code&amp;gt;) — BSV script interpreters may or may not preserve this quirk, worth testing against whatever node/library you&amp;#039;re using.&lt;/ins&gt;&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Zhell</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.runcraft.io/index.php?title=Pay_server&amp;diff=517&amp;oldid=prev</id>
		<title>Zhell at 18:57, 20 January 2026</title>
		<link rel="alternate" type="text/html" href="https://wiki.runcraft.io/index.php?title=Pay_server&amp;diff=517&amp;oldid=prev"/>
		<updated>2026-01-20T18:57:50Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 18:57, 20 January 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Signing Flow&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;== &lt;/ins&gt;&amp;#039;&amp;#039;&amp;#039;Signing Flow&amp;#039;&amp;#039;&amp;#039; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Right now the flow is:&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Right now the flow is:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l5&quot; &gt;Line 5:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#payserver adds input funding + change output, and signs them, sends back to client&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#payserver adds input funding + change output, and signs them, sends back to client&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#client finally signs their input, and broadcasts&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#client finally signs their input, and broadcasts&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If we want payserver to handle the broadcast itself right after signing for funding, we would need to adapt the flow &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;to this &lt;/del&gt;(but maybe this would introduce concurrency issues since no signing on first ping would not activate _pendingUtxos array in payserver purse, so we would need to add a new management for reserved utxos + timeout, and this would add one more round-trip so 200-800 ms of latency):&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If we want payserver to handle the broadcast itself right after signing for funding, we would need to adapt the flow (but maybe this would introduce concurrency issues since no signing on first ping would not activate _pendingUtxos array in payserver purse, so we would need to add a new management for reserved utxos + timeout, and this would add one more round-trip so 200-800 ms of latency)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;note: the only reason i&amp;#039;m considering this 2nd flow is bc i thought it might reduce race conditions, but since every run instance already manages its own internal queue for utxos &amp;amp; signing, it seems useless. Just make sure to have a different purse on each server (for ex if you have multiple payservers).&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;New flow would be&lt;/ins&gt;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#client builds, no funding, no sign, sends to payserver&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#client builds, no funding, no sign, sends to payserver&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#payserver adds input funding + change output, no signing, sends back to client&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#payserver adds input funding + change output, no signing, sends back to client&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#client signs their input, sends to payserver again&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#client signs their input, sends to payserver again&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#payserver signs their funding input + broadcast (ex with /finalize endpoint)&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#payserver signs their funding input + broadcast (ex with /finalize endpoint)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;note: the only reason i&amp;#039;m considering the 2nd flow is bc i thought it might reduce race conditions, but since every run instance already manages its own internal queue for utxos &amp;amp; signing, it seems useless. Just make sure to have a different purse on each server (for ex if you have multiple payservers).&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;h2 class=&amp;quot;mwt-heading&amp;quot; &lt;/ins&gt;&amp;gt;&amp;#039;&amp;#039;&amp;#039;Pourquoi pay() doit avoir lieu avant les autres signatures&amp;#039;&amp;#039;&amp;#039;&amp;lt;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;h2&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;p&lt;/del&gt;&amp;gt;&amp;#039;&amp;#039;&amp;#039;Pourquoi pay() doit avoir lieu avant les autres signatures&amp;#039;&amp;#039;&amp;#039;&amp;lt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;p&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;Engagement de signature&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;: Les signatures Bitcoin hachent l’intégralité de la structure de la transaction (inputs, outputs, montants, scripts). Modifier quoi que ce soit après la signature invalide les signatures (le hash change).&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;Engagement de signature&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;: Les signatures Bitcoin hachent l’intégralité de la structure de la transaction (inputs, outputs, montants, scripts). Modifier quoi que ce soit après la signature invalide les signatures (le hash change).&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;Dans les transactions multi-parties :&amp;lt;br&amp;gt;La fonction&amp;amp;nbsp;&amp;lt;code&amp;gt;pay()&amp;lt;/code&amp;gt;&amp;amp;nbsp;modifie la transaction (elle ajoute des inputs/outputs pour les frais) → elle&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;doit&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;donc intervenir&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;avant&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;les signatures finales sur ces nouvelles parties.&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;Dans les transactions multi-parties :&amp;lt;br&amp;gt;La fonction&amp;amp;nbsp;&amp;lt;code&amp;gt;pay()&amp;lt;/code&amp;gt;&amp;amp;nbsp;modifie la transaction (elle ajoute des inputs/outputs pour les frais) → elle&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;doit&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;donc intervenir&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;avant&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;les signatures finales sur ces nouvelles parties.&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;Si une partie signe en premier, puis que&amp;amp;nbsp;&amp;lt;code&amp;gt;pay()&amp;lt;/code&amp;gt;&amp;amp;nbsp;ajoute des inputs → les signatures sont cassées (elles s’étaient engagées sur l’ancien hash).&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;Si une partie signe en premier, puis que&amp;amp;nbsp;&amp;lt;code&amp;gt;pay()&amp;lt;/code&amp;gt;&amp;amp;nbsp;ajoute des inputs → les signatures sont cassées (elles s’étaient engagées sur l’ancien hash).&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;h3 class=&amp;quot;mwt-heading&amp;quot; &amp;gt;Pourquoi ne pas utiliser &amp;#039;&amp;#039;&amp;#039;SIGHASH_ANYONECANPAY ?&amp;#039;&amp;#039;&amp;#039;&amp;lt;/h3&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;SIGHASH_ANYONECANPAY&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;permettrait théoriquement au client de signer&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;avant&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;le&amp;amp;nbsp;&amp;lt;code&amp;gt;pay()&amp;lt;/code&amp;gt;, mais voici pourquoi&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;Run n’utilise pas SIGHASH_ANYONECANPAY&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;dans son code par défaut :&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;SIGHASH_ANYONECANPAY&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;permettrait théoriquement au client de signer&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;avant&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;le&amp;amp;nbsp;&amp;lt;code&amp;gt;pay()&amp;lt;/code&amp;gt;, mais voici pourquoi&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;Run n’utilise pas SIGHASH_ANYONECANPAY&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;dans son code par défaut :&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;Le protocole&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;Run&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;(avant RunCraft) utilise exclusivement&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;SIGHASH_ALL&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;pour garantir l’intégrité des jigs.&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;Le protocole&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;Run&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;(avant RunCraft) utilise exclusivement&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;SIGHASH_ALL&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;pour garantir l’intégrité des jigs.&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Zhell</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.runcraft.io/index.php?title=Pay_server&amp;diff=516&amp;oldid=prev</id>
		<title>Zhell at 18:54, 20 January 2026</title>
		<link rel="alternate" type="text/html" href="https://wiki.runcraft.io/index.php?title=Pay_server&amp;diff=516&amp;oldid=prev"/>
		<updated>2026-01-20T18:54:24Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 18:54, 20 January 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l5&quot; &gt;Line 5:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#payserver adds input funding + change output, and signs them, sends back to client&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#payserver adds input funding + change output, and signs them, sends back to client&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#client finally signs their input, and broadcasts&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#client finally signs their input, and broadcasts&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If we want payserver to handle the broadcast itself right after signing for funding, we would need to adapt the flow to this (but maybe this would introduce concurrency issues since no signing on first ping would not activate _pendingUtxos array in payserver purse):&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If we want payserver to handle the broadcast itself right after signing for funding, we would need to adapt the flow to this (but maybe this would introduce concurrency issues since no signing on first ping would not activate _pendingUtxos array in payserver purse&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;, so we would need to add a new management for reserved utxos + timeout, and this would add one more round-trip so 200-800 ms of latency&lt;/ins&gt;):&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#client builds, no funding, no sign, sends to payserver&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#client builds, no funding, no sign, sends to payserver&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#payserver adds input funding + change output, no signing, sends back to client&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#payserver adds input funding + change output, no signing, sends back to client&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#client signs their input, sends to payserver again&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#client signs their input, sends to payserver again&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#payserver signs their funding input + &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;broadcasts&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#payserver signs their funding input + &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;broadcast (ex with /finalize endpoint)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;p&amp;gt;&lt;/del&gt;&amp;#039;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/p&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;note: the only reason i&lt;/ins&gt;&amp;#039;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;m considering the 2nd flow is bc i thought it might reduce race conditions, but since every run instance already manages its own internal queue for utxos &amp;amp; signing, it seems useless. Just make sure to have a different purse on each server (for ex if you have multiple payservers).&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;Pourquoi pay() doit avoir lieu avant les autres signatures&amp;#039;&amp;#039;&amp;#039;&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;Pourquoi pay() doit avoir lieu avant les autres signatures&amp;#039;&amp;#039;&amp;#039;&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;Engagement de signature&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;: Les signatures Bitcoin hachent l’intégralité de la structure de la transaction (inputs, outputs, montants, scripts). Modifier quoi que ce soit après la signature invalide les signatures (le hash change).&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;Engagement de signature&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;: Les signatures Bitcoin hachent l’intégralité de la structure de la transaction (inputs, outputs, montants, scripts). Modifier quoi que ce soit après la signature invalide les signatures (le hash change).&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Zhell</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.runcraft.io/index.php?title=Pay_server&amp;diff=515&amp;oldid=prev</id>
		<title>Zhell at 18:50, 20 January 2026</title>
		<link rel="alternate" type="text/html" href="https://wiki.runcraft.io/index.php?title=Pay_server&amp;diff=515&amp;oldid=prev"/>
		<updated>2026-01-20T18:50:15Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 18:50, 20 January 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l5&quot; &gt;Line 5:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#payserver adds input funding + change output, and signs them, sends back to client&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#payserver adds input funding + change output, and signs them, sends back to client&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#client finally signs their input, and broadcasts&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#client finally signs their input, and broadcasts&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If we want payserver to handle the broadcast itself right after signing for funding, we would need to adapt the flow to:&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If we want payserver to handle the broadcast itself right after signing for funding, we would need to adapt the flow to &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;this (but maybe this would introduce concurrency issues since no signing on first ping would not activate _pendingUtxos array in payserver purse)&lt;/ins&gt;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#client builds, no funding, no sign, sends to payserver&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#client builds, no funding, no sign, sends to payserver&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#payserver adds input funding + change output, no signing, sends back to client&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#payserver adds input funding + change output, no signing, sends back to client&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Zhell</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.runcraft.io/index.php?title=Pay_server&amp;diff=514&amp;oldid=prev</id>
		<title>Zhell at 18:49, 20 January 2026</title>
		<link rel="alternate" type="text/html" href="https://wiki.runcraft.io/index.php?title=Pay_server&amp;diff=514&amp;oldid=prev"/>
		<updated>2026-01-20T18:49:21Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 18:49, 20 January 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Signing Flow&amp;#039;&amp;#039;&amp;#039;Right now the flow is:&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Signing Flow&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Right now the flow is:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#client builds tx with no funding, doesn&amp;#039;t sign anything, sends to payserver&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#client builds tx with no funding, doesn&amp;#039;t sign anything, sends to payserver&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#payserver adds input funding + change output, and signs them, sends back to client&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#payserver adds input funding + change output, and signs them, sends back to client&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Zhell</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.runcraft.io/index.php?title=Pay_server&amp;diff=513&amp;oldid=prev</id>
		<title>Zhell at 18:49, 20 January 2026</title>
		<link rel="alternate" type="text/html" href="https://wiki.runcraft.io/index.php?title=Pay_server&amp;diff=513&amp;oldid=prev"/>
		<updated>2026-01-20T18:49:11Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 18:49, 20 January 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&amp;#039;Signing Flow&amp;#039;&amp;#039;&amp;#039;Right now the flow is:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;#client builds tx with no funding, doesn&amp;#039;t sign anything, sends to payserver&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;#payserver adds input funding + change output, and signs them, sends back to client&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;#client finally signs their input, and broadcasts&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;If we want payserver to handle the broadcast itself right after signing for funding, we would need to adapt the flow to:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;#client builds, no funding, no sign, sends to payserver&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;#payserver adds input funding + change output, no signing, sends back to client&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;#client signs their input, sends to payserver again&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;#payserver signs their funding input + broadcasts&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;lt;/p&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;Pourquoi pay() doit avoir lieu avant les autres signatures&amp;#039;&amp;#039;&amp;#039;&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;Pourquoi pay() doit avoir lieu avant les autres signatures&amp;#039;&amp;#039;&amp;#039;&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;Engagement de signature&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;: Les signatures Bitcoin hachent l’intégralité de la structure de la transaction (inputs, outputs, montants, scripts). Modifier quoi que ce soit après la signature invalide les signatures (le hash change).&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;Engagement de signature&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;: Les signatures Bitcoin hachent l’intégralité de la structure de la transaction (inputs, outputs, montants, scripts). Modifier quoi que ce soit après la signature invalide les signatures (le hash change).&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Zhell</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.runcraft.io/index.php?title=Pay_server&amp;diff=512&amp;oldid=prev</id>
		<title>Zhell: Created page with &quot;&lt;p&gt;&#039;&#039;&#039;Pourquoi pay() doit avoir lieu avant les autres signatures&#039;&#039;&#039;&lt;/p&gt; &lt;p&gt;&#039;&#039;&#039;Engagement de signature&#039;&#039;&#039;&amp;nbsp;: Les signatures Bitcoin hachent l’intégralité de la structur...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.runcraft.io/index.php?title=Pay_server&amp;diff=512&amp;oldid=prev"/>
		<updated>2026-01-20T18:33:43Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;Pourquoi pay() doit avoir lieu avant les autres signatures&amp;#039;&amp;#039;&amp;#039;&amp;lt;/p&amp;gt; &amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;Engagement de signature&amp;#039;&amp;#039;&amp;#039; : Les signatures Bitcoin hachent l’intégralité de la structur...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;Pourquoi pay() doit avoir lieu avant les autres signatures&amp;#039;&amp;#039;&amp;#039;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;Engagement de signature&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;: Les signatures Bitcoin hachent l’intégralité de la structure de la transaction (inputs, outputs, montants, scripts). Modifier quoi que ce soit après la signature invalide les signatures (le hash change).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Dans les transactions multi-parties :&amp;lt;br&amp;gt;La fonction&amp;amp;nbsp;&amp;lt;code&amp;gt;pay()&amp;lt;/code&amp;gt;&amp;amp;nbsp;modifie la transaction (elle ajoute des inputs/outputs pour les frais) → elle&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;doit&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;donc intervenir&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;avant&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;les signatures finales sur ces nouvelles parties.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Si une partie signe en premier, puis que&amp;amp;nbsp;&amp;lt;code&amp;gt;pay()&amp;lt;/code&amp;gt;&amp;amp;nbsp;ajoute des inputs → les signatures sont cassées (elles s’étaient engagées sur l’ancien hash).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;SIGHASH_ANYONECANPAY&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;permettrait théoriquement au client de signer&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;avant&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;le&amp;amp;nbsp;&amp;lt;code&amp;gt;pay()&amp;lt;/code&amp;gt;, mais voici pourquoi&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;Run n’utilise pas SIGHASH_ANYONECANPAY&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;dans son code par défaut :&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Le protocole&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;Run&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;(avant RunCraft) utilise exclusivement&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;SIGHASH_ALL&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;pour garantir l’intégrité des jigs.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;Sécurité et engagement&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;:&amp;lt;br&amp;gt;SIGHASH_ANYONECANPAY permet à n’importe qui d’ajouter des inputs plus tard sans casser les signatures existantes. C’est très utile pour des transactions collaboratives comme les atomic swaps ou les coinjoins, mais c’est&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;risqué&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;pour le système de jigs de Run.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Les jigs/tokens sont&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;stateful&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;(propriété, méthodes, références dans OP_RETURN, etc.), donc Run veut un&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;engagement total&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;sur la transaction pour empêcher toute manipulation.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Si un client signait avec ANYONECANPAY, un PayServer malveillant (ou un intermédiaire) pourrait ajouter des inputs/outputs malveillants (ex. : voler des fonds).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;#039;&amp;#039;&amp;#039;SIGHASH_ALL&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;garantit que le signataire accepte&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;exactement&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;la forme de la transaction telle qu’elle est au moment de la signature.# Markdown syntax guide&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zhell</name></author>
		
	</entry>
</feed>