Skip to content

Commit

Permalink
Partial support for PSBT v2
Browse files Browse the repository at this point in the history
Here we only support taproot fields that would allow us to sign BIP86 transactions.
  • Loading branch information
sstone committed Jun 20, 2024
1 parent ab01f39 commit a2e1477
Show file tree
Hide file tree
Showing 3 changed files with 416 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,15 @@ public object LexicographicalOrdering {
@JvmStatic
public fun isLessThan(a: PublicKey, b: PublicKey): Boolean = isLessThan(a.value, b.value)

@JvmStatic
public fun isLessThan(a: XonlyPublicKey, b: XonlyPublicKey): Boolean = isLessThan(a.value, b.value)

@JvmStatic
public fun compare(a: PublicKey, b: PublicKey): Int = if (a == b) 0 else if (isLessThan(a, b)) -1 else 1

@JvmStatic
public fun compare(a: XonlyPublicKey, b: XonlyPublicKey): Int = if (a == b) 0 else if (isLessThan(a, b)) -1 else 1

/**
* @param tx input transaction
* @return the input tx with inputs and outputs sorted in lexicographical order
Expand Down
Loading

0 comments on commit a2e1477

Please sign in to comment.