Skip to content

Conversation

louisinger
Copy link
Contributor

@louisinger louisinger commented Oct 2, 2025

implements arkade-os/arkd#726

@altafan please review

Summary by CodeRabbit

  • Bug Fixes

    • Redemption flow now correctly reads condition witness data when present, reducing edge-case failures.
    • Taproot tree metadata is recorded using the updated identifier, improving interoperability with other tools.
  • Chores

    • Updated an underlying library dependency to a newer patch version for improved compatibility.

Copy link

coderabbitai bot commented Oct 2, 2025

Walkthrough

Updates ark-lib dependency in go.mod. Adjusts redemption flow to read the condition witness from Ark PSBT fields (ConditionWitnessField) and store it under ArkFieldConditionWitness. Replaces PSBT unknown-field key for taproot tree serialization with txutils.ArkFieldTaprootTree in utils.

Changes

Cohort / File(s) Summary
Dependency bump
go.mod
Update require for github.com/arkade-os/arkd/pkg/ark-lib to v0.7.2-0.20251003162148-53e6f346f766.
Redemption condition witness source
redemption/redeem.go
Replace direct condition witness retrieval with GetArkPsbtFields(..., ConditionWitnessField); if present, write fields[0] as the witness and store it under ArkFieldConditionWitness. Remove prior usage of the old CONDITION_WITNESS key path.
Ark PSBT field keys (taptree)
utils.go
Replace PSBT Unknown field key txutils.VTXO_TAPROOT_TREE_KEY with txutils.ArkFieldTaprootTree in toIntentInputs (affects serialization of taproot tree data into arkFields).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant R as Redeemer
  participant PS as PSBT
  participant U as Utils

  R->>PS: GetArkPsbtFields(inputIdx, ConditionWitnessField)
  alt Condition witness field present
    PS-->>R: fields[0]
    R->>R: Set input.witness = fields[0]
    R->>R: args[ArkFieldConditionWitness] = fields[0]
  else Absent
    PS-->>R: none
    R->>R: Continue without condition witness
  end

  R->>U: toIntentInputs(...)
  U->>U: Serialize taptree under txutils.ArkFieldTaprootTree
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • update to arkd PR717 #21: Also updates the github.com/arkade-os/arkd/pkg/ark-lib version in go.mod to a nearby v0.7.2 snapshot.

Suggested reviewers

  • altafan

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title “update ark-lib with new ark PSBT fields” succinctly captures the primary change of bumping the ark-lib dependency and adapting the code to use the new PSBT fields. It directly reflects both the dependency update and related code modifications present in the diff. The phrasing is clear, specific, and concise, allowing a reviewer to immediately understand the intent of the pull request.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ark-psbt-field

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 28110ab and cbde4f7.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (1)
  • go.mod (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Sdk unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@altafan altafan merged commit f9c320c into master Oct 3, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants