From 273586703026c14db1ba9381460941fc0f647811 Mon Sep 17 00:00:00 2001 From: Dmytro Kozhevin Date: Thu, 4 Sep 2025 17:18:25 -0400 Subject: [PATCH] XDR changes for CAP-71. This adds the new type of Soroban credentials and the corresponding signature payload. --- Stellar-ledger-entries.x | 3 ++- Stellar-transaction.x | 26 +++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/Stellar-ledger-entries.x b/Stellar-ledger-entries.x index b9a9a16..348311c 100644 --- a/Stellar-ledger-entries.x +++ b/Stellar-ledger-entries.x @@ -664,7 +664,8 @@ enum EnvelopeType ENVELOPE_TYPE_OP_ID = 6, ENVELOPE_TYPE_POOL_REVOKE_OP_ID = 7, ENVELOPE_TYPE_CONTRACT_ID = 8, - ENVELOPE_TYPE_SOROBAN_AUTHORIZATION = 9 + ENVELOPE_TYPE_SOROBAN_AUTHORIZATION = 9, + ENVELOPE_TYPE_SOROBAN_AUTHORIZATION_WITH_ADDRESS = 10 }; enum BucketListType diff --git a/Stellar-transaction.x b/Stellar-transaction.x index 9a14d6e..37b2353 100644 --- a/Stellar-transaction.x +++ b/Stellar-transaction.x @@ -569,10 +569,23 @@ struct SorobanAddressCredentials SCVal signature; }; +struct SorobanDelegateSignature { + SCAddress address; + SCVal signature; + SorobanDelegateSignature nestedDelegates<>; +}; + +struct SorobanAddressCredentialsWithDelegates +{ + SorobanAddressCredentials addressCredentials; + SorobanDelegateSignature delegates<>; +}; + enum SorobanCredentialsType { SOROBAN_CREDENTIALS_SOURCE_ACCOUNT = 0, - SOROBAN_CREDENTIALS_ADDRESS = 1 + SOROBAN_CREDENTIALS_ADDRESS = 1, + SOROBAN_CREDENTIALS_ADDRESS_WITH_DELEGATES = 2 }; union SorobanCredentials switch (SorobanCredentialsType type) @@ -581,6 +594,8 @@ case SOROBAN_CREDENTIALS_SOURCE_ACCOUNT: void; case SOROBAN_CREDENTIALS_ADDRESS: SorobanAddressCredentials address; + case SOROBAN_CREDENTIALS_ADDRESS_WITH_DELEGATES: + SorobanAddressCredentialsWithDelegates addressWithDelegates; }; /* Unit of authorization data for Soroban. @@ -731,6 +746,15 @@ case ENVELOPE_TYPE_SOROBAN_AUTHORIZATION: uint32 signatureExpirationLedger; SorobanAuthorizedInvocation invocation; } sorobanAuthorization; +case ENVELOPE_TYPE_SOROBAN_AUTHORIZATION_WITH_ADDRESS: + struct + { + Hash networkID; + int64 nonce; + uint32 signatureExpirationLedger; + SCAddress address; + SorobanAuthorizedInvocation invocation; + } sorobanAuthorizationWithAddress; }; enum MemoType