From the wiki (https://wiki.polkadot.network/docs/build-transaction-construction),
import { createSignedTx } from "@substrate/txwrapper-polkadot";
// Example code, replace `signWithAlice` with actual remote signer.
// An example is given here:
// https://github.com/paritytech/txwrapper-core/blob/b213cabf50f18f0fe710817072a81596e1a53cae/packages/txwrapper-core/src/test-helpers/signWithAlice.ts
const signature = await signWithAlice(signingPayload);
console.log(signature);
const signedTx = createSignedTx(unsigned, signature, { metadataRpc, registry });
The printed signature is simply a hash string like "0x01b0e5778f36fd4c5adea875a5cd88b0da246154798fec28c5d1b4b2446d7b2028c46a423bd9706d26525706386d2dc34062bf83086db5178334d9da5016f2e684"
Question 1: I would like to know whether we could decrypt this hash string to see what informations consist of this signature. i.e whether Polkadot.js APIs supports this decryption.
From the test code (https://github.com/polkadot-js/api/blob/074e790bfc1326cda331b795b3a1e8e480493246/packages/types/src/extrinsic/v4/Extrinsic.spec.ts#L71), we can partly guess some of informations included in signature.
Question 2: From this test code, I would like to know what each data represents as you see below and where we could find how such hash strings are derived depending on the chosen cryptogrphy (ECDSA, Sr25519, or Ed25519). Particularly I look for source code for ECDSA signature.
'0x' +
'00' + // ?
'd172a74cda4c865912c32ba0a80a57ae69abae410e5ccb59dee84e2f4432db4f' + // ?
'00' + // ed25519 (00) ; sr25519 (01) ; ECDSA (02)
'eb58b10100923b73df92010db6f9363300ea3947d4c7c92ce669da93931853e8' + // ?
'a2f21c8a7c73035b3ddd8cdd47ef5db3092aad09d15e6f5ed9d32d7864821409' + // ?
'00040800' + // era
'0600' + // nonce
'00' + // tip
'd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9' + // ?
'e56c' // ?
I would be very grateful if anyone could advise me. Thanks