DustRegistrationBuilder

Builds dust registration transactions.

A dust registration associates a NIGHT address with a DustPublicKey so that dust (transaction fee tokens) can be generated from held NIGHT tokens.

The transaction includes a guaranteed UnshieldedOffer that consolidates the user's NIGHT UTXOs (required by the node for validation).

The resulting SCALE hex is a fully signed transaction ready for proof server submission. The proof server returns a proven transaction which must then be sealed and submitted to the node.

Workflow:

DustRegistrationBuilder.build(...)
→ SCALE hex
→ ProofServerClient.prove(hex)
→ seal_proven_transaction(proven_hex)
→ NodeRpcClient.submit(sealed_hex)

See also

/midnight-ledger/ledger/src/dust.rs:651 (DustRegistration struct)

DustSpendCreator

for spending existing dust

Functions

Link copied to clipboard
fun build(nightPrivateKey: ByteArray, dustPublicKeyHex: String, utxosJson: String, ttlMillis: Long, networkId: String, currentTimeMillis: Long = System.currentTimeMillis()): String?

Builds a complete dust registration transaction.