Now I implement this endpoint /construction/payloads, and I’m not sure what this field means “hex_bytes”
Hi! It is a hex-encoded string of the payload bytes. The payload bytes should be the raw bytes that is supposed to get signed by the privatekey.
So, is that what the following pseudo-code means for callers?
Signature.hex_bytes = getPrivatekey(payload.getAddress()).sign(payload.getHexBytes)
Yup! You’d probably need to do
hex.decode(payload.getHexBytes) or some equivalent decoding into bytes before signing it, but that looks right to me.
Just want to clarify here @Matt.Yue that any
Construction API implementation never has access to private keys. I believe you understand this but just want to over-communicate for other readers!
getPrivatekey(payload.getAddress()).sign(payload.getHexBytes) will be performed by the caller on their own tooling. You can see an example implementation of this signing logic in our