Function issuance_hash

Source
pub fn issuance_hash(a: u32) -> Option<u256>
Expand description

Return the SHA256 hash of the following:

  1. The asset issuance:
    • If the input has no issuance then two bytes 0x00 0x00.
    • If the input is has a new issuance then the byte 0x01 followed by a serialization of the calculated issued asset id (32 bytes) followed by the serialization of the (possibly confidential) issued asset amount (9 bytes or 33 bytes).
    • If the input is has a reissuance then the byte 0x01 followed by a serialization of the issued asset id (32 bytes), followed by the serialization of the (possibly confidential) issued asset amount (9 bytes or 33 bytes).
  2. The token issuance:
    • If the input has no issuance then two bytes 0x00 0x00.
    • If the input is has a new issuance then the byte 0x01 followed by a serialization of the calculated issued token id (32 bytes) followed by the serialization of the (possibly confidential) issued token amount (9 bytes or 33 bytes).
    • If the input is has a reissuance then the byte 0x01 followed by a serialization of the issued token id (32 bytes), followed by the serialization of the explicit 0 amount (i.e 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00) (9 bytes).
  3. The range proofs:
    • The SHA256 hash of the range proof of the input’s issuance asset amount (32 bytes).
    • The SHA256 hash of the range proof of the input’s issuance token amount (32 bytes).
  4. The blinding entropy:
    • If the input has no issuance then the byte 0x00.
    • If the input is has a new issuance then the byte 0x01 followed by 32 0x00 bytes and the new issuance’s contract hash field (32 bytes).
    • If the input is has reissuance then the byte 0x01 followed by a serializaiton of the reissuance’s blinding nonce field (32 bytes) and the reissuance’s entropy field (32 bytes).

Return None if the input does not exist.

§Cost

3738 mWU (milli weight units)