Show / Hide Table of Contents

Class SponsorSigningHelper

Helper for sponsored transaction signing (XLS-68). A sponsored transaction carries the common fields Sponsor and SponsorFlags (spfSponsorFee = 1, spfSponsorReserve = 2) and, when the sponsorship requires it, the sponsor's co-signature: SponsorSignature (inner STObject with SigningPubKey + TxnSignature over the same preimage as the main signature).

Signing patterns (analogous to LoanSet broker/counterparty):

V1 — Automatic (both keys available):

var result = SponsorSigningHelper.SignSponsored(preparedTx, submitterWallet, sponsorWallet);
await client.SubmitRequest(result.TxBlob);

V2 — Parallel (keys on separate devices):

var sponsorSig = sponsorWallet.SignAsSponsor(preparedTx);
var submitterSig = submitterWallet.Sign(preparedTx);
var combined = SponsorSigningHelper.CombineSponsorSignatures(submitterSig.TxBlob, sponsorSig.TxBlob);

V3 — Sequential (sponsor signs first, passes to submitter):

var withSponsor = sponsorWallet.SignAsSponsor(preparedTx);
var final = SponsorSigningHelper.SubmitterSign(withSponsor.TxBlob, submitterWallet);
Inheritance
object
SponsorSigningHelper
Namespace: Xrpl.Wallet
Assembly: Xrpl.dll
Syntax
public static class SponsorSigningHelper

Methods

| Edit this page View Source

CombineSponsorSignatures(string, string)

V2 — Combine independently signed submitter and sponsor blobs. The submitter blob has TxnSignature but no SponsorSignature; the sponsor blob has SponsorSignature but no TxnSignature.

Declaration
public static SignatureResult CombineSponsorSignatures(string submitterSignedBlob, string sponsorSignedBlob)
Parameters
Type Name Description
string submitterSignedBlob
string sponsorSignedBlob
Returns
Type Description
SignatureResult
| Edit this page View Source

GetSigningPreimage(JsonObject)

Computes the signing preimage bytes for a sponsored transaction. Both the submitter and the sponsor sign the same preimage.

Declaration
public static byte[] GetSigningPreimage(JsonObject txJson)
Parameters
Type Name Description
JsonObject txJson
Returns
Type Description
byte[]
| Edit this page View Source

PrepareForSigning(ITransactionRequest, XrplWallet)

Prepares a transaction JSON for sponsored signing: verifies the Sponsor common field, sets the submitter's SigningPubKey and removes signature fields.

Declaration
public static JsonObject PrepareForSigning(ITransactionRequest transaction, XrplWallet submitterWallet)
Parameters
Type Name Description
ITransactionRequest transaction

Any transaction carrying Sponsor/SponsorFlags (autofilled).

XrplWallet submitterWallet

The submitting account's wallet (fee-payer is the sponsor per SponsorFlags).

Returns
Type Description
JsonObject
| Edit this page View Source

SignSponsored(JsonObject, XrplWallet, XrplWallet)

V1 — Automatic signing: both the submitter and the sponsor sign locally.

Declaration
public static SignatureResult SignSponsored(JsonObject preparedTx, XrplWallet submitterWallet, XrplWallet sponsorWallet)
Parameters
Type Name Description
JsonObject preparedTx
XrplWallet submitterWallet
XrplWallet sponsorWallet
Returns
Type Description
SignatureResult
| Edit this page View Source

SubmitterSign(string, XrplWallet)

V3 — The submitter signs a partially signed blob that already has SponsorSignature.

Declaration
public static SignatureResult SubmitterSign(string partiallySignedBlob, XrplWallet submitterWallet)
Parameters
Type Name Description
string partiallySignedBlob
XrplWallet submitterWallet
Returns
Type Description
SignatureResult
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX