Skip to content
Draft
Show file tree
Hide file tree
Changes from 77 commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
60bcd0f
feat(binary-codec): add XLS-96 confidential MPT field and transaction…
kpitapeersyst Mar 17, 2026
cab9de4
chore: add XLS-96 confidential MPT definitions to unreleased changelog
kpitapeersyst Mar 17, 2026
b2f2aac
feat(xrpl): add XLS-96 confidential transfer fields to MPToken and MP…
kpitapeersyst Mar 18, 2026
e680fa9
refactor(xrpl): rename XLS-96 confidential transfer fields to match u…
kpitapeersyst Mar 20, 2026
4cb7921
fix(xrpl): align XLS-96 MPTokenIssuanceSet with rippled spec
kpitapeersyst Mar 20, 2026
0180c89
Merge branch 'xrpl/feat/dynamic-mpt-xls-94' into binary-codec/feat/co…
kpitapeersyst Mar 24, 2026
f23b97d
Merge branch 'binary-codec/feat/confidential-transfers' into xrpl/fea…
kpitapeersyst Mar 24, 2026
ea525e0
Merge branch 'xrpl/feat/confidential-transfers' into xrpl/feat/confid…
kpitapeersyst Mar 24, 2026
5f9c0ff
style: gofumpt formatting
kpitapeersyst Mar 24, 2026
571e0b1
Merge branch 'xrpl/feat/confidential-transfers' into xrpl/feat/confid…
kpitapeersyst Mar 24, 2026
d6699e3
feat(xrpl): add ConfidentialMPTClawback transaction type
kpitapeersyst Mar 24, 2026
9315cf2
feat(xrpl): add ConfidentialMPTConvert transaction type
kpitapeersyst Mar 24, 2026
5228a05
feat(xrpl): add ConfidentialMPTConvertBack transaction type
kpitapeersyst Mar 24, 2026
4d9e60a
feat(xrpl): add ConfidentialMPTMergeInbox transaction type
kpitapeersyst Mar 24, 2026
8b27c61
feat(xrpl): add ConfidentialMPTSend transaction type
kpitapeersyst Mar 24, 2026
b6a27fe
Merge branch 'xrpl/feat/dynamic-mpt-xls-94' into binary-codec/feat/co…
kpitapeersyst Mar 24, 2026
b6129a9
Merge branch 'binary-codec/feat/confidential-transfers' into xrpl/fea…
kpitapeersyst Mar 24, 2026
2f8205a
Merge branch 'xrpl/feat/confidential-transfers' into xrpl/feat/confid…
kpitapeersyst Mar 24, 2026
9fe2a21
docs: add XLS-96 confidential transfer changelog entries for xrpl pac…
kpitapeersyst Mar 24, 2026
8a5366b
Merge branch 'xrpl/feat/confidential-transfers' into xrpl/feat/confid…
kpitapeersyst Mar 24, 2026
6f550c2
docs: add XLS-96 confidential transfer transaction changelog entries
kpitapeersyst Mar 24, 2026
efa62f1
Merge branch 'xrpl/feat/confidential-transfers-transactions' into xrp…
kpitapeersyst Mar 24, 2026
692e057
docs: add XLS-96 confidential transaction types to changelog
kpitapeersyst Mar 24, 2026
04d9c19
refactor(xrpl): strengthen XLS-96 confidential tx field validation
kpitapeersyst Mar 24, 2026
ce2ac3d
refactor(xrpl): update error definitions for confidential tx validati…
kpitapeersyst Mar 24, 2026
db00219
fix(xrpl): correct ZKProof doc comment and add AuditorEncryptedAmount…
kpitapeersyst Mar 24, 2026
c29a421
style: align map value whitespace in MPTokenIssuanceSet test
kpitapeersyst Mar 25, 2026
ced1a97
Merge branch 'xrpl/feat/confidential-transfers-transactions' into xrp…
kpitapeersyst Mar 25, 2026
9667280
feat(confidential): add CGo setup with vendored mpt-crypto dependencies
kpitapeersyst Mar 25, 2026
4ca4f8d
test(confidential): use testify assertions in mptcrypto_test.go
kpitapeersyst Mar 25, 2026
df8e4ca
feat(confidential): add ElGamal encrypt/decrypt with hex-string API
kpitapeersyst Mar 25, 2026
b349d6d
docs: add ElGamal and hexutil changelog entries
kpitapeersyst Mar 25, 2026
cc50b72
refactor: remove unneeded flag setters
kpitapeersyst Mar 26, 2026
d495680
Merge branch 'confidential-transfers' into binary-codec/feat/confiden…
JordiParraCrespo Mar 26, 2026
471a346
Merge pull request #227 from XRPLF/binary-codec/feat/confidential-tra…
JordiParraCrespo Mar 26, 2026
0a5fe4e
Merge branch 'confidential-transfers' into xrpl/feat/confidential-tra…
JordiParraCrespo Mar 26, 2026
3e28b7a
Merge pull request #228 from XRPLF/xrpl/feat/confidential-transfers
JordiParraCrespo Mar 26, 2026
0cf28ba
Merge branch 'confidential-transfers' of github.com:XRPLF/xrpl-go int…
JordiParraCrespo Mar 26, 2026
5bef406
fix(xrpl): array size of matrix
JordiParraCrespo Mar 26, 2026
92529df
Merge pull request #229 from XRPLF/xrpl/feat/confidential-transfers-t…
JordiParraCrespo Mar 26, 2026
3749f99
Merge branch 'confidential-transfers' into xrpl/feat/confidential-tra…
JordiParraCrespo Mar 26, 2026
66a42a2
refactor(xrpl): remove MPTPlainAmount.UnmarshalJSON in favor of Unmar…
kpitapeersyst Mar 26, 2026
c8ea4d1
Merge pull request #230 from XRPLF/xrpl/feat/confidential-transfers-n…
JordiParraCrespo Mar 26, 2026
6e92705
feat(confidential): add commitment, proof, and context-hash CGo bindings
kpitapeersyst Mar 26, 2026
734bc82
feat(confidential): add commitment, proof, and context-hash hex-strin…
kpitapeersyst Mar 26, 2026
65ed5d6
refactor(confidential): rename package proofs -> proof
kpitapeersyst Mar 26, 2026
614d1db
Merge branch 'confidential-transfers' into confidential/feat/cgo-setup
JordiParraCrespo Mar 30, 2026
dc8b114
fix: use more restrictive cgo directive
kpitapeersyst Mar 31, 2026
33cca88
ci: use ubuntu-22.04 for mptcrypto to improve compatibility
kpitapeersyst Mar 31, 2026
425e3b8
Merge pull request #231 from XRPLF/confidential/feat/cgo-setup
JordiParraCrespo Mar 31, 2026
ebd425c
Merge branch 'confidential-transfers' into confidential/feat/elgamal-…
JordiParraCrespo Mar 31, 2026
439dff4
fix: use more restrictive cgo directive
kpitapeersyst Mar 31, 2026
466209f
refactor(confidential): rename elgamal error sentinels to cover all v…
kpitapeersyst Apr 1, 2026
d912ee0
fix(confidential): guard GetSendProofSize against negative input
kpitapeersyst Apr 1, 2026
29c5344
fix(confidential): update README and simplify zeroHex helper
kpitapeersyst Apr 1, 2026
df79a7e
Merge branch 'confidential/feat/elgamal-keypair' into confidential/fe…
kpitapeersyst Apr 1, 2026
e3806e4
refactor(confidential): rename proof error sentinels to cover all val…
kpitapeersyst Apr 1, 2026
1e1c72a
fix(confidential): validate send proof length against expected size
kpitapeersyst Apr 1, 2026
a49b9d6
refactor(confidential): rename HexParticipant and HexProofParams proo…
kpitapeersyst Apr 1, 2026
1d27dfd
fix(confidential): reject empty participants slice in proof functions
kpitapeersyst Apr 1, 2026
623632e
test(confidential): update proof tests for empty participants validation
kpitapeersyst Apr 1, 2026
d0ee46d
Merge pull request #232 from XRPLF/confidential/feat/elgamal-keypair
JordiParraCrespo Apr 2, 2026
2967ffe
Merge branch 'confidential-transfers' into confidential/feat/zkproof
JordiParraCrespo Apr 2, 2026
da53339
Merge pull request #235 from XRPLF/confidential/feat/zkproof
JordiParraCrespo Apr 2, 2026
c3326e1
feat(confidential): create tx builders
kpitapeersyst Apr 8, 2026
87adeaf
docs: add confidential transfers documentation
kpitapeersyst Apr 8, 2026
daab02a
chore(confidential): update vendored mpt-crypto to 0.3.0-rc1
github-actions[bot] Apr 17, 2026
7138c42
chore: update vendored mpt-crypto to 0.3.0-rc1
kpitapeersyst Apr 17, 2026
08da98d
refactor: mpt_utility.h cgo functions
kpitapeersyst Apr 21, 2026
6620830
refactor: align wrapper functions with mpt-crypto changes
kpitapeersyst Apr 21, 2026
088cfd2
chore: update confidential mpt README
kpitapeersyst Apr 21, 2026
4d8ac31
test: match participants order
kpitapeersyst Apr 21, 2026
a18799c
refactor: strict proof size validation and rename remainder to balance
kpitapeersyst Apr 21, 2026
937171e
fix: enforce exact ZKProof sizes in confidential MPT
kpitapeersyst Apr 21, 2026
ffd0a90
fix: reject encryption keys with tmfMPTClearCanConfidentialAmount
kpitapeersyst Apr 21, 2026
e7520a5
Merge pull request #259 from kpitapeersyst/feat/update-mptcrypto
JordiParraCrespo Apr 22, 2026
cb15e6b
Merge remote-tracking branch 'origin/main' into pr-233-confidential-t…
kpitapeersyst Jul 23, 2026
a386a3a
chore(confidential): update vendored mpt-crypto to 1.0.2 (#338)
kpitapeersyst Jul 28, 2026
d118dfc
Merge branch 'main' into confidential-transfers
kpitapeersyst Jul 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 150 additions & 0 deletions .github/workflows/update-mpt-crypto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
name: Build mpt-crypto

on:
workflow_dispatch:
inputs:
version:
description: "mpt-crypto version (leave empty for latest)"
required: false
default: ""
schedule:
- cron: "0 9 * * 1" # Every Monday at 9:00 UTC

jobs:
check:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.resolve.outputs.version }}
current: ${{ steps.resolve.outputs.current }}
needed: ${{ steps.resolve.outputs.needed }}
steps:
- uses: actions/checkout@v6

- name: Install Conan
run: |
pip install conan
conan profile detect
conan remote add --index 0 xrplf https://conan.ripplex.io

- name: Resolve version and check if update needed
id: resolve
run: |
CURRENT=$(cat confidential/deps/VERSION 2>/dev/null || echo "")
echo "current=$CURRENT" >> "$GITHUB_OUTPUT"

if [ -n "${{ inputs.version }}" ]; then
VERSION="${{ inputs.version }}"
else
VERSION=$(conan list 'mpt-crypto/*' -r xrplf 2>/dev/null \
| grep 'mpt-crypto/' \
| sed 's/.*mpt-crypto\///' \
| sort -V \
| tail -1)
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"

if [ "$CURRENT" = "$VERSION" ]; then
echo "needed=false" >> "$GITHUB_OUTPUT"
echo "Already at mpt-crypto/$VERSION — skipping build."
elif git ls-remote --exit-code --heads origin "chore/update-mpt-crypto-${VERSION}" >/dev/null 2>&1; then
echo "needed=false" >> "$GITHUB_OUTPUT"
echo "::warning::Branch 'chore/update-mpt-crypto-${VERSION}' already exists. Delete it before re-running."
else
echo "needed=true" >> "$GITHUB_OUTPUT"
echo "Update needed: $CURRENT -> $VERSION"
fi

Comment on lines +45 to +155

@semgrep-companion-app semgrep-companion-app Bot Jul 23, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Using variable interpolation ${{...}} with github context data in a run: step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. github context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with env: to store the data and use the environment variable in the run: script. Be sure to use double-quotes the environment variable, like this: "$ENVVAR".

🎉 Fixed in commit a386a3a 🎉

build:
needs: check
if: needs.check.outputs.needed == 'true'
strategy:
matrix:
include:
- os: ubuntu-22.04
platform: linux-amd64
- os: ubuntu-22.04-arm
platform: linux-arm64
- os: macos-latest
platform: darwin-arm64
- os: macos-15-intel
platform: darwin-amd64

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6

- name: Install Conan
run: |
pip install conan
conan profile detect
conan remote add --index 0 xrplf https://conan.ripplex.io

- name: Build libraries
run: |
bash confidential/deps/update.sh \
--platform ${{ matrix.platform }} \
--force \
--version ${{ needs.check.outputs.version }}

- name: Upload platform artifact
uses: actions/upload-artifact@v7
with:
name: mpt-crypto-${{ matrix.platform }}
path: confidential/deps/

pr:
needs: [check, build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Download all platform artifacts
uses: actions/download-artifact@v8
with:
path: artifacts/

- name: Merge artifacts into repo
run: |
for dir in artifacts/mpt-crypto-*/; do
platform=$(basename "$dir" | sed 's/mpt-crypto-//')
# Copy platform libs
if [ -d "$dir/libs/$platform" ]; then
mkdir -p "confidential/deps/libs/$platform"
cp "$dir/libs/$platform/"*.a "confidential/deps/libs/$platform/"
fi
done
# Headers and VERSION are the same across platforms — take from any
mkdir -p confidential/deps/include/utility
cp artifacts/mpt-crypto-linux-amd64/include/*.h confidential/deps/include/
cp artifacts/mpt-crypto-linux-amd64/include/utility/*.h confidential/deps/include/utility/
cp artifacts/mpt-crypto-linux-amd64/VERSION confidential/deps/VERSION

- name: Create PR
run: |
VERSION="${{ needs.check.outputs.version }}"
BRANCH="chore/update-mpt-crypto-${VERSION}"

git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b "$BRANCH"
git add -f confidential/deps/
git commit -m "chore(confidential): update vendored mpt-crypto to $VERSION"
git push -u origin "$BRANCH"

gh pr create \
--base "${{ github.ref_name }}" \
--title "Update vendored mpt-crypto to $VERSION" \
--body "$(cat <<EOF
Automated update of vendored mpt-crypto static libraries.

**${{ needs.check.outputs.current }} → $VERSION**

Platforms built:
- linux-amd64
- linux-arm64
- darwin-arm64
- darwin-amd64
EOF
)"
Comment on lines +365 to +394

@semgrep-companion-app semgrep-companion-app Bot Jul 23, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Using variable interpolation ${{...}} with github context data in a run: step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. github context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with env: to store the data and use the environment variable in the run: script. Be sure to use double-quotes the environment variable, like this: "$ENVVAR".

🧹 Fixed in commit a386a3a 🧹

env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ Thumbs.db
*.o
*.a

# Exception: vendored mpt-crypto static libraries
!confidential/deps/libs/**/*.a

# Debug files
debug

Expand Down
44 changes: 44 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,56 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

#### docs

- Added confidential MPT documentation covering the CGo requirement, package layout, transaction types, and high-level builders.

#### confidential

- Added CGo bindings and vendored native libraries for XRPLF `mpt-crypto`, with a `!cgo` fallback and maintainer tooling for dependency updates.
- Added hex-string APIs for ElGamal encryption, Pedersen commitments, context hashes, and zero-knowledge proof generation and verification.
- Added `test-confidential` and `update-mpt-crypto` Makefile targets and an automated dependency-update workflow.

#### confidential/builder

- Added online `Build*` and offline `Prepare*` helpers for confidential MPT send, convert, convert-back, clawback, and inbox-merge transactions.

#### pkg/hexutil

- Added `DecodeFixedHex()` to decode hexadecimal values and enforce their decoded byte length.

#### binary-codec

- Added XLS-96 confidential MPT fields and transaction definitions for `ConfidentialMPTSend`, `ConfidentialMPTConvert`, `ConfidentialMPTConvertBack`, `ConfidentialMPTMergeInbox`, and `ConfidentialMPTClawback`.

#### xrpl

- Added confidential-transfer flags and encryption-key fields to MPT issuance transaction and ledger-entry models.
- Added confidential balance fields to `MPToken`, five confidential MPT transaction models, and supporting amount, encryption-key, hex-blob, blinding-factor, and proof validation helpers.

#### xrpl/hash

- Added `MPToken()` and `MPTokenIssuance()` helpers for computing MPT ledger-entry keylet indexes.

### Changed

#### dependencies

- Raised the minimum Go version to 1.25.12 and upgraded `golang.org/x/crypto` to v0.54.0, incorporating upstream standard-library and SSH security fixes.

### Fixed

#### confidential

- Tightened participant and fixed-size proof validation before invoking the native verifier, and aligned proof helper naming with the current `mpt-crypto` contract.

#### xrpl/transaction

- Corrected confidential transaction key encoding and proof-size validation.
- Rejected `MPTokenIssuanceSet` transactions that combine encryption keys with `tmfMPTClearCanConfidentialAmount`.

## [v0.2.0]

### BREAKING CHANGES
Expand Down
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: lint test benchmark

EXCLUDED_TEST_PACKAGES = $(shell go list ./... | grep -v /faucet | grep -v /examples | grep -v /testutil | grep -v /interfaces)
EXCLUDED_COVERAGE_PACKAGES = $(shell go list ./... | grep -v /faucet | grep -v /examples | grep -v /testutil | grep -v /interfaces)
EXCLUDED_TEST_PACKAGES = $(shell go list ./... | grep -v /faucet | grep -v /examples | grep -v /testutil | grep -v /interfaces | grep -v /confidential)
EXCLUDED_COVERAGE_PACKAGES = $(shell go list ./... | grep -v /faucet | grep -v /examples | grep -v /testutil | grep -v /interfaces | grep -v /confidential)

INTEGRATION_TEST_PACKAGES = ./xrpl/transaction/integration

Expand Down Expand Up @@ -102,5 +102,17 @@ coverage-unit:

benchmark:
@echo "Running Go benchmarks..."
@$(GOTEST) -bench=. ./...
@$(GOTEST) -bench=. $(EXCLUDED_TEST_PACKAGES)
@echo "Benchmarks complete!"

################################################################################
######################### CONFIDENTIAL MPT #####################################
################################################################################

test-confidential:
@echo "Running confidential MPT tests (CGo required)..."
@CGO_ENABLED=1 go test ./confidential/... -v -timeout $(TEST_TIMEOUT)
@echo "Confidential tests complete!"

update-mpt-crypto:
@bash confidential/deps/update.sh
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ See [`examples/send-xrp/rpc`](examples/send-xrp/rpc) for a longer payment exampl
| --- | --- |
| `address-codec` | Encode and decode XRPL classic addresses and X-addresses |
| `binary-codec` | Encode and decode XRPL objects and transactions in canonical binary format |
| `confidential` | Build XLS-96 confidential MPT transactions and use CGo-backed cryptographic primitives |
| `keypairs` | Generate seeds, derive keypairs, sign payloads, and verify signatures |
| `xrpl/rpc` | Send JSON-RPC requests, autofill transactions, submit transactions, and fund Testnet or Devnet wallets |
| `xrpl/websocket` | Connect to WebSocket servers, make requests, submit transactions, and subscribe to ledger streams |
Expand All @@ -132,6 +133,7 @@ See [`examples/send-xrp/rpc`](examples/send-xrp/rpc) for a longer payment exampl
- [Use the RPC client](https://xrplf.github.io/xrpl-go/docs/xrpl/rpc)
- [Use the WebSocket client](https://xrplf.github.io/xrpl-go/docs/xrpl/websocket)
- [Build transactions](https://xrplf.github.io/xrpl-go/docs/xrpl/transaction)
- [Build confidential MPT transactions](https://xrplf.github.io/xrpl-go/docs/confidential)
- [Learn XRPL concepts and protocol rules](https://xrpl.org/docs)

## Security and audits
Expand Down
Loading