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
Transaction hash and transaction ID are often used as semantically equivalent terms in the crypto/blockchain world. To avoid any ambiguity, we should refrain from employing the terms "hash" and "id" in a manner that result in their denotations having different meanings (different hashes/values).
Relevant Context
The value of hash(&self) is only being used in the Merkle tree.
The value of id(&self) is the actual transaction identifier being used in the explorer, wallet, to identify transactions etc. - This is the equivalent of the txID/txHash terminology on other chains.
/// The transaction ID is a unique identifier for the transaction.
/// Unlike the [`hash()`](#method.hash) method, which is computed over the
/// entire transaction, the transaction ID is derived from specific
/// fields of the transaction and serves as a unique identifier of the
/// transaction itself.
///
/// ### Returns
/// An array of 32 bytes representing the transaction ID.
pubfnid(&self) -> [u8;32]{
self.inner.hash().to_bytes()
}
Possible Solution (optional)
As hash(&self) is rarely used and is not really needed by end-users or integrators, we should introduce another name for it (potentially digest) so that the value of id(&self) can be safely referred to as TxID or TxHash.
The text was updated successfully, but these errors were encountered:
Summary
Transaction hash and transaction ID are often used as semantically equivalent terms in the crypto/blockchain world. To avoid any ambiguity, we should refrain from employing the terms "hash" and "id" in a manner that result in their denotations having different meanings (different hashes/values).
Relevant Context
hash(&self)
is only being used in the Merkle tree.id(&self)
is the actual transaction identifier being used in the explorer, wallet, to identify transactions etc. - This is the equivalent of the txID/txHash terminology on other chains.rusk/node-data/src/ledger/transaction.rs
Lines 57 to 81 in 08f95c3
Possible Solution (optional)
As
hash(&self)
is rarely used and is not really needed by end-users or integrators, we should introduce another name for it (potentiallydigest
) so that the value ofid(&self)
can be safely referred to as TxID or TxHash.The text was updated successfully, but these errors were encountered: