Skip to content

Support Return Transaction Bytes #1383

@walkerlj0

Description

@walkerlj0

Summary

We need Stablecoin Studio SDK support for a external build-only flow that returns full Hedera transaction bytes for frontend wallet/external app signing, without requiring private keys and without relying on the SDK’s multisig HTTP backend; WalletConnect/HashPack adapters are frontend interactive.

What we’re trying to build (Goal)

A Stablecoin Studio plugin for the Hedera Agent Kit
We need a backend-driven/external-driven, non-custodial transaction flow:

  1. Hedera Agent Kit (agent runtime) builds Stablecoin Studio transactions. No private key held on HAK. Produces fully-formed, frozen Hedera transaction bytes
  2. Frontend wallet (HashPack / WalletConnect) or any third-party signsAndExecutes the transaction
    This is a standard external signer pattern required for agents and headless runtimes.

Why this is required

Agents / Hedera MCP / etc must not custody end-user private keys. We need a clean build → sign&submit externally  lifecycle. This is foundational for agent-based and server-side automation use cases

Current SDK behavior (what happens today)

The smoke test uses: Network.connect(..., SupportedWallets.CLIENT, privateKey) which:

  • Mutates global SDK state
  • Signs internally for every StableCoin* call
  • Network is effectively a singleton: connect() selects a transaction adapter
  • Sets the active account
  • Locks you into a signing model up front

The core blocker

There is no supported “build-only / return transaction bytes” mode in the SDK.The only mode that returns tx bytes today: SupportedWallets.MULTISIG…but it is implemented as:

  1. Freeze tx
  2. toBytes()
  3. HTTP POST to a backend service via BackendAdapter.addTransaction(...)
  4. Later: signatures are POSTedtx is fetched backsignatures attachedtx submitted. This forces an external backend storage + HTTP roundtrip, even if the consumer just wants the bytes in-process.

Asks

We explicitly do not want: SDK-controlled backend storage
HTTP-based transaction persistence just to retrieve bytes
We want: freeze → bytes → return to caller

Why
WalletConnect / HashPack adapters don’t solve this

  • Wallet adapters are frontend, interactive by design: They require window / UI session& assume user presence
  • They follow sign-and-execute, not build-and-return
  • They do not expose:
    • unsigned tx bytes
    • a “don’t submit yet” option
    • They’re not usable from a headless BE / agent runtime.

What we think the SDK needs (recommended solution)

  1. First-class External Signer / Build-Only strategyExample names:
  • EXTERNAL_SIGNER
  • BUILD_ONLY
  • RETURN_BYTES

Capabilities:

  • no private key required
  • build + freeze transactions
  • return: Transaction.toBytes() basic metadata (tx type, description, required signers)
  • no automatic submission
  1. Proper extension point for adapters, so consumers don’t need to fork internals:
  • Network.registerTransactionAdapter(...)
  • Network.setTransactionHandler(...)
  • adapter factory injection

(Authored by @piotrswierzy)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions