From 6716df143362322ff47424a4b13f0b2fa0b1b8f5 Mon Sep 17 00:00:00 2001 From: spacebear Date: Thu, 6 Aug 2026 10:24:58 -0400 Subject: [PATCH 1/2] Document the Dart release process The Dart package carried no publishing instructions, though the payjoin-ffi README claims each language directory has them. Record the steps a maintainer follows: pin the wrapper revision, set the version and changelog, test, and inspect the archive before publishing. Adopt `+payjoin-` for the package version, matching the convention bark_bitcoin uses on pub.dev. The package's own semantic version stays what consumers write constraints against, while the build metadata names the wrapped payjoin release on the pub.dev listing. Note that generate_bindings.sh emits _test-utils bindings, which published releases carry into consumer builds that lack the feature. Resolving that needs a production mode on the script, so record it as a known limitation rather than fold it into this change. --- payjoin-ffi/dart/CONTRIBUTING.md | 59 +++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/payjoin-ffi/dart/CONTRIBUTING.md b/payjoin-ffi/dart/CONTRIBUTING.md index 1ae6931d6..5c4790285 100644 --- a/payjoin-ffi/dart/CONTRIBUTING.md +++ b/payjoin-ffi/dart/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing -Instructions for building and testing the Dart bindings locally. +Instructions for building, testing, and publishing the Dart bindings. ## Build Bindings @@ -24,3 +24,60 @@ bash ./scripts/generate_bindings.sh # Run all tests dart test ``` + +## Releasing + +Maintainer instructions for publishing to +[pub.dev](https://pub.dev/packages/payjoin). + +### Versioning + +Versions take the form `+payjoin-`, for +example `0.2.1+payjoin-1.0.0-rc.8`. The part before the `+` is the package's +own semantic version, and is what consumers write version constraints +against. The build metadata after it records which `payjoin` release the +bindings wrap, so the pub.dev listing names the supported protocol version +without a changelog lookup. + +Bump the package version for changes to the Dart API or to packaging. Update +the build metadata whenever the wrapped `payjoin` release changes, which is a +patch bump at minimum, since the same Dart API gets new behavior. + +### Publishing + +1. Point the `payjoin-ffi` dependency in `native/Cargo.toml` at the commit + tagged for the `payjoin` release being wrapped. Consumers build from that + revision. `.cargo/config.toml` redirects it to the local workspace for + development only, and `.pubignore` withholds that file from the archive. +2. Set the version in `pubspec.yaml` and describe the consumer-visible + changes under a matching heading in `CHANGELOG.md`. +3. Run the tests: `bash ./contrib/test.sh`. +4. Generate the bindings to be shipped and inspect the archive. + + ```shell + bash ./scripts/generate_bindings.sh + dart pub publish --dry-run + ``` + + `.pubignore` replaces `.gitignore` for publishing, so a gitignored file is + only kept out of the archive if `.pubignore` also lists it. Two build + artifacts decide the contents here: `lib/payjoin.dart` has to be present + and current, since it is the binding surface consumers import, and + `native/Cargo.lock` has to be absent, since publishing one resolved + against the `.cargo/config.toml` path overlay would hand consumers a + lockfile pinned to a dependency graph they cannot reproduce. Delete it + before publishing if a local build left one behind. + +5. Publish. + + ```shell + dart pub publish + ``` + +Known limitation: `scripts/generate_bindings.sh` always builds with +`_test-utils`, so the bindings it emits declare test-only APIs such as +`TestServices` and `BitcoindEnv`. Consumers build the native library without +that feature, which leaves those declarations backed by symbols that are +absent at runtime. Every release so far ships them. Giving the script a +production mode, as `payjoin-ffi/csharp` does with `PAYJOIN_FFI_FEATURES`, +remains to be done. From 089cdcafc346c6d8d436641a3178409cbe5e5ab1 Mon Sep 17 00:00:00 2001 From: spacebear Date: Thu, 6 Aug 2026 10:25:05 -0400 Subject: [PATCH 2/2] Prepare dart payjoin 0.2.1 for pub.dev Bump the dart bindings to 0.2.1+payjoin-1.0.0-rc.8 to publish updated bindings for payjoin 1.0.0-rc.8, pin the payjoin-ffi wrapper dependency to e4f5a0b3, the payjoin-1.0.0-rc.8 tag commit, and record the release in the changelog. The FFI surface is unchanged since rc.7, so a patch bump covers it. What reaches consumers is rc.8's tightened sender validation: an input must declare a sighash type that commits to all inputs and outputs, so only ECDSA SIGHASH_ALL, taproot SIGHASHDEFAULT/SIGHASH_ALL, and an unset type are accepted. --- payjoin-ffi/dart/CHANGELOG.md | 8 ++++++++ payjoin-ffi/dart/native/Cargo.toml | 2 +- payjoin-ffi/dart/pubspec.yaml | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/payjoin-ffi/dart/CHANGELOG.md b/payjoin-ffi/dart/CHANGELOG.md index 41854b904..b00565815 100644 --- a/payjoin-ffi/dart/CHANGELOG.md +++ b/payjoin-ffi/dart/CHANGELOG.md @@ -1,3 +1,11 @@ +## [0.2.1+payjoin-1.0.0-rc.8] + +- Sender inputs must declare a sighash type that commits to all inputs and + outputs. Only ECDSA `SIGHASH_ALL`, taproot `SIGHASHDEFAULT`/`SIGHASH_ALL`, + and an unset type are accepted, both when building the sender context and + when validating the receiver's proposal +- Versions now carry the wrapped payjoin release as build metadata + ## [0.2.0] - Bindings for payjoin-1.0.0-rc.7 diff --git a/payjoin-ffi/dart/native/Cargo.toml b/payjoin-ffi/dart/native/Cargo.toml index 02d63bfa9..ed0c76957 100644 --- a/payjoin-ffi/dart/native/Cargo.toml +++ b/payjoin-ffi/dart/native/Cargo.toml @@ -16,6 +16,6 @@ name = "payjoin_ffi_wrapper" crate-type = ["staticlib", "cdylib"] [dependencies] -payjoin-ffi = { git = "https://github.com/payjoin/rust-payjoin.git", rev = "a0eca7e054e035e2b350fd96e244d6b963def343", features = [ +payjoin-ffi = { git = "https://github.com/payjoin/rust-payjoin.git", rev = "e4f5a0b384462458b3d68aeec042c20ceffb8d80", features = [ "dart", ] } diff --git a/payjoin-ffi/dart/pubspec.yaml b/payjoin-ffi/dart/pubspec.yaml index f9bc4ff63..60a512b59 100644 --- a/payjoin-ffi/dart/pubspec.yaml +++ b/payjoin-ffi/dart/pubspec.yaml @@ -1,6 +1,6 @@ name: payjoin description: Dart bindings for payjoin (EXPERIMENTAL) -version: 0.2.0 +version: 0.2.1+payjoin-1.0.0-rc.8 homepage: https://github.com/payjoin/rust-payjoin repository: https://github.com/payjoin/rust-payjoin