gRPC Interfaces

The gRPC interfaces of Stratros.AI are compatible with EigenDA and include the following definitions:

syntax = "proto3";

package disperser;

option go_package = "github.com/Layr-Labs/eigenda/api/grpc/disperser";

message G1Commitment {
    // The X coordinate of the KZG commitment. This is the raw byte representation of the field element.
    bytes x = 1;
    // The Y coordinate of the KZG commitment. This is the raw byte representation of the field element.
    bytes y = 2;
}

// Disperser defines the public APIs for dispersing blobs.
service Disperser {
    // This API accepts a blob to disperse from clients.
    // This executes the dispersal asynchronously, i.e., it returns once the request
    // is accepted. The client can use the GetBlobStatus() API to poll the
    // processing status of the blob.
    rpc DisperseBlob (DisperseBlobRequest) returns (DisperseBlobReply) {}

    // DisperseBlobAuthenticated is similar to DisperseBlob, but it requires the
    // client to authenticate itself via the AuthenticationData message. The protocol is as follows:
    // 1. The client sends a DisperseBlobAuthenticated request with the DisperseBlobRequest message.
    // 2. The Disperser sends back a BlobAuthHeader message containing information for the client to verify and sign.
    // 3. The client verifies the BlobAuthHeader and sends back the signed BlobAuthHeader in an
    //    AuthenticationData message.
    // 4. The Disperser verifies the signature and returns a DisperseBlobReply message.
    rpc DisperseBlobAuthenticated (stream AuthenticatedRequest) returns (stream AuthenticatedReply);

    // This API is used to poll the blob status.
    rpc GetBlobStatus (BlobStatusRequest) returns (BlobStatusReply) {}

    // This retrieves the requested blob from the Disperser's backend.
    // It is more efficient than directly retrieving from the DA Nodes (see details in
    // api/proto/retriever/retriever.proto). The blob must have been initially
    // dispersed via this Disperser service for this API to work.
    rpc RetrieveBlob (RetrieveBlobRequest) returns (RetrieveBlobReply) {}
}

// Requests and Responses

message AuthenticatedRequest {
    oneof payload {
        DisperseBlobRequest disperse_request = 1;
        AuthenticationData authentication_data = 2;
    }
}

message AuthenticatedReply {
    oneof payload {
        BlobAuthHeader blob_auth_header = 1;
        DisperseBlobReply disperse_reply = 2;
    }
}

message BlobAuthHeader {
    uint32 challenge_parameter = 1;
}

message AuthenticationData {
    bytes authentication_data = 1;
}

message DisperseBlobRequest {
    bytes data = 1;
    repeated uint32 custom_quorum_numbers = 2;
    string account_id = 3;
}

message DisperseBlobReply {
    BlobStatus result = 1;
    bytes request_id = 2;
}

message BlobStatusRequest {
    bytes request_id = 1;
}

message BlobStatusReply {
    BlobStatus status = 1;
    BlobInfo info = 2;
}

message RetrieveBlobRequest {
    bytes batch_header_hash = 1;
    uint32 blob_index = 2;
}

message RetrieveBlobReply {
    bytes data = 1;
}

// Data Types

enum BlobStatus {
    UNKNOWN = 0;
    PROCESSING = 1;
    CONFIRMED = 2;
    FAILED = 3;
    FINALIZED = 4;
    INSUFFICIENT_SIGNATURES = 5;
}

message BlobInfo {
    BlobHeader blob_header = 1;
    BlobVerificationProof blob_verification_proof = 2;
}

message BlobHeader {
    G1Commitment commitment = 1;
    uint32 data_length = 2;
    repeated BlobQuorumParam blob_quorum_params = 3;
}

message BlobQuorumParam {
    uint32 quorum_number = 1;
    uint32 adversary_threshold_percentage = 2;
    uint32 confirmation_threshold_percentage = 3;
    uint32 chunk_length = 4;
}

message BlobVerificationProof {
    uint32 batch_id = 1;
    uint32 blob_index = 2;
    BatchMetadata batch_metadata = 3;
    bytes inclusion_proof = 4;
    bytes quorum_indexes = 5;
}

message BatchMetadata {
    BatchHeader batch_header = 1;
    bytes signatory_record_hash = 2;
    bytes fee = 3;
    uint32 confirmation_block_number = 4;
    bytes batch_header_hash = 5;
}

message BatchHeader {
    bytes batch_root = 1;
    bytes quorum_numbers = 2;
    bytes quorum_signed_percentages = 3;
    uint32 reference_block_number = 4;
}

Last updated