Skip to content

tapassets: wallet fund onboarding carriers#1034

Open
darioAnongba wants to merge 2 commits into
feat/taproot-assets-integration-refreshfrom
feat/taproot-assets-carrier-onboarding
Open

tapassets: wallet fund onboarding carriers#1034
darioAnongba wants to merge 2 commits into
feat/taproot-assets-integration-refreshfrom
feat/taproot-assets-carrier-onboarding

Conversation

@darioAnongba

Copy link
Copy Markdown
Collaborator

Summary

  • replace exact-fee subtraction onboarding with tap-sdk wallet-funded anchor construction
  • expose carrier_value_sat plus fee-rate or target-confirmation selectors at the daemon and CLI boundary
  • keep asset units, carrier sats, and miner fees explicit and independently validated
  • reuse the same durable request bytes, custom lock ID, sealed package, and final PSBT across retries
  • preserve the existing LND WalletKit signing and operator-registration boundary

This is stack 2 of the Wavelength Taproot Assets PoC and depends on #1033.

Motivation

Onboarding an asset-bearing VTXO needs a deliberate carrier-satoshi value while transaction fees should come from the shared LND/tapd wallet. The previous exact-fee prototype reduced the asset anchor value by the fee and did not model change. Wallet-funded tap-sdk mode gives the output its requested carrier value and lets the wallet select ordinary Bitcoin inputs and change.

Validation

  • make build
  • make unit
  • make lint-changed-local
  • go test -race ./tapassets ./waved
  • focused CLI, protobuf, onboarding economics, retry, and funding-summary tests

The live bitcoind/LND/tapd/operator confirmation loop remains in the later Lumos integration test.

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 255d5d6aa9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +129 to +132
carrierValue := req.GetCarrierValueSat()
if carrierValue == 0 {
carrierValue = uint64(minimumCarrier)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Freeze the default carrier value for retries

When callers use the documented zero default, this substitutes the operator's current minimum into the request that is hashed and persisted. If the operator raises or lowers its minimum while the published anchor is awaiting confirmation, the caller can resend the same byte-identical RPC/CLI request but it now hashes differently and loadState rejects it as an idempotency-key rewrite. Since the original asset input has already been committed, the onboarding cannot be resumed. Persist the resolved default for the request ID or return it to the caller and require it on subsequent retries.

Useful? React with 👍 / 👎.

Comment thread tapassets/onboarding.go
Comment on lines +766 to +771
_ = binary.Write(&value, binary.BigEndian, request.CarrierValueSat)
_ = binary.Write(
&value, binary.BigEndian, request.FeeRateSatPerVByte,
)
_ = binary.Write(&value, binary.BigEndian, request.TargetConf)
_ = binary.Write(&value, binary.BigEndian, request.MaxFeeSat)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve journals created by the prior onboarding format

This changes the bytes included in the durable request digest but leaves onboardingStateVersion at 0. Any pre-upgrade onboarding that has already committed/published a package will load as version 0, then fail the digest comparison on every retry because its stored digest was built with AnchorFeeSat; it can therefore never reach operator registration after deployment. Add a state migration/legacy resume path (or otherwise retain the old digest semantics for existing journals) before changing the digest format.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants