REST Resource: projects.locations.instances.keyRings.keys.transactions

Resource: Transaction

A Transaction is a request to sign a payload with a Key. It records the decision of each signer and, after signing, the final signature.

JSON representation
{
  "name": string,
  "signingMessage": string,
  "state": enum (State),
  "finalSignature": string,
  "signerDecisions": [
    {
      object (SignerDecision)
    }
  ],
  "createTime": string,
  "updateTime": string,
  "uid": string,
  "expireTime": string,
  "stateMessage": string,
  "metadata": {
    object (TransactionMetadata)
  },
  "action": string,
  "schema": enum (PayloadSchema),
  "payload": string,
  "policyEvaluationRecord": {
    object (PolicyEvaluationRecord)
  },
  "recoveryId": integer
}
Fields
name

string

Identifier. The resource name of the Transaction. Format: projects/{project}/locations/{location}/instances/{instance}/keyRings/{keyRing}/keys/{key}/transactions/{transaction}

signingMessage

string (bytes format)

Required. Immutable. The exact bytes to sign with the Key, based on the signing curve of the Key:

  • EC_SIGN_SECP256K1: the 32-byte digest of payload, computed with the hash function of the chain, such as Keccak-256 for Ethereum or BIP-143 sighash for Bitcoin.
  • EC_SIGN_ED25519: the unhashed unsigned message (1 to 4096 bytes), which must equal payload, because Ed25519 (RFC 8032) hashes the message as part of signing.

A base64-encoded string.

state

enum (State)

Output only. The lifecycle state of the Transaction.

finalSignature

string (bytes format)

Output only. The signature that the Key made. Set when the Transaction becomes SIGNING_SUCCEEDED. The encoding depends on the algorithm of the Key:

  • EC_SIGN_SECP256K1: 64 bytes, r || s, each a 32-byte big-endian integer. s is in the lower half of the curve order ("low-S"), as Bitcoin (BIP-146) and Ethereum (EIP-2) require. recoveryId holds the recovery ID.
  • EC_SIGN_ED25519: the 64-byte signature defined in RFC 8032.

The client makes chain-specific encodings, such as DER for Bitcoin or r || s || v for Ethereum.

A base64-encoded string.

signerDecisions[]

object (SignerDecision)

Output only. The decisions recorded so far, including the decision of the initiator.

createTime

string (Timestamp format)

Output only. The time at which the Transaction was created.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

updateTime

string (Timestamp format)

Output only. The time at which the Transaction was last updated.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

uid

string

Output only. The unique server-generated identifier of the Transaction.

expireTime

string (Timestamp format)

Output only. The time after which a PENDING_AUTHORIZATION Transaction moves to EXPIRED. Set at creation to the creation time plus metadata.validity, or plus 15 minutes if metadata.validity is unset.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

stateMessage

string

Output only. A human-readable explanation of the current state, such as why the Transaction is SIGNING_FAILED. Can be empty.

metadata

object (TransactionMetadata)

Optional. Immutable. Off-chain business metadata from the caller, which transaction policies evaluate.

action

string

Required. Immutable. The Cedar action that transaction policies evaluate. This is a plain string holding a Cedar entity UID of type Action, in the form Action::"<id>", for example Action::"buy_transaction" or Action::"sell_transaction". A bare ID such as buy_transaction fails with INVALID_ARGUMENT.

The caller chooses <id>. There is no fixed list of actions. Policies match it with action == Action::"<id>". If no permit policy matches, policy evaluation returns DENY with NO_PERMIT_RULE_MATCHED. For the context attributes available to policies, see https://docs.cloud.google.com/multi-party-compute/writing-rules.

schema

enum (PayloadSchema)

Required. Immutable. The wire format of payload, which selects the blockchain transaction parser for policy evaluation.

payload

string (bytes format)

Required. Immutable. The raw unsigned blockchain transaction that signingMessage comes from. The policy evaluator decodes it.

A base64-encoded string.

policyEvaluationRecord

object (PolicyEvaluationRecord)

Output only. The transaction policy evaluation record that the service made when it created the Transaction.

recoveryId

integer

Output only. The recovery ID (0 or 1) of an EC_SIGN_SECP256K1 finalSignature, for chains that need it, such as v in Ethereum. Set together with finalSignature. Unset for EC_SIGN_ED25519 Keys.

State

The lifecycle state of a Transaction.

Enums
STATE_UNSPECIFIED Not specified.
PENDING_AUTHORIZATION Waiting for enough signers to authorize the Transaction.
SIGNING Enough signers authorized the Transaction, and signing is in progress.
SIGNING_SUCCEEDED The Transaction is signed. finalSignature is set. This state is terminal.
SIGNING_FAILED Signing failed after the service used all of its retries, for example because of a crypto plane or TEE error. Not used when signers deny the Transaction or when it expires. stateMessage has details. This state is terminal.
REJECTED Transaction policy evaluation denied the Transaction at creation, or so many signers denied it that the thresholds of the Key cannot be met. Also used when transactions.create fails because signingMessage does not match the digest of payload. The service does not sign the Transaction. This state is terminal.
EXPIRED The Transaction did not get enough authorizations before expireTime. The service does not sign the Transaction. This state is terminal.

SignerDecision

A decision recorded by one signer.

JSON representation
{
  "user": string,
  "voteTime": string,
  "decision": enum (Decision),
  "authorizationInfo": {
    object (AuthorizationInfo)
  }
}
Fields
user

string

Output only. The resource name of the User that recorded the decision. Format: projects/{project}/locations/{location}/instances/{instance}/users/{user}

voteTime

string (Timestamp format)

Output only. The time at which the decision was recorded.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

decision

enum (Decision)

Output only. The decision.

authorizationInfo

object (AuthorizationInfo)

Output only. The User's signed TransactionSigningPayload for this decision. Kept for audit.

Decision

The decision of a signer on a Transaction.

Enums
DECISION_UNSPECIFIED Not specified.
AUTHORIZE The signer authorizes the service to sign the Transaction.
DENY The signer denies the Transaction.

TransactionMetadata

Off-chain business metadata that the caller supplies when it creates a transaction. The service projects it into the Cedar policy evaluation context. The service records this metadata for policy evaluation but does not verify it against the transaction payload. The service leaves unset fields out of the evaluation context, so that a policy rule that checks an unset field does not match.

JSON representation
{
  "fiatAmount": {
    object (Money)
  },
  "validity": string,
  "principalValue1": string,
  "principalValue2": string
}
Fields
fiatAmount

object (Money)

Optional. Immutable. The approximate fiat value of the transaction, projected into Cedar as context.fiat_amount. At GA, currencyCode must be USD, units must be non-negative, and nanos must be 0.

validity

string (Duration format)

Optional. Immutable. How long signers have to authorize the Transaction. The server sets Transaction.expire_time to the creation time plus this duration; this is a deadline for reaching the Key's thresholds, not an on-chain validity window. If unset, 15 minutes is used.

When set, must be a positive whole number of seconds (seconds > 0 and nanos == 0) of at most 1 hour (3600 seconds). Other values fail with INVALID_ARGUMENT.

When set, projected into Cedar as context.validity in seconds, so transaction policies can require a shorter validity. When unset, context.validity is omitted.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

principalValue1

string

Optional. Immutable. Custom caller-supplied principal attribute projected into Cedar as context.principal_value1 (maximum 256 Unicode characters).

principalValue2

string

Optional. Immutable. Custom caller-supplied principal attribute projected into Cedar as context.principal_value2 (maximum 256 Unicode characters).

Money

Represents an amount of money with its currency type.

JSON representation
{
  "currencyCode": string,
  "units": string,
  "nanos": integer
}
Fields
currencyCode

string

The three-letter currency code defined in ISO 4217.

units

string (int64 format)

The whole units of the amount. For example if currencyCode is "USD", then 1 unit is one US dollar.

nanos

integer

Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If units is positive, nanos must be positive or zero. If units is zero, nanos can be positive, zero, or negative. If units is negative, nanos must be negative or zero. For example $-1.75 is represented as units=-1 and nanos=-750,000,000.

PayloadSchema

Selects the blockchain transaction parser that decodes a raw payload.

Enums
PAYLOAD_SCHEMA_UNSPECIFIED Not specified.
ETHEREUM_TX_V2 Ethereum Transaction V2 (protocol-agnostic RLP / EIP-2718 envelope).
BITCOIN_TX_V2 Bitcoin Transaction V2 (BIP 174 PSBT v0).
SOLANA_TX_V1 Solana Transaction V1 (native SOL, SPL Token, and Token-2022 instructions).
EIP712_TYPED_DATA_V1 Offline EIP-712 structured typed data (EIP-712 v1).

PolicyEvaluationRecord

A durable, immutable record of one transaction policy evaluation (Permit or Deny). The service makes one for every evaluation and stores it, so that the UI and Cloud Audit Logs can show it.

JSON representation
{
  "decision": enum (Decision),
  "denyReason": enum (DenyReason),
  "intentDigest": string,
  "policySetVersion": string,
  "evaluationContext": {
    object
  },
  "determiningPolicyIds": [
    string
  ],
  "evaluationErrors": [
    string
  ],
  "evaluationTime": string,
  "keyListMemberships": [
    {
      object (KeyListMembership)
    }
  ]
}
Fields
decision

enum (Decision)

Output only. The outcome of the policy evaluation (PERMIT or DENY).

denyReason

enum (DenyReason)

Output only. The reason for denial when decision is DENY. Unset (DENY_REASON_UNSPECIFIED) when decision is PERMIT.

intentDigest

string

Output only. The 32-byte digest of the evaluated payload, as a lowercase 64-character hex string: the chain sighash for ETH, EIP-712 and BTC, and SHA-256(payload) for Solana.

policySetVersion

string (int64 format)

Output only. The highest activationInfo.transition_sequence or deactivationInfo.transition_sequence visible at snapshot_time. The Evaluator computes it.

evaluationContext

object (Struct format)

Output only. The projected Policy Evaluation Context (standardized Core and Optional attributes) that Cedar evaluated. The service stores it for the UI and for audit.

determiningPolicyIds[]

string

Output only. Determining Cedar policy IDs from cedar.Diagnostic.Reasons: - On PERMIT: IDs of matching permit policies. - On DENY (FORBID_RULE_MATCHED): IDs of matching forbid policies. - On DENY (POLICY_VERIFICATION_FAILED): IDs of the policies that failed verification. - On DENY (NO_PERMIT_RULE_MATCHED, UNRECOGNIZED_PAYLOAD, EVALUATION_ERROR): empty.

evaluationErrors[]

string

Output only. Runtime evaluation or parser error messages from the evaluation.

evaluationTime

string (Timestamp format)

Output only. The time at which the policy evaluation ran.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

keyListMemberships[]

object (KeyListMembership)

Output only. The KeyList memberships resolved during evaluation.

Decision

The result of the transaction policy evaluation.

Enums
DECISION_UNSPECIFIED Not specified.
PERMIT The active policy set permits the transaction.
DENY The active policy set denies the transaction.

DenyReason

Why the decision is DENY. Unset on PERMIT.

Enums
DENY_REASON_UNSPECIFIED Not specified (the value when decision is PERMIT).
FORBID_RULE_MATCHED One or more Cedar forbid rules matched. determiningPolicyIds lists them.
NO_PERMIT_RULE_MATCHED No permit rule matched, and no forbid rule or evaluation error occurred. determiningPolicyIds is empty.
UNRECOGNIZED_PAYLOAD The native transaction parser did not decode the payload.
EVALUATION_ERROR No permit rule matched, and one or more rules caused a Cedar runtime evaluation error (for example, a reference to an optional field that the transaction context does not have).
POLICY_VERIFICATION_FAILED One or more enforced policies did not carry enough valid Policy Author approvals at snapshot_time, so no policy was evaluated. determiningPolicyIds lists the policies that failed verification.

KeyListMembership

A KeyList membership check, resolved at snapshot_time. KeyLists can change, so the service stores the resolved membership on the evaluation record and does not rebuild it later.

JSON representation
{
  "keyList": string,
  "address": string,
  "isMember": boolean,
  "matchedEntry": string
}
Fields
keyList

string

Output only. The resource name of the evaluated KeyList. Format: projects/{project}/locations/{location}/instances/{instance}/keyLists/{keyList}

address

string

Output only. The blockchain address tested against the KeyList.

isMember

boolean

Output only. Whether address resolved as a member of keyList at snapshot_time.

matchedEntry

string

Output only. The entry in keyList that matched address (manual address, MPC Key resource name, or KeyRing resource name expansion). Empty when isMember is false.

Methods

create

Creates a Transaction for a Key.

get

Gets details of a single Transaction.

list

Lists Transactions for a Key, or across Keys.

recordSignerDecision

Records a signer's decision to authorize or deny a Transaction.