-
Notifications
You must be signed in to change notification settings - Fork 9
Separate creating, signing, transmitting transactions. #756
Comments
Hi @MoMannn. I believe this is currently possible... but let's be certain:
Construct the extrinsic const call = Balances.transfer({
value: 12345n,
dest: billy.address,
})
Sign it and collect the hex representation for later usage const signedHex = await call
.signed(signature({ sender: alexa }))
.hex()
.run()
Use that hex representation (ostensibly in another env or run) to describe the submission of the signed extrinsic. const txStatus = Rune
.constant(hex.decode(signedHex))
.into(SignedExtrinsicRune, chain)
.sent()
As for confirming, we can do this in a number of ways. One way would be to iterate over blocks within a given range and compare the extrinsic hexes. Another would be to make use of const finalizedHash = await txStatus.finalizedHash().run() Please confirm that this is what you're looking for. If not, we can certainly improve the API such that it meets your needs. Speaking of improving the API, perhaps we should have a static - const txStatus = Rune
- .constant(hex.decode(signedHex))
- .into(SignedExtrinsicRune, chain)
+ const txStatus = SignedExtrinsicRune.ofHex(signedHex, chain)
.sent() |
This looks like what I would need, just looking if things can get serialised. So if you can serialise For confirming yeah getting extrinsic then having an outside indexer is probably the way to go. |
Great! Please don't hesitate to follow up with any other questions / rough edges (as we'll want to smooth them out before 0.1.0). |
Feature Request
Not 100% sure if this isn't already possible just wanted to make sure this can be done. From what I searched there was no examples of this.
Suggestion
Developer should be able to completely separate the process of creating, signing, transmitting and confirming a transaction.
So on one side the transaction itself for a specific chain with the metadata can be constructed then serialised. Somewhere else this transaction can be parsed and signed and serialised again. Another service can handled signed transaction to push them on chain and a completely x service can then check/validate if that transaction was accepted into the chain.
Motivation
Consider a service creating 10000 transactions on chain per hour. Like an exchange or something similar.
So it's very important that the signing process occurs somewhere with very limited access in a secure manner with high validations. While the transaction construction can happen anywhere and since the signing service does not need to be aware of the chain he is signing for there is no need for metadata. After the transaction is signed you want to push it on chain. But if you are performing tons of transactions you don't want to thing one by one waiting for transactions to be accepted. But you can have a service just pushing the transactions not waiting for them to get accepted into a block since there are tons of transactions happening.
Use Cases
The text was updated successfully, but these errors were encountered: