Skip to content

Commit f2de7dc

Browse files
committed
Add support for P2A outputs
In order to support v3 commitments in lightning, we need to use P2A (pay-to-anchor) outputs, which are currently rejected by our script interpreter. See ACINQ/bitcoin-kmp#164
1 parent cf69250 commit f2de7dc

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<groupId>fr.acinq</groupId>
44
<artifactId>bitcoin-lib_2.13</artifactId>
55
<packaging>jar</packaging>
6-
<version>0.44</version>
6+
<version>0.45</version>
77
<description>Simple Scala Bitcoin library</description>
88
<url>https://github.com/ACINQ/bitcoin-lib</url>
99
<name>bitcoin-lib</name>
@@ -153,12 +153,12 @@
153153
<dependency>
154154
<groupId>fr.acinq.bitcoin</groupId>
155155
<artifactId>bitcoin-kmp-jvm</artifactId>
156-
<version>0.27.0</version>
156+
<version>0.28.0</version>
157157
</dependency>
158158
<dependency>
159159
<groupId>fr.acinq.secp256k1</groupId>
160160
<artifactId>secp256k1-kmp-jni-jvm</artifactId>
161-
<version>0.20.0</version>
161+
<version>0.21.0</version>
162162
</dependency>
163163
<dependency>
164164
<groupId>org.scodec</groupId>

src/main/scala/fr/acinq/bitcoin/scalacompat/Script.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,4 +190,10 @@ object Script {
190190
*/
191191
def witnessScriptPathPay2tr(internalKey: XonlyPublicKey, script: ScriptTree.Leaf, witness: ScriptWitness, scriptTree: ScriptTree): ScriptWitness = bitcoin.Script.witnessScriptPathPay2tr(internalKey.pub, scala2kmp(script), witness, scala2kmp(scriptTree))
192192

193+
/** Standard P2A (pay-to-anchor) output. */
194+
val pay2anchor: Seq[ScriptElt] = bitcoin.Script.getPay2anchor.asScala.map(kmp2scala).toList
195+
196+
/** An empty witness script must be used to spend [[pay2anchor]] outputs. */
197+
val witnessPay2anchor: ScriptWitness = bitcoin.Script.getWitnessPay2anchor
198+
193199
}

0 commit comments

Comments
 (0)