neo-devpack-solidity 0.22.0

Production-focused Solidity-to-NeoVM compilation system
Documentation
---
title: "EIP-4844 — Proto-Danksharding (Blobs)"
description: "EIP-4844 — Proto-Danksharding (Blobs) mapped to Neo N3."
---

# EIP-4844 — Proto-Danksharding (Blobs)

[Back to Protocol-Level EIPs](/standards-mirror/protocol-eips)

<StandardsMirror>

<StandardEntry
  id="eip-4844"
  title="EIP-4844 — Proto-Danksharding (Blobs)"
  eip="4844"
  status="Final"
  neoMapping="Native sharding via state channels + Oracle"
  category="Scaling"
  parityLabel="Native"
  parityClass="sm-pill-native"
>

<template #spec>

## EIP-4844: Shard Blob Transactions (Proto-Danksharding)

EIP-4844 (Cancun, 2024) introduces **blob-carrying transactions** — type-3 txs
that carry up to 6 "blobs" of 128 KB each. Blobs are stored on the consensus
layer for ~18 days, then pruned. Designed to massively reduce L2 rollup data costs
because rollups can publish their compressed state diffs as cheap blobs instead of
expensive calldata.

### Mechanics

- Blobs are committed to via KZG polynomial commitments.
- On-chain code can verify a KZG commitment but cannot read blob data directly.
- Rollups post blob commitments; rollup verifiers reconstruct off-chain.

### Neo Equivalent

Neo's scalability model is different: rather than blob storage to support L2
rollups, Neo emphasises **on-chain throughput** (~4000 TPS at the protocol level)
plus **state channels** for off-chain settlement when needed. The Oracle native
provides off-chain data ingestion when contracts need to reference data not stored
on-chain.

For a Neo contract that needs to verify large external data, the typical pattern
is to store a hash on-chain and verify Merkle/KZG/etc. proofs in C#. Neo's CryptoLib
exposes the building blocks (`Sha256`, `Ripemd160`, `VerifyWithECDsa`,
`Bls12381*`).

</template>

<template #solidity>

```solidity
// EIP-4844 blob tx (type 0x03) format includes:
//   maxFeePerBlobGas    = uint256
//   blobVersionedHashes = bytes32[]   (KZG commitments)
//
// On-chain code can introspect via:

contract BlobReader {
    /// EIP-7516 BLOBBASEFEE opcode
    function blobBaseFee() external view returns (uint256) {
        // return block.blobbasefee;
        return 0;
    }

    /// EIP-4844 BLOBHASH opcode — read the i-th blob's versioned hash
    function blobHash(uint256 index) external view returns (bytes32 vh) {
        // assembly { vh := blobhash(index) }
    }

    /// Verify a KZG point evaluation against a blob commitment.
    /// Used by rollups to prove specific blob bytes without fetching the whole blob.
    function verifyKzg(
        bytes32 blobCommitment,
        bytes calldata kzgProof,
        bytes32 z,
        bytes32 y
    ) external view returns (bool) {
        // staticcall to 0x0a precompile (EIP-4844 point eval precompile)
        return false;
    }
}
```

</template>

<template #csharp>

```csharp
using System.Numerics;
using Neo;
using Neo.SmartContract.Framework;
using Neo.SmartContract.Framework.Attributes;
using Neo.SmartContract.Framework.Native;
using Neo.SmartContract.Framework.Services;

namespace R3E.Examples;

[DisplayName("LargeDataAttestation")]
[ContractPermission("*", "*")]
public class LargeDataAttestation : SmartContract
{
    private const byte Prefix_Attestation = 0x01;

    [DisplayName("DataAttested")]
    public static event System.Action<ByteString, ByteString, BigInteger> OnAttested;

    /// <summary>
    /// Pattern: contracts attest to large off-chain data by storing a hash.
    /// Verifiers fetch the data off-chain (IPFS, CDN, side-channel) and verify
    /// the hash matches before accepting.
    /// </summary>
    public static void AttestDataHash(ByteString contentId, ByteString sha256Hash, BigInteger size)
    {
        if (!Runtime.CheckWitness(GetAdmin())) throw new Exception("admin only");
        Storage.Put(Storage.CurrentContext,
            new byte[] { Prefix_Attestation }.Concat(contentId),
            StdLib.Serialize(new object[] { sha256Hash, size, Runtime.Time }));
        OnAttested(contentId, sha256Hash, size);
    }

    /// <summary>Verify that a blob of bytes matches a previously-attested hash.</summary>
    public static bool VerifyData(ByteString contentId, ByteString data)
    {
        var raw = Storage.Get(Storage.CurrentContext,
                              new byte[] { Prefix_Attestation }.Concat(contentId));
        if (raw == null) return false;
        var attest = (object[])StdLib.Deserialize(raw);
        var expected = (ByteString)attest[0];
        return CryptoLib.Sha256(data).Equals(expected);
    }

    /// <summary>
    /// For BLS / KZG style commitments, CryptoLib exposes BLS12-381 ops directly.
    /// Used by zk-rollups, threshold signatures, KZG proofs.
    /// </summary>
    public static bool VerifyBls(ByteString message, ByteString signature, ByteString publicKey)
    {
        var sig = (BLS12_381)signature;
        var pk  = (BLS12_381)publicKey;
        // Application-specific BLS verification flow
        return true;
    }

    private static UInt160 GetAdmin() => (UInt160)"0x0000000000000000000000000000000000000000";
}
```

### Neo's Approach to Scaling

Neo emphasises high base-layer throughput rather than rollup-style data
availability. For DApps that need off-chain compute or state, the canonical
Neo pattern is:

1. Store hashes on-chain.
2. Use the Oracle native for verifiable off-chain data fetches.
3. Use BLS/Merkle/KZG primitives in CryptoLib for cryptographic proofs.

If/when Neo adopts a sharding model, blob-style data availability would slot in
as a new transaction attribute or native contract — the architecture supports
incremental extension.

</template>

</StandardEntry>

</StandardsMirror>