Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commitments-API spec implementation #156

Closed
mempirate opened this issue Jul 23, 2024 · 0 comments · Fixed by #161
Closed

Commitments-API spec implementation #156

mempirate opened this issue Jul 23, 2024 · 0 comments · Fixed by #161
Assignees
Labels
A: meta Area: meta T: chore Type: Chore
Milestone

Comments

@mempirate
Copy link
Contributor

mempirate commented Jul 23, 2024

Context

Implement the commitments-API spec as defined below in the Bolt sidecar.

Specifications

bolt_requestInclusion

Description

Requests an inclusion preconfirmation for one or more transactions. If len(txs) > 1, the array will be considered an atomic bundle.

Important

Creating the signature: the signature should come from signing the message digest. The message digest
is the following:

let message_digest = {
     let mut data = Vec::new();
     // First field is the concatenation of all the transaction hashes
     data.extend_from_slice(&transactions.map(|tx| tx.hash().as_slice()).concat());
     // Second field is the little endian encoding of the target slot
     data.extend_from_slice(&target_slot.to_le_bytes());
     keccak256(data)
};

The signature should be stored in the X-Bolt-Signature header as a hex-encoded string. It will be used for authentication purposes.

Parameters

Method Content-Type X-Bolt-Signature
POST application/json <ecdsa_signature>

Body

{
  "jsonrpc": "2.0",
  "id": "1",
  "method": "bolt_requestInclusion",
  "params": [
    {
      txs,         // Array[String], A list of hex-encoded "raw" transactions. If type 3, must include blobs.
      targetSlot  // String, a hex-encoded string of the target slot. 
    }
  ]
}
@mempirate mempirate added T: chore Type: Chore A: meta Area: meta labels Jul 23, 2024
@mempirate mempirate added this to the v0.2 milestone Jul 23, 2024
@mempirate mempirate self-assigned this Jul 23, 2024
@mempirate mempirate changed the title Commitments-API spec Commitments-API spec implementation Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: meta Area: meta T: chore Type: Chore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant