Skip to content

feat(templates): board_to, boarding into a program the delegation names - #31

Closed
Kukks wants to merge 1 commit into
masterfrom
feat/board-to-program-template
Closed

Kukks wants to merge 1 commit into
masterfrom
feat/board-to-program-template

Conversation

@Kukks

@Kukks Kukks commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This adds board_to, a default template that boards an onchain deposit into a Taproot program chosen per delegation.

The stock board template pins every deposit to the owner's renewal contract, so one owner gets one deposit address. board_to uses the same DelegatedBoarding artifact, binds its renewalProgram to a program variable, and locks the boarded output with 5120<program>. A service can then give out one deposit address per payment, each paying into a VTXO it already watches.

The first user is lnurl-server's onchain rail for LUD-21 verify. Each payment gets a deposit address that boards into that payment's covenant destination. The covenant already identifies the payment and forwards it to the receiver.

Template

variant file artifact template id
arkd signer templates/board_to.json 05625281… (delegated_boarding) 63fb368da79d2c664a1471946446c973b6b7789fd5ea8c984a2cbdb81969785b
emulator templates/emulator/board_to.json e3c0fa05… (emulator delegated_boarding) 0f1f8e186fc25f449a8f7ecec9add809e247d6151a8448c2b076f0140f2e486a
  • Variables: owner, boarding_exit_delay, program (bytes32) and max_fee.
  • Schedule and fees: both match board. The schedule is min_confirmations: 1, and fees come from the deposit, capped at max_fee.

Why it is safe

board() is unchanged. It requires a register intent with no onchain outputs, whose output at the paired index pays the named v1 program and keeps value + maxFee >= input. The template only lets the registrant choose that program. Funds sent to the deposit can go only there, or to the owner's forfeit and exit paths.

Tests

  • TestBoardToGivenTheRenewalProgramIsTheBoardDeposit passes for both variants. Given the renewal contract's witness program, board_to derives the same deposit script and address as board, byte for byte.
  • go test ./templates/... ./internal/core/... ./internal/interface/... and cd pkg/template && go test ./... pass. golangci-lint reports 0 issues on the changed packages, and gofmt reports no changes.
  • The emulator variant also compiles on v0.0.6, where templates/ holds only the emulator defaults. It gets the same id there (0f1f8e18…), so an executor on v0.0.6 can take it through the admin port.

Summary by CodeRabbit

  • New Features
    • Added a board_to option for directing a deposit to a Taproot program specified by the delegation. This allows deposits to pay different VTXOs.
  • Documentation
    • Updated the README with details about the default board_to template and its behavior.

The default board template pins each deposit to the owner's renewal contract,
so every deposit to one owner shares one address. board_to binds the same
DelegatedBoarding artifact's renewalProgram to a variable and locks the boarded
output with that program, so a service can hand out one deposit address per
payment: each pays a different VTXO it already watches.

Both variants are defaults. Given the renewal contract's program, board_to
derives the board template's deposit address byte for byte, under arkd's signer
and under a standalone emulator. The emulator variant also compiles on v0.0.6,
under the same id.
@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds board_to proof templates for arkd and the emulator, tests that their generated input scripts and addresses match the board delegation, and adds the template to the README’s default-template list.

Changes

Board-to delegation

Layer / File(s) Summary
Define and verify board_to
templates/board_to.json, templates/emulator/board_to.json, internal/core/domain/delegation/delegation_test.go, README.md
The templates define deposit inputs, board spends, program-locked funds, maximum fees, and a one-confirmation schedule. The test compares generated input scripts and addresses with the board delegation for both template sets. The README describes board_to.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Possibly related PRs

  • arkade-os/executor#3: This PR changes covenant pubkey encoding. PR #31 passes the owner pubkey to the board_to covenant, so both changes touch the pubkey encoding path.

Suggested reviewers: louisinger

Merge Risk: Minimal · up to f9aac

This adds an optional default template that lets a delegation choose the Taproot program receiving its boarded deposit, and it leaves the existing board template unchanged. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: a new default board_to template that boards deposits into a Taproot program chosen by the delegation. It also carries the conventional feat(templates): prefix. The…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: a new default board_to template that boards deposits into a Taproot program chosen by the delegation. It also carries the conventional feat(templates): prefix. The changeset matches this, since it adds templates/board_to.json and the emulator variant, updates the README, and adds a test that checks board_to against board.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1222e220-a0bd-465a-9764-2347e94f5460
Commits

Reviewing files that changed from the base of the PR and between 0e80b8a and f9aac2e.

Files selected for processing: 4

  • README.md
  • internal/core/domain/delegation/delegation_test.go
  • templates/board_to.json
  • templates/emulator/board_to.json

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@Kukks Kukks closed this Dec 5, 2026
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.

1 participant