Struct celestia_types::blob::Commitment
source · pub struct Commitment(pub Hash);
Expand description
A merkle hash used to identify the Blob
s data.
In Celestia network, the transaction which pays for the blob’s inclusion
is separated from the data itself. The reason for that is to allow verifying
the blockchain’s state without the need to pull the actual data which got stored.
To achieve that, the MsgPayForBlobs
transaction only includes the Commitment
s
of the blobs it is paying for, not the data itself.
The algorithm of computing the Commitment
of the Blob
’s Share
s is
designed in a way to allow easy and cheap proving of the Share
s inclusion in the
block. It is computed as a merkle hash
of all the Nmt
subtree roots created from
the blob shares included in the ExtendedDataSquare
rows. Assuming the s1
and s2
are the only shares of some blob posted to the celestia, they’ll result in a single subtree
root as shown below:
NMT: row root
/ \
o subtree root
/ \ / \
_________________
EDS row: | s | s | s1 | s2 |
Using subtree roots as a base for Commitment
computation allows for much smaller
inclusion proofs than when the Share
s would be used directly, but it imposes some
constraints on how the Blob
s can be placed in the ExtendedDataSquare
. You can
read more about that in the share commitment rules
.
Tuple Fields§
§0: Hash
Implementations§
source§impl Commitment
impl Commitment
Trait Implementations§
source§impl Clone for Commitment
impl Clone for Commitment
source§fn clone(&self) -> Commitment
fn clone(&self) -> Commitment
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Commitment
impl Debug for Commitment
source§impl<'de> Deserialize<'de> for Commitment
impl<'de> Deserialize<'de> for Commitment
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
source§impl Ord for Commitment
impl Ord for Commitment
source§fn cmp(&self, other: &Commitment) -> Ordering
fn cmp(&self, other: &Commitment) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for Commitment
impl PartialEq for Commitment
source§fn eq(&self, other: &Commitment) -> bool
fn eq(&self, other: &Commitment) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for Commitment
impl PartialOrd for Commitment
source§fn partial_cmp(&self, other: &Commitment) -> Option<Ordering>
fn partial_cmp(&self, other: &Commitment) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more