Skip to content

0.8.1: real signed v4 extrinsic in handleCreateTransaction - #22

Merged
mordamax merged 2 commits into
mainfrom
mak/0.8.1
May 14, 2026
Merged

0.8.1: real signed v4 extrinsic in handleCreateTransaction#22
mordamax merged 2 commits into
mainfrom
mak/0.8.1

Conversation

@mordamax

@mordamax mordamax commented May 14, 2026

Copy link
Copy Markdown
Collaborator

host-api-test-sdk 0.8.1

Bumps @novasamatech/* to 0.7.9-4 and fixes handleCreateTransaction to return a real signed v4 extrinsic. In 0.8.0 it echoed params.callData back — fine for result.ok === true checks, broken the moment a product tried to submit the bytes.

What changed

  • handleCreateTransaction / handleCreateTransactionWithLegacyAccount — the request is now a flat object (signer, genesisHash, callData, extensions, txExtVersion); no more tuple wrapping, no context block, all fields are Uint8Array. Exports VersionedPublicTxPayload / TxPayloadV1Public are gone — use ProductAccountTransaction / LegacyTransaction.
  • The handler now signs callData || extras || additionalSigned sr25519 and returns a v4 signed-extrinsic frame: [0x84][MultiAddress::Id + AccountId32][Sr25519 + sig][extras][callData]. v5 is not emitted yet (paseo-asset-hub-next runs extrinsic.version: [4] only).
  • Upstream also removed the attestation service and simplified SSO; @novasamatech/product-sdk is being renamed to @novasamatech/host-api-wrapper (0.7.9-5+ is under the new name; we stay on product-sdk@0.7.9-4 for this release).

What you need to do

  • Upgrade to 0.8.1. No product-side code change required — the wrapper API didn't move.
  • If you constructed createTransaction requests by hand, switch to the flat ProductAccountTransaction shape and include genesisHash.
  • If your tests asserted on the bytes being equal to callData, drop that assumption and decode the response as a v4 extrinsic instead.
  • If your runtime negotiates v5 general extrinsics, file an issue — v5 support is a follow-up.

0.8.0 is deprecated on npm; upgrade.


In 0.8.0 the handler echoed back params.callData, which fails any test
that submits the bytes (polkadot-api's extrinsic codec rejects them
because callData[0] is the pallet index, not a v4/v5 prefix).

Resolve the keypair from params.signer (product flow → derive from
configured root account; legacy flow → match raw 32B pubkey), sign
callData || extras || additionalSigned with sr25519 (blake2_256 first
when payload > 256B per Substrate convention), and frame as v4 signed:
[0x84][0x00 + AccountId32][0x01 + sig][extras][callData].

paseo-asset-hub-next advertises extrinsic.version: [4] only, so v5
general support is deferred until a target runtime negotiates it.

Integration test #45 now decodes the returned bytes, asserts the v4
frame, and runs sr25519Verify against the embedded pubkey — would have
caught the 0.8.0 stub.

0.8.0 should be deprecated on npm after merge.
@mordamax
mordamax requested a review from johnthecat May 14, 2026 20:45
@mordamax
mordamax merged commit 8bb98ce into main May 14, 2026
5 checks passed
@mordamax mordamax self-assigned this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant