Skip to content

Enhancement: Exclude Unicity Inclusion Proofs from Token Serialization in SplitMintReason #95

@vrogojin

Description

@vrogojin

Summary

In SplitMintReason, the source token should be serialized without Unicity inclusion proofs. This would make the minting transaction hash invariant to the inclusion proofs of all transactions of the source token.

Current Behavior

SplitMintReason.toCBOR() includes the full burned token via this.token.toCBOR(), which serializes all transactions with their inclusion proofs:

// Token.toCBOR() includes:
this._transactions.map((tx) => tx.toCBOR())

// TransferTransaction.toCBOR() includes:
this.inclusionProof.toCBOR()  // ← This should be excluded

Problem

The mint transaction hash depends on the burn transaction's inclusion proof. This prevents:

  • Creating mint commitments before receiving the burn proof
  • True "Nostr-first" token delivery (instant transfers)
  • Using placeholder proofs that can be replaced later

Proposed Solution

When serializing the token in SplitMintReason, exclude Unicity inclusion proofs from all transactions:

// SplitMintReason should serialize token WITHOUT inclusion proofs
toCBOR() {
    return CborSerializer.encodeArray(
        this.token.toCBORWithoutProofs(),  // New method - excludes inclusion proofs
        CborSerializer.encodeArray(...this._proofs.map((proof) => proof.toCBOR()))
    );
}

Rationale

  • The requestId of each transaction is already a stable, unique identifier
  • Inclusion proofs are verification data, not identity data
  • The aggregator can verify burn existence by requestId lookup
  • This aligns with the append-only nature of the aggregator tree

Benefit

Enables instant token splits where all commitments can be created before any aggregator submission, with proofs filled in later without affecting transaction hashes.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Test

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions