GitHub Logo HIP-394: Add Expected Decimal Information to TokenMint, TokenBurn, and TokenWipeAccount

Author Ryan Leckey
Discussions-To https://github.com/hashgraph/hedera-improvement-proposal/discussions/393
Status Accepted
Needs Council Approval Yes
Review period ends Tue, 05 Apr 2022 07:00:00 +0000
Type Standards Track
Category Service
Created 2022-03-08
Updated 2023-01-20

Abstract

This specification proposes a way to add expected decimal information for tokens to the TokenMint, TokenBurn, and TokenWipeAccount transaction.

Motivation

The motivation for this HIP is identical to the motivation for HIP-31. These additional transactions also need the decimal information for use in a hardware wallet.

Rationale

The below change to token transfer protobuf messages is formulated to incur a minimal operational cost to the network while providing enough information to address hardware wallet security concerns.

Specification

message TokenMintTransactionBody {
    // [...]

    /**
     * If present, the number of decimals this fungible token type is expected to have. The transfer
     * will fail with UNEXPECTED_TOKEN_DECIMALS if the actual decimals differ.
     */
    UInt32Value expected_decimals = 4;
}

message TokenBurnTransactionBody {
    // [...]

    /**
     * If present, the number of decimals this fungible token type is expected to have. The transfer
     * will fail with UNEXPECTED_TOKEN_DECIMALS if the actual decimals differ.
     */
    UInt32Value expected_decimals = 4;
}

message TokenWipeAccountTransactionBody {
    // [...]

    /**
     * If present, the number of decimals this fungible token type is expected to have. The transfer
     * will fail with UNEXPECTED_TOKEN_DECIMALS if the actual decimals differ.
     */
    UInt32Value expected_decimals = 5;
}

Backwards Compatibility

It shouldn’t break existing messages, and will provide needed information for some applications going forward.

Security Implications

A Ledger hardware wallet user would be able to trust that the fractional display of a token transfer is coming from an on wire message that they are signing with their private key.

References

HIP-31: https://hips.hedera.com/hip/hip-31

Copyright/license

This document is licensed under the Apache License, Version 2.0 – see LICENSE or (https://www.apache.org/licenses/LICENSE-2.0)

Citation

Please cite this document as: