Struct celestia_types::blob::Commitment
source · pub struct Commitment(pub Hash);Expand description
A merkle hash used to identify the Blobs 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 Commitments
of the blobs it is paying for, not the data itself.
The algorithm of computing the Commitment of the Blob’s Shares is
designed in a way to allow easy and cheap proving of the Shares 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 Shares would be used directly, but it imposes some
constraints on how the Blobs can be placed in the ExtendedDataSquare. You can
read more about that in the share commitment rules.
Tuple Fields§
§0: HashImplementations§
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§impl PartialOrd for Commitment
impl PartialOrd for Commitment
source§impl Serialize for Commitment
impl Serialize for Commitment
impl Copy for Commitment
impl Eq for Commitment
impl StructuralPartialEq for Commitment
Auto Trait Implementations§
impl Freeze for Commitment
impl RefUnwindSafe for Commitment
impl Send for Commitment
impl Sync for Commitment
impl Unpin for Commitment
impl UnwindSafe for Commitment
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)