Grin Hex Transaction Structure?

Hi All,
Are there any step by step guide/document demonstrating how grin transactions hexadecimally modified?


As far as I know there is no document detailing the format, but you can have a look at the source code:

  • Here is defined how a transaction is written. The first 32 bytes are the offset, followed by the transaction Body
  • The body starts with 3x8 bytes for the number of inputs, outputs and kernels. Then the actual inputs, outputs and kernels are written in sequence. Note that these have to be ordered
  • Inputs are 1(features)+33(commitment)=34 bytes
  • Outputs are 1(features)+33(commitment)+675(rangeproof) = 709 bytes
  • Kernels are 1(features)+8(fee)+8(lock height)+33(excess)+64(excess signature)=114 bytes