Closed drhanlondon closed 1 week ago
Those are exceptionally difficult to track. Generally it is due to -
MultiSignature
would expect a leading byte indicating the type of crypto usedOverall on the node side it is difficult to "give more exact info", since it really could be anything missing or mismatching.
TL;DR Generating the signature is "easy", making sure the right data is signed is slightly more problematic
Thanks a lot for your comment.
To create unsigned shown on https://wiki.polkadot.network/docs/build-transaction-construction
const unsigned = methods.balances.transferKeepAlive(
{
dest: "15vrtLsCQFG3qRYUcaEeeEih4JwepocNJHkpsrqojqnZPc2y",
value: 5000000000,
},
{
address: "121X5bEgTZcGQx5NZjwuTjqqKoiG8B2wEAvrUFjuw24ZGZf2",
blockHash: "0x1fc7493f3c1e9ac758a183839906475f8363aafb1b1d3e910fe16fab4ae1b582",
blockNumber: 4302222,
genesisHash: "0xe3777fa922cafbff200cadeaea1a76bd7898ad5b89f7848999058b50e715f636",
metadataRpc, // must import from client RPC call state_getMetadata
nonce: 2,
specVersion: 1019,
tip: 0,
eraPeriod: 64, // number of blocks from checkpoint that transaction is valid
transactionVersion: 1,
},
{
metadataRpc,
registry, // Type registry
}
);
Instead of passing all required information above manually, I used the idea siggested on https://github.com/paritytech/txwrapper-core/blob/main/packages/txwrapper-examples/polkadot/src/polkadot.ts
export function rpcToLocalNode(
method: string,
params: any[] = []
): Promise<any> {
return fetch('http://0.0.0.0:9933', {
body: JSON.stringify({
id: 1,
jsonrpc: '2.0',
method,
params,
}),
headers: {
'Content-Type': 'application/json',
connection: 'keep-alive',
},
method: 'POST',
})
.then((response) => response.json())
.then(({ error, result }) => {
if (error) {
throw new Error(
`${error.code} ${error.message}: ${JSON.stringify(error.data)}`
);
}
return result;
});
}
Then I replaced 'http://0.0.0.0:9933' by 'https://westend-rpc.polkadot.io:443'
I would be grateful if you could advise me on whether this idea is risky or wrong.
@drhanlondon If you could please direct any txwrapper-core
questions to https://github.com/paritytech/txwrapper-core.
The polkadot wiki is seperate from polkadot-js.
Hi, @TarikGul
I see. I have created a new issue https://github.com/paritytech/txwrapper-core/issues/296
Thanks
Hello, @jacogr
Could you check my last comment on https://github.com/paritytech/txwrapper-core/issues/296, please?
I have a question about the function signatureVerify. I would be grateful if you could give me advice on why the function returned "false" value.
Thanks for your continuous help.
Hello @jacogr
I look for your advice on verification on the function signatureVerify.
I have also posted this question with additional Subkey question on StackExchange (https://substrate.stackexchange.com/questions/8441/sign-a-transaction-offline-for-westend-testnet-and-verification-of-the-transacti)
I would be very grateful if you could advise me.
Thanks.
The above via signatureVerify
is explained and solved in the following comment: https://github.com/paritytech/txwrapper-core/issues/296#issuecomment-1542174700
I think this is good to close @drhanlondon
Closing as this is solved
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.
Hello, @jacogr
Thanks for your continuous help.
I am building a custodial wallet with AWS KMS for Polkadot blockchain (with ecdsa scheme). Unfortunately AWS KMS supports only secp256k1 curve, neither sr25519 nor ed25519. This research is motivated from AWS blockchain research (https://aws.amazon.com/blogs/database/part1-use-aws-kms-to-securely-manage-ethereum-accounts/) where a private key is created and stored HSM (Hardware Security Module), a private key never leaves HSM and a transaction payload is signed offline in HSM.
I generated a signed transaction payload offline by following the instruction (https://wiki.polkadot.network/docs/build-transaction-construction) with AWS KMS, and submitted it to Westend testnet. But I got this error:
Before I submitted it, I verified a signature, which is a part of a signed transaction payload, twice with the two functions below:
The signature was successfully verified as a valid signature. I have carefully counted a nonce. I look for the reason which has caused the error above. I would be very grateful if you could advise me on what I have to check further.
Thanks