You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in our HAPI calls (and now in HIP-755 contract calls) there's a protobuf structure SignatureMap that's a bunch of SignaturePairs and each SignaturePair is a pubKeyPrefix and a signature. The pubKeyPrefix is described as follows:
The client may use any number of bytes from zero to the whole length of the public key for pubKeyPrefix.
Question: What's the use case where the client must (or wants) to send the public key's prefix and not the whole public key?
Answer:
You pay more for longer transactions, so it saves transaction fee costs if you use shorter prefixes.
If you’re signing a transaction for an account with only one key, then you can have an empty prefix. It’s obvious to the nodes which public key to use when checking your signature. Because there’s only one public key.
If the account has two keys, and they have the same first 3 bytes, then you can send just the first 4 bytes of each public key, and that will be enough for the nodes to know which public key goes with which signature.
If you’re writing wallet software and you aren’t sure that you’ll know which keys are on the account (or even how many there are), then you have to send the whole public key. Which will cost a little more, since your signed transaction now has more bytes.
Solution
Review and update the keys and signatures page to include the above explanation
Alternatives
No response
The text was updated successfully, but these errors were encountered:
This is also in the new(er) generated protobuf document for SignaturePair.
This copy is temporary until the current PR is merged; after that we'll need to work out a mechanism to (potentially) auto-generate these markdown files in CI (it's just a relatively simple series of protoc commands, so should not be hard).
Problem
in our HAPI calls (and now in HIP-755 contract calls) there's a protobuf structure SignatureMap that's a bunch of SignaturePairs and each SignaturePair is a pubKeyPrefix and a signature. The pubKeyPrefix is described as follows:
Question: What's the use case where the client must (or wants) to send the public key's prefix and not the whole public key?
Answer:
You pay more for longer transactions, so it saves transaction fee costs if you use shorter prefixes.
If you’re signing a transaction for an account with only one key, then you can have an empty prefix. It’s obvious to the nodes which public key to use when checking your signature. Because there’s only one public key.
If the account has two keys, and they have the same first 3 bytes, then you can send just the first 4 bytes of each public key, and that will be enough for the nodes to know which public key goes with which signature.
If you’re writing wallet software and you aren’t sure that you’ll know which keys are on the account (or even how many there are), then you have to send the whole public key. Which will cost a little more, since your signed transaction now has more bytes.
Solution
Review and update the keys and signatures page to include the above explanation
Alternatives
No response
The text was updated successfully, but these errors were encountered: