Conversation
dzdidi
marked this pull request as draft
August 11, 2026 23:20
Signed-off-by: dzdidi <dzdidi@protonmail.com>
Signed-off-by: dzdidi <dzdidi@protonmail.com>
Signed-off-by: dzdidi <dzdidi@protonmail.com>
Signed-off-by: dzdidi <dzdidi@protonmail.com>
Signed-off-by: dzdidi <dzdidi@protonmail.com>
Signed-off-by: dzdidi <dzdidi@protonmail.com>
Signed-off-by: dzdidi <dzdidi@protonmail.com>
Signed-off-by: dzdidi <dzdidi@protonmail.com>
Signed-off-by: dzdidi <dzdidi@protonmail.com>
Signed-off-by: dzdidi <dzdidi@protonmail.com>
dzdidi
force-pushed
the
feat/lock-payment-draining
branch
from
August 25, 2026 13:28
96dbf96 to
27662b3
Compare
# Conflicts: # Cargo.lock # Cargo.toml # paykit-server-e2e/tests/invoices.rs # paykit-server-e2e/tests/server_workflow.rs # paykit-server/src/paykit.rs # paykit-server/src/persistence/invoices.rs # paykit-server/src/server.rs # paykit-server/tests/create_invoice.rs
This was referenced Sep 25, 2026
- default omitted invoice request payment_in to 24 - default omitted canonical lock criterion payment_in to 24 - normalize omitted and explicit 24 to same idempotency binding - preserve rejection of invalid values and explicit mismatches - add focused compatibility regressions Signed-off-by: dzdidi <dzdidi@protonmail.com>
Signed-off-by: dzdidi <dzdidi@protonmail.com>
# Conflicts: # Cargo.lock # paykit-server-e2e/Cargo.toml # paykit-server/Cargo.toml
dzdidi
marked this pull request as ready for review
September 25, 2026 15:34
- correlate ambiguous proposal retries across all SDK attempts - persist and aggregate canonical Payment Request lifecycle state - add signed status, drain, lookup, and cleanup endpoints - fence proposal handoff while drains are active - commit frozen drain ownership, classification, and cancellation sets - fail closed on replay, cleanup, generation, and projection conflicts - use post-fence PostgreSQL clocks for deadlines and queue leases - bind timely Bitcoin observations to qualifying outpoints - bind Locks signatures to method, query-free path, and raw body - preserve omitted payment_in as the 24-hour default - add one-time prototype database reset migration - update runtime, API, rollout, and release documentation Signed-off-by: dzdidi <dzdidi@protonmail.com>
This was referenced Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TO BE DEPLOYED TOGETHER WITH pubky/locks#61
Summary
Adds Paykit-owned Payment Request lifecycle and draining required for graceful Locks deletion, then updates invoice terms to released Paykit rc56 semantics.
This change:
paykit-libandpaykit-sdkto signed release tagv0.1.0-rc56(peeled commit24162ebbcc703251d8038f2e176d1f4cfb117c6a);payment_into 24 hours.rc56 deadline and evidence invariants
Default deployment policy is 1-hour proposal-acceptance window plus 24-hour payment window. Configuration must satisfy:
payment_inremains signed compatibility binding: missing request and canonical criterion values normalize to 24, explicit values must be positive whole-hour JSONu64values, and request/criterion mismatch is rejected before persistence. It does not configure either persisted deadline.For each new invoice, Paykit Server samples PostgreSQL
clock_timestamp()after acquiring decisive row fence, computes deadline once in DB transaction, and uses same instant for persisted invoice state, outbound rc56PaymentRequestTerms.payment_deadline, replayed semantic intent, and HTTP response. Exact replay returns persisted timestamps without recomputation.First amount-matched durable observation is timely when
first_amount_matched_observed_at <= payment_deadline. Deadline expiry changes eligibility, not factual evidence: late and underpaid outputs remain persisted and observed until factual Bitcoin finality, but cannot grant automatic access. Required-peer freshness and same-fence target revalidation remain mandatory before status/drain decisions.New signed APIs
Drain responses expose aggregate state and opaque cleanup token. They do not expose Reader identities, Bundle IDs, Payment Request IDs, addresses, or raw internal errors.
Drain behavior
Drain creation atomically freezes current lifecycle classification:
Rejection-aware Locks entitlement handling is not included here. It remains later consumer change against separate lifecycle/payment/deadline/evidence model.
Staging reset and deployment
Migration
0007_payment_request_deadline_terms.sqlis intentional, one-time destructive staging cutover. It truncates incompatible Paykit application state before replacing rc48/rc55 deadline terms with rc56 schema. There is no production backfill, dual read, or compatibility migration. SQLx records migration transactionally, so later starts do not repeat reset. It does not touch Locks database.Deployment requires explicit acceptance of this staging data reset:
No migration, deployment, release, tag, or merge is performed by this PR update.
Out of scope
Verification
Independent review approved exact commit
8d86af67f0a3639284c038bf67bc1faa02688ce0(tree24dd0787330952309879bfb28698530e96c590d9). This commit changes onlyCargo.toml,Cargo.lock, andscripts/prepare-local-docker-sources.shfrom prior approved head1f9ba9ff4b99abe72f5c88d51abe5b91fc5245ca, replacing Paykitrevcoordinates with signed release tagv0.1.0-rc56.Verified locally against PostgreSQL 16.15:
Focused invoice, observation, drain, lifecycle, migration, exact-boundary, delayed-observer, and concurrency coverage also passed. GitHub CI results below must be read against exact head
8d86af67f0a3639284c038bf67bc1faa02688ce0; this repository does not currently report configured required checks.