How to Sign a Transaction
Signing takes a TxPlanArtifact and authorizes its inputs, generating a SignedTxArtifact.
Standard Developer Signing
In developer workflows, you typically sign using deterministic accounts provisioned by hardkas init (like alice).
hardkas tx sign my-plan.json \
--account alice \
--out signed.json
What happens:
- HardKAS reads
my-plan.jsonand verifies itscontentHash. - It fetches the private key for the local
aliceaccount. - It applies Kaspa-compliant signatures to every input defined in the plan.
- It links the new
SignedTxArtifactto the plan viaparentArtifactId.
Checking the Planner Provenance
Before signing a plan in automated environments, you may want to verify how the plan was constructed using the CLI:
hardkas explain my-plan.json
Look for the Planner Authority in the explanation. If you require absolute parity with Kaspa Core node behavior, you might assert that the plan was generated by KASPA_WASM_GENERATOR rather than SYNTHETIC_SIMULATOR (if using the SDK against a real node).