Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a payment model on top of tokens, including support for splitting token-embedded payment assets into multiple “child” tokens backed by Merkle proofs and a burn transaction.
Changes:
- Adds new
paymentdomain types (PaymentData,Asset,TokenSplit, split proofs/results) and related CBOR encoding/decoding hooks. - Introduces a built-in
BURNpredicate and a genericUnlockScriptinterface to support passing typed unlock scripts into certification. - Adds functional tests and updates test utilities to mint/transfer tokens with custom data payloads.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/java/org/unicitylabs/sdk/utils/TokenUtils.java | Adds overloads to mint tokens with custom data and to transfer using a prebuilt TransferTransaction. |
| src/test/java/org/unicitylabs/sdk/functional/payment/TestSplitPaymentData.java | Test-only SplitPaymentData implementation with CBOR encoding/decoding. |
| src/test/java/org/unicitylabs/sdk/functional/payment/TestPaymentData.java | Test-only PaymentData implementation with CBOR encoding/decoding. |
| src/test/java/org/unicitylabs/sdk/functional/payment/SplitBuilderTest.java | Functional test covering mint + split + burn + re-mint split tokens + verification. |
| src/main/java/org/unicitylabs/sdk/transaction/Token.java | Exposes the genesis transaction via getGenesis() for payment/split logic. |
| src/main/java/org/unicitylabs/sdk/predicate/builtin/PayToPublicKeyPredicateUnlockScript.java | Implements the new UnlockScript interface. |
| src/main/java/org/unicitylabs/sdk/predicate/builtin/PayToPublicKeyPredicate.java | Removes redundant built-in predicate boilerplate in favor of BuiltInPredicate defaults. |
| src/main/java/org/unicitylabs/sdk/predicate/builtin/BurnPredicate.java | Adds new built-in predicate type used to “burn” a token to an aggregation-root reason. |
| src/main/java/org/unicitylabs/sdk/predicate/builtin/BuiltInPredicateType.java | Adds BURN(3) to the built-in predicate type registry. |
| src/main/java/org/unicitylabs/sdk/predicate/builtin/BuiltInPredicate.java | Adds default getEngine() and encodeCode() for built-in predicates. |
| src/main/java/org/unicitylabs/sdk/predicate/UnlockScript.java | Introduces a typed unlock-script interface (encode()). |
| src/main/java/org/unicitylabs/sdk/predicate/PredicateEngine.java | Encapsulates id (now private) and exposes getId(). |
| src/main/java/org/unicitylabs/sdk/payment/asset/AssetId.java | Adds AssetId value type with CBOR + bitstring conversion. |
| src/main/java/org/unicitylabs/sdk/payment/asset/Asset.java | Adds Asset value type with CBOR encoding/decoding. |
| src/main/java/org/unicitylabs/sdk/payment/TokenSplit.java | Implements split construction and split-reason verification via Merkle proofs + burn predicate. |
| src/main/java/org/unicitylabs/sdk/payment/SplitResult.java | Holds the burn transaction plus per-split-token proofs. |
| src/main/java/org/unicitylabs/sdk/payment/SplitReasonProof.java | Proof container: aggregation-path + asset-tree-path for an AssetId. |
| src/main/java/org/unicitylabs/sdk/payment/SplitReason.java | Encodes/decodes the burn token and its proofs as a reason for a split token. |
| src/main/java/org/unicitylabs/sdk/payment/SplitPaymentDataDeserializer.java | Functional interface for decoding SplitPaymentData. |
| src/main/java/org/unicitylabs/sdk/payment/SplitPaymentData.java | Payment data interface extension including a SplitReason. |
| src/main/java/org/unicitylabs/sdk/payment/PaymentDataDeserializer.java | Functional interface for decoding PaymentData. |
| src/main/java/org/unicitylabs/sdk/payment/PaymentData.java | Base interface for payment-carrying token data. |
| src/main/java/org/unicitylabs/sdk/api/CertificationData.java | Adds overload fromTransaction(Transaction, UnlockScript) for typed unlock scripts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
MastaP
reviewed
Mar 31, 2026
Member
MastaP
left a comment
There was a problem hiding this comment.
Review of the payment/split functionality. Skipping issues already raised by Copilot (unused import, duplicate AssetId handling, line length, Asset constructor validation, leaf data verification).
MastaP
approved these changes
Apr 13, 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.
No description provided.