From ece5a2041c9031f0a64c5ffb0c2ac5fc7ce24727 Mon Sep 17 00:00:00 2001
From: Jun Luo <4catcode@gmail.com>
Date: Sat, 4 Jul 2026 08:32:47 +0800
Subject: [PATCH] release: 4.0.0
---
CHANGELOG.md | 29 +++++++++++++++++--
android_test/app/build.gradle.kts | 2 +-
build.gradle.kts | 2 +-
examples/build.gradle.kts | 2 +-
pom.xml | 2 +-
readme.md | 4 +--
skills/java-stellar-sdk/SKILL.md | 4 +--
.../java-stellar-sdk/references/quickstart.md | 2 +-
8 files changed, 35 insertions(+), 12 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c012b871c..7c2658e4c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,8 +2,12 @@
## Pending
+## 4.0.0
+
+This release contains everything from 4.0.0-beta0, plus the changes made since. Below is the changelog since 3.1.0.
+
### Breaking changes
-- refactor: redesign `Auth.Signer` to natively support custom account contracts (BLS, WebAuthn / secp256r1, threshold, policy contracts, ...).
+- refactor: redesign `Auth.Signer` to natively support custom account contracts (BLS, WebAuthn / secp256r1, threshold, policy contracts, ...). ([#806](https://github.com/lightsail-network/java-stellar-sdk/pull/806))
- `Auth.Signer.sign` now returns the signature `SCVal` accepted by the account contract at the credential node being signed — the default Stellar Account shape for a `G...` account, or whatever a custom account contract's `__check_auth` expects — instead of an `Auth.Signature`. The returned value is attached verbatim. This also unlocks signing a custom-contract delegate node of a `SOROBAN_CREDENTIALS_ADDRESS_WITH_DELEGATES` entry (CAP-71-01).
- `Auth.Signature` has been removed.
- Client-side ed25519 signature verification inside `authorizeEntry` is removed; the network performs the authoritative check via the account contract's `__check_auth` (a `null` return from a `Signer` is still rejected).
@@ -29,8 +33,27 @@
```
### Update
-- feat: add `useUpgradedAuth` to `SorobanServer.simulateTransaction`, mapping to the `useUpgradedAuth` flag from [Stellar RPC v27.1.0](https://github.com/stellar/stellar-rpc/releases/tag/v27.1.0) to opt simulation into recording `ADDRESS_V2` (CAP-71) auth credentials. Best-effort and transitional; older RPC servers ignore it.
-- chore: update dependencies and build tooling to the latest compatible versions (Gradle `9.6.1`, Kotlin `2.4.0`, Spotless plugin `8.7.0`, Lombok plugin `9.5.0`, NMCP plugin `1.6.0`, Gson `2.14.0`, Commons Codec `1.22.0`).
+- feat: add CAP-0071 (Protocol 27) Soroban authorization support. ([#804](https://github.com/lightsail-network/java-stellar-sdk/pull/804))
+ - New credential types (from the Protocol 27 XDR):
+ - `SOROBAN_CREDENTIALS_ADDRESS_V2` (CAP-71-02) — same fields as the legacy `ADDRESS`, but the signed payload is bound to the signer's address.
+ - `SOROBAN_CREDENTIALS_ADDRESS_WITH_DELEGATES` (CAP-71-01) — delegated / multi-party signing via a (possibly nested) tree of delegate signatures.
+ - `Auth.authorizeEntry`:
+ - Signs all three address-based credential types, selecting the signature payload from the credential type: legacy `ADDRESS` keeps the non-address-bound preimage; `ADDRESS_V2` and `ADDRESS_WITH_DELEGATES` sign the new address-bound `ENVELOPE_TYPE_SOROBAN_AUTHORIZATION_WITH_ADDRESS` preimage.
+ - Gains an optional `forAddress` parameter that writes the signature into a specific (possibly nested) delegate node. All signers of one delegated entry sign the same payload, bound to the top-level address.
+ - `Auth.authorizeInvocation`:
+ - Still builds legacy `ADDRESS` entries by default, so its output stays valid on every network regardless of protocol 27 activation.
+ - New `credentialsType` overloads opt in to `ADDRESS_V2`. The default will flip to V2 once Protocol 28 makes it mandatory.
+ - New helpers in `Auth`:
+ - `buildAuthorizationEntryPreimage` — builds the exact payload a signer must sign for a given entry.
+ - `buildWithDelegatesEntry` / `Auth.DelegateSignature` — wrap an `ADDRESS`/`ADDRESS_V2` entry together with delegate signers, sorting each delegates level by address and rejecting duplicates, as the protocol requires.
+ - `getAddressCredentials` — extracts the inner `SorobanAddressCredentials` from any address-based credential type.
+ - `AssembledTransaction`: `signAuthEntries` and `needsNonInvokerSigningBy` handle all address-based credential types.
+ - SEP-45 (`Sep45Challenge`):
+ - Challenge parsing and building accept `ADDRESS_V2` entries in addition to the legacy type; delegated entries are rejected.
+ - Challenge building fails fast on unsupported credential types instead of passing the entries through unsigned.
+- feat: add `useUpgradedAuth` to `SorobanServer.simulateTransaction`, mapping to the `useUpgradedAuth` flag from [Stellar RPC v27.1.0](https://github.com/stellar/stellar-rpc/releases/tag/v27.1.0) to opt simulation into recording `ADDRESS_V2` (CAP-71) auth credentials. Best-effort and transitional; older RPC servers ignore it. ([#807](https://github.com/lightsail-network/java-stellar-sdk/pull/807))
+- chore: upgrade generated XDR definitions to Protocol 27. ([#800](https://github.com/lightsail-network/java-stellar-sdk/pull/800))
+- chore: update dependencies and build tooling to the latest compatible versions (Gradle `9.6.1`, Kotlin `2.4.0`, Spotless plugin `8.7.0`, Lombok plugin `9.5.0`, NMCP plugin `1.6.0`, Gson `2.14.0`, Commons Codec `1.22.0`). ([#808](https://github.com/lightsail-network/java-stellar-sdk/pull/808))
## 4.0.0-beta0
diff --git a/android_test/app/build.gradle.kts b/android_test/app/build.gradle.kts
index 71ad02516..0908a5e09 100644
--- a/android_test/app/build.gradle.kts
+++ b/android_test/app/build.gradle.kts
@@ -68,7 +68,7 @@ dependencies {
implementation("androidx.compose.material3:material3")
// Since we are adding local jar(libs/stellar-sdk.jar) as dependency,
// gradle cannot automatically download the required third-party dependencies.
- implementation(files("libs/stellar-sdk-4.0.0-beta0.jar"))
+ implementation(files("libs/stellar-sdk-4.0.0.jar"))
implementation("com.squareup.okhttp3:okhttp:4.11.0")
implementation("com.squareup.okhttp3:okhttp-sse:4.11.0")
implementation("com.moandjiezana.toml:toml4j:0.7.2")
diff --git a/build.gradle.kts b/build.gradle.kts
index c92c8a2ba..06ff6090d 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -12,7 +12,7 @@ plugins {
}
group = "network.lightsail"
-version = "4.0.0-beta0"
+version = "4.0.0"
java {
toolchain {
diff --git a/examples/build.gradle.kts b/examples/build.gradle.kts
index a7c3106e8..ed403b73c 100644
--- a/examples/build.gradle.kts
+++ b/examples/build.gradle.kts
@@ -22,7 +22,7 @@ spotless {
dependencies {
// Use https://central.sonatype.com/artifact/network.lightsail/stellar-sdk in prod.
- implementation("network.lightsail:stellar-sdk:4.0.0-beta0")
+ implementation("network.lightsail:stellar-sdk:4.0.0")
testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
}
diff --git a/pom.xml b/pom.xml
index 805e700f2..cea752200 100644
--- a/pom.xml
+++ b/pom.xml
@@ -11,7 +11,7 @@
network.lightsail
stellar-sdk
- 4.0.0-beta0
+ 4.0.0
jar
stellar-sdk
diff --git a/readme.md b/readme.md
index e980a8759..e4061eb96 100644
--- a/readme.md
+++ b/readme.md
@@ -14,13 +14,13 @@ The Java Stellar SDK library provides APIs to build transactions and connect to
network.lightsail
stellar-sdk
- 3.1.0
+ 4.0.0
```
### Gradle
```groovy
-implementation 'network.lightsail:stellar-sdk:3.1.0'
+implementation 'network.lightsail:stellar-sdk:4.0.0'
```
You can find instructions on how to install this dependency using alternative package managers [here](https://central.sonatype.com/artifact/network.lightsail/stellar-sdk).
diff --git a/skills/java-stellar-sdk/SKILL.md b/skills/java-stellar-sdk/SKILL.md
index 3a9943671..ffdfe1a42 100644
--- a/skills/java-stellar-sdk/SKILL.md
+++ b/skills/java-stellar-sdk/SKILL.md
@@ -22,14 +22,14 @@ Maven:
network.lightsail
stellar-sdk
- 4.0.0-beta0
+ 4.0.0
```
Gradle:
```groovy
-implementation 'network.lightsail:stellar-sdk:4.0.0-beta0'
+implementation 'network.lightsail:stellar-sdk:4.0.0'
```
## Import style
diff --git a/skills/java-stellar-sdk/references/quickstart.md b/skills/java-stellar-sdk/references/quickstart.md
index 45c2d4ee1..8413f6a06 100644
--- a/skills/java-stellar-sdk/references/quickstart.md
+++ b/skills/java-stellar-sdk/references/quickstart.md
@@ -6,7 +6,7 @@ from the environment. See `transactions.md` for the full lifecycle.
## Install (Gradle)
```groovy
-implementation 'network.lightsail:stellar-sdk:4.0.0-beta0'
+implementation 'network.lightsail:stellar-sdk:4.0.0'
```
## Generate or load a keypair