RPC endpoints¶
Our RPC endpoints adhere to the JSON-RPC 2.0 specification.
- For the Strata node, the RPC server is located at:
https://fnclientbcc5fe8c4454c314eb0a00cd3882.devnet-annapurna.stratabtc.org
. - For the Strata EVM underlying the Strata node, the RPC server is located at:
https://stratareth3666f0713.devnet-annapurna.stratabtc.org/
For example, to call the strata_protocolVersion
method,
you can use curl
:
Client methods¶
The following are client methods available for end-users in any Strata full node:
RPC method | Description | Link |
---|---|---|
strata_protocolVersion |
The protocol version of the node. | strata_protocolVersion |
strata_blockTime |
Strata's block time in milliseconds. | strata_blockTime |
strata_l1connected |
Checks if the node is connected to the bitcoin network. | strata_l1connected |
strata_l1status |
Provides the status of the L1 (Bitcoin) network connection and sync state. | strata_l1status |
strata_getL1blockHash |
Retrieves the L1 (Bitcoin) block hash at a specific height. | strata_getL1blockHash |
strata_clientStatus |
Returns the current status of the Strata client. | strata_clientStatus |
strata_getRecentBlockHeaders |
Retrieves the most recent Strata block headers. | strata_getRecentBlockHeaders |
strata_getHeadersAtIdx |
Retrieves the Strata block headers starting from a specific index. | strata_getHeadersAtIdx |
strata_getHeaderById |
Retrieves a Strata block header by its ID. | strata_getHeaderById |
strata_getExecUpdateById |
Retrieves the execution update for a specific Strata block. | strata_getExecUpdateById |
strata_getCLBlockWitness |
Retrieves the client layer (CL) raw block witness data for a specific Strata block index. | strata_getCLBlockWitness |
strata_getCurrentDeposits |
Retrieves the current list of deposit IDs. | strata_getCurrentDeposits |
strata_getCurrentDepositById |
Retrieves details of a deposit by its ID. | strata_getCurrentDepositById |
strata_syncStatus |
Retrieves the current synchronization status of the Strata node. | strata_syncStatus |
strata_getRawBundles |
Retrieves raw data bundles between a range of Strata block heights. | strata_getRawBundles |
strata_getRawBundleById |
Retrieves the raw data bundle for a specific Strata block. | strata_getRawBundleById |
strata_getBridgeMsgsByScope |
Gets bridge message by scope: either "deposit" or "withdrawal" . |
strata_getBridgeMsgsByScope |
strata_submitBridgeMsg |
Submits raw bridge messages. | strata_submitBridgeMsg |
strata_getBridgeDuties |
Gets the bridge duties from a certain start index for a given operator id. | strata_getBridgeDuties |
strata_getActiveOperatorChainPubkeySet |
Gets the operators' public key table that is used to sign transactions and messages. | strata_getActiveOperatorChainPubkeySet |
strata_getCheckpointInfo |
Gets \(n\)th checkpoint info if any | strata_getCheckpointInfo |
strata_getL2BlockStatus |
Gets the L2 (Strata) block status from its height. | strata_getL2BlockStatus |
strata_getSyncEvent |
Gets the sync even by index. | strata_getSyncEvent |
strata_getLastSyncEventIdx |
Gets the index of the last written sync event. | strata_getLastSyncEventIdx |
strata_getClientUpdateOutput |
Gets the client update output produced as a result of the sync event idx given. | strata_getClientUpdateOutput |
strata_protocolVersion
¶
The protocol version of the node.
- Parameters: This method takes no parameters.
- Returns: A standalone 64-bit unsigned integer representing the protocol version.
strata_blockTime
¶
Strata's block time in milliseconds.
- Parameters: This method takes no parameters.
- Returns: A standalone 64-bit unsigned integer representing the block time in milliseconds.
strata_l1connected
¶
If the node is connected to the bitcoin network.
- Parameters: This method takes no parameters.
- Returns: A standalone Boolean variable
(
true
if connected,false
otherwise).
strata_l1status
¶
The status of the bitcoin network connection, including sync state and other relevant information.
- Parameters: This method takes no parameters.
- Returns: A JSON object containing the following fields:
bitcoin_rpc_connected
(Boolean): If the last time the node tried to poll the bitcoin client were successful.last_rpc_error
(optional string): The last error message received when trying to poll the bitcoin client, if there was one.cur_height
(64-bit unsigned integer): Current block height.cur_tip_blkid
(string): Current tip block ID as string.last_published_txid
(optional string): Last published txid where a Strata blob was presentpublished_inscription_count
(64-bit unsigned integer): number of published transactions in current runlast_update
(64-bit unsigned integer): UNIX millis time of the last time we got a new update from the L1 connector.network
(string): The underlying (bitcoin) network type, e.g."signet"
.
strata_getL1blockHash
¶
The bitcoin block hash at a certain height.
- Parameters:
"height"
: A 64-bit unsigned integer representing the block height.- Returns: A string representing the block hash,
or
null
if the block hash is unavailable.
strata_clientStatus
¶
The current status of the Strata client.
- Parameters: This method takes no parameters.
- Returns: A JSON object containing the following fields:
chain_tip
(hex-encoded string): Blockchain tip.chain_tip_slot
(64-bit unsigned integer): Bitcoin chain tip slot.finalized_blkid
(hex-encoded string): Strata block that's been finalized and proven on L1 (Bitcoin).last_l1_block
(hex-encoded string): Recent bitcoin block that might still suffer a reorg.buried_l1_height
(64-bit unsigned integer): Bitcoin block index treated as being "buried" and without possibility of being reorg'ed.
strata_getRecentBlockHeaders
¶
Retrieves the most recent Strata block headers.
- Parameters:
"count"
: A 64-bit unsigned integer representing the number of block headers to retrieve.- Returns: An array of JSON objects containing the following fields:
block_idx
(64-bit unsigned integer): The index of the block representing height.timestamp
(64-bit unsigned integer): The timestamp of when the block was created in UNIX epoch format.block_id
(hex-encoded string): Hash of the block's contents.prev_block
(hex-encoded string): Previous block.l1_segment_hash
(hex-encoded string): Bitcoin segment hash.exec_segment_hash
(hex-encoded string): Hash of the execution segment.state_root
(hex-encoded string): The root hash of the state tree.
strata_getHeadersAtIdx
¶
Retrieves the Strata block headers starting from a specific index.
- Parameters:
"index"
: A 64-bit unsigned integer representing the starting index.- Returns: An array of JSON objects containing the following fields,
or
null
if the Strata block headers at the desired index cannot be found: block_idx
(64-bit unsigned integer): The index of the block representing height.timestamp
(64-bit unsigned integer): The timestamp of when the block was created in UNIX epoch format.block_id
(hex-encoded string): Hash of the block's contents.prev_block
(hex-encoded string): Previous block.l1_segment_hash
(hex-encoded string): Bitcoin segment hash.exec_segment_hash
(hex-encoded string): Hash of the execution segment.state_root
(hex-encoded string): The root hash of the state tree.
strata_getHeaderById
¶
Retrieves a Strata block header by its ID.
- Parameters:
"block_id"
: An identifier for the Strata block as a 32-byte array.- Returns: A JSON object containing the following fields,
or
null
if the desired Strata block cannot be found: block_idx
(64-bit unsigned integer): The index of the block representing height.timestamp
(64-bit unsigned integer): The timestamp of when the block was created in UNIX epoch format.block_id
(hex-encoded string): Hash of the block's contents.prev_block
(hex-encoded string): Previous block.l1_segment_hash
(hex-encoded string): Bitcoin segment hash.exec_segment_hash
(hex-encoded string): Hash of the execution segment.state_root
(hex-encoded string): The root hash of the state tree.
strata_getExecUpdateById
¶
Retrieves the execution update for a specific Strata block.
- Parameters:
"block_id"
: An identifier for the Strata block as a 32-byte array.- Returns: A JSON object containing the following fields,
or
null
if the execution update for the desired Strata block cannot be found: update_idx
(64-bit unsigned integer): The index of the update, used to track or sequence updates.entries_root
(hex-encoded string): Merkle tree root of the contents of the EL (execution layer) payload, in the order it was "strata'ed" in the block.extra_payload
(hex-encoded string): Buffer of any other payload data.new_state
(hex-encoded string): New state root for the update.withdrawals
: Bridge withdrawals intents, which is a vector of JSON objects containing the following fields:amt
: bitcoin amount in sats.dest_pk
: destination public for the withdrawal. This is a 32-byte hex-encoded \(X\)-only public key.
da_blobs
: Bitcoin DA (data availability) blobs, which is vector of JSON objects containing the following fields:dest
(8-bit unsigned integer): destination or identifier for the blob.blob-commitment
(32-byte hex-encoded string): commitment hash for the blob.
strata_getCLBlockWitness
¶
Retrieves the client layer (CL) raw block witness data for a specific Strata block index.
- Parameters:
"index"
: A 64-bit unsigned integer representing the block index.- Returns: Raw bytes, or
null
if the block witness data for the desired Strata block cannot be found.
strata_getCurrentDeposits
¶
Retrieves the current list of deposit IDs.
- Parameters: This method takes no parameters.
- Returns: An array of 32-bit unsigned integers representing the active deposit IDs.
strata_getCurrentDepositById
¶
Retrieves details of a deposit by its ID.
- Parameters:
"deposit_id"
: A 32-bit unsigned integer representing the deposit ID.- Returns: A JSON object containing the following fields,
or
null
if the deposit cannot be found: deposit_idx
(32-bit unsigned integer): The index of the deposit, used to identify or track the deposit within the system.output
(string): The outpoint (txid:vout
) that this deposit entry references.notary_operators
(vector ofu32
): list of notary operators, by their indexes.amt
(64-bit unsigned integer): The amount of currency deposited.pending_update_txs
(vector of strings): txids for the bitcoin transactions in the maturation queue that will update the deposit entry when they mature.state
(string): The deposit state:"Created"
"Accepted"
"Dispatched"
"Executed"
strata_syncStatus
¶
Retrieves the current synchronization status of the Strata node.
- Parameters: This method takes no parameters.
- Returns: A JSON object containing the following fields:
tip_height
(64-bit unsigned integer): Current head Strata slot known to this nodetip_block_id
(32-byte array): Last Strata block chosen as the current tip.finalized_block_id
(32-byte array): Strata block that's been finalized and proven on L1 (Bitcoin).
strata_getRawBundles
¶
Retrieves raw data bundles between a range of Strata block heights.
- Parameters:
"start_height"
: A 64-bit unsigned integer representing the starting block height."end_height"
: A 64-bit unsigned integer representing the ending block height.- Returns: A hex-encoded string representing the raw data bundles for the given block height range.
strata_getRawBundleById
¶
Retrieves the raw data bundle for a specific Strata block.
- Parameters:
"block_id"
: The Strata block identifier.- Returns: A hex-encoded string representing the raw data bundle,
or
null
if the bundle is not found.
strata_getBridgeMsgsByScope
¶
Gets bridge message by scope: either "deposit"
or "withdrawal"
.
- Parameters:
"scope"
(hex-encoded string as raw bytes): the scope to get bridge messages for.- Returns: A hex-encoded in raw bytes representing the raw bridge message.
strata_submitBridgeMsg
¶
Submits raw bridge messages.
- Parameters:
"raw_msg"
(hex-encoded string as raw bytes): the bridge message.- Returns: nothing.
strata_getBridgeDuties
¶
Gets the bridge duties from a certain start index for a given operator id.
- Parameters:
"operator_idx"
(32-bit unsigned integer): the operator id."start_index"
(64-bit unsigned integer): the starting index (inclusive) from which the duties are fetched.- Returns: A JSON object containing the following fields,
or
null
if no bridge duties could be found: "payload"
: a vector of JSON objects, either"signdeposit"
s or"fulfillwithdrawal"
."start_index"
(64-bit unsigned integer): the starting index (inclusive) from which the duties are fetched."stop_index"
(64-bit unsigned integer): the last block index (inclusive) up to which the duties are fetched.
strata_getActiveOperatorChainPubkeySet
¶
Gets the operators' public key table that is used to sign transactions and messages.
- Parameters: This method takes no parameters.
- Returns: A vector of JSON objects where the keys are 32-bit unsigned integers representing the operator's id, and the values are 33-byte operator's public keys.
strata_getCheckpointInfo
¶
Gets \(n\)th checkpoint info.
- Parameters:
"idx"
: A 64-bit unsigned integer representing the checkpoint index.- Returns: A JSON object containing the following fields,
or
null
if no checkpoints could be found: "idx"
: A 64-bit unsigned integer representing the checkpoint index."l1_height"
: A 64-bit unsigned integer representing the bitcoin block height that the checkpoint covers."l2_height"
: A 64-bit unsigned integer representing the Strata block height that the checkpoint covers."l2_blockid"
: Strata block that this checkpoint covers.
strata_getL2BlockStatus
¶
Gets the Strata block status from its height.
- Parameters:
"l2_height"
: A 64-bit unsigned integer representing the Strata block height that the checkpoint covers.- Returns (string): The status of the Strata block:
"Created"
"Accepted"
"Dispatched"
"Executed"
strata_getSyncEvent
¶
Gets the sync even by index.
- Parameters: a 64-bit unsigned integer representing the sync event index.
- Returns: A JSON object being one of the following variants,
or
null
if no sync event could be found: "L1Block"
: In the case of a valid L1 (bitcoin) block."L1Revert"
: In the case of a valid L1 (bitcoin) revert."L1DABatch"
: New checkpoint posed to L1 (bitcoin) in a DA (data availability) batch."L1BlockGenesis"
: L1 (bitcoin) genesis block has reached maturity."NewTipBlock"
: Fork choice manager found a new valid chain tip block.
strata_getLastSyncEventIdx
¶
Gets the index of the last written sync event.
- Parameters: This method takes no parameters.
- Returns: A 64-bit unsigned integer representing the last written sync event index.
strata_getClientUpdateOutput
¶
Gets the client update output produced as a result of the sync event index given.
- Parameters: a 64-bit unsigned integer representing the sync event index.
- Returns: A JSON object containing the following fields,
or
null
if no bridge duties could be found: "writes"
: A vector of JSON objects, each representing one of the following actions:"Replace"
: Completely replace the full state with a new instance."ReplaceSync"
Replace the sync state."ActivateChain"
: Sets the flag that the chain is now active, kicking off the FCM to start."AcceptL2Block"
: Accept an L2 (Strata) block and its height and update tip state."RollbackL1BlocksTo"
: Rolls back L1 (bitcoin) blocks to this block height."AcceptL1Block"
: Insert L1 (bitcoin) blocks into the pending queue."UpdateBuried"
: Updates the buried block index to a higher index."CheckpointsReceived"
: Update the checkpoints."CheckpointFinalized"
: The previously confirmed checkpoint is finalized at given L1 (bitcoin) height."UpdateVerificationState"
: Updates the L1 (bitcoin) header verification state.
"actions"
: a vector of JSON objects, each representing an action to be taken by the client."UpdateTip"
: Extends the externally-facing tip to a new block ID."MarkInvalid"
: Marks an L2 (Strata) block ID as invalid and it won't follow any chain that has it, and will reject it from our peers."FinalizeBlock"
: Finalizes a block, indicating that it won't be reverted."L2Genesis"
: Indicates to the worker that it's safe to perform the L2 (Strata) genesis operations and start the chain sync work, using a particular L1 block as the genesis lock-in block."WriteCheckpoints"
: Indicates to the worker to write the checkpoints to checkpoint database."FinalizeCheckpoints"
: Indicates the worker to write the checkpoints to checkpoint database that appear in given L1 (bitcoin) height.
Sequencer methods¶
The following are client methods available for end-users in any Alpen Labs Strata sequencer node:
RPC Method | Description | Link |
---|---|---|
strata_getTxStatus |
Retrieves the status of a L1 transaction by its txid. | strata_getTxStatus |
strata_getTxStatus
¶
Retrieves the status of a L1 (Bitcoin) transaction by its txid.
- Parameters:
"txid"
: A hexadecimal string representing the 32-byte txid.- Returns: A JSON object containing one of the following fields,
or
null
if the txid cannot be found: "Unpublished"
: The transaction is waiting to be published."Published"
: The transaction is published."Confirmed"
: The transaction is included in L1 (Bitcoin) and has a certain number confirmations."Finalized"
: The transaction is finalized in L1 (Bitcoin) and has a certain number confirmations."Excluded"
: The transaction is not included in L1 (Bitcoin) and has errored with some error code.
Account abstraction¶
Strata includes support for account abstraction (AA) following the ERC-4337 standard. This approach introduces smart contract-based accounts, allowing users greater flexibility and customization in transaction validation and execution.
ERC-4337 account abstraction¶
ERC-4337 introduces a standard for creating and managing smart contract-based accounts without requiring changes to the EVM. In our implementation:
- Entrypoint Contract: We have deployed the Entrypoint contract, which acts as the main contract for processing user operations (UserOps). It verifies the validity of these operations and handles account interactions. Both versions 6 and 7 of the Entrypoint contract have been deployed.
Version | Contract Address |
---|---|
v0.6 | 0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789 |
v0.7 | 0x0000000071727De22E5E9d8BAf0edAc6f37da032 |
- Bundler: A bundler service is actively running on our infrastructure. It collects UserOps from various users, batches them into a single transaction, and submits them to the Entrypoint contract. The bundler supports the following endpoints:
- eth_sendUserOperation: Sends a UserOperation to the network.
- eth_estimateUserOperationGas: Estimates the gas needed for a UserOperation.
- eth_getUserOperationByHash: Returns a UserOperation based on the userOpHash.
- eth_getUserOperationReceipt: Retrieves the receipt for a submitted UserOperation.
- eth_supportedEntryPoints: Lists the entry points supported by the bundler.
For further details on how to interact with the bundler and its API endpoints, refer to Alchemy Bundler API Endpoints.