Skip to content

Commit

Permalink
src: maybe add taproot support
Browse files Browse the repository at this point in the history
  • Loading branch information
octobocto committed Nov 30, 2023
1 parent 39cbc70 commit 369eb4a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/kotlin/no/bb/deskriptor/service/Service.kt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ data class Script(private val script: ScriptType) {
// operators, and replace this `when` block with something that returns
// a list of operators. For another day.
ScriptType.SCRIPT_TYPE_WPKH_NESTED -> "sh(wpkh"
ScriptType.SCRIPT_TYPE_P2TR -> "tr"
ScriptType.SCRIPT_TYPE_UNSPECIFIED -> throw newStatus(Code.INVALID_ARGUMENT, "unspecified")
ScriptType.UNRECOGNIZED -> throw newStatus(Code.INVALID_ARGUMENT, "unrecognized script type: $script")
}
Expand Down
24 changes: 24 additions & 0 deletions src/test/kotlin/no/bb/deskriptor/service/ServiceTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,30 @@ class ServiceTest : FunSpec({
) { it.assert() }
}

context("bos sparrow wallet") {
withData(
DeriveInput(
SCRIPT_TYPE_P2TR,
0,
"xpub68wbshdUKfMu3LVp329fG7JbZPZsquCb5vNAbYi9LQPUeKQmyQrnsZF8Tachg6wqyue8srM8tVBbHaHJMZuxu8RRXtubaMVZL19nsC7NAts",
"bc1pzzr5kkz5rtxw733tst7yxex8kgy2hanq0jchtt0xvp7cajqz9dkqj4pxev",
),
DeriveInput(
SCRIPT_TYPE_P2TR,
1,
"xpub68wbshdUKfMu3LVp329fG7JbZPZsquCb5vNAbYi9LQPUeKQmyQrnsZF8Tachg6wqyue8srM8tVBbHaHJMZuxu8RRXtubaMVZL19nsC7NAts",
"bc1psxyyfk9e4lykx7ghq4g44hunn75rmh3zvuxc5mud2tuae63yk3gqq2msra",
),
DeriveInput(
SCRIPT_TYPE_P2TR,
2,
"xpub68wbshdUKfMu3LVp329fG7JbZPZsquCb5vNAbYi9LQPUeKQmyQrnsZF8Tachg6wqyue8srM8tVBbHaHJMZuxu8RRXtubaMVZL19nsC7NAts",
"bc1pfmkr97h8dy50srk4p5c9c3fxg8m2uum4mrrfears2c7pt2ljx2xqu4ddwk",
),
) { it.assert() }
}


// generated with https://iancoleman.io/bip39/
context("iancoleman data") {

Expand Down

0 comments on commit 369eb4a

Please sign in to comment.