The validator_api.proto defines the gRPC service interface for the Bitcoin SV transaction validation service. It specifies the methods and message types for transaction validation, health checking, and block information retrieval.
Represents an empty request message. Used for endpoints that don't require input parameters.
swagger:model EmptyMessage
Provides the current block height.
swagger:model GetBlockHeightResponse
| Field | Type | Label | Description |
|---|---|---|---|
| height | uint32 | Current block height |
Provides the median time of recent blocks. Used for time-based validation rules.
swagger:model GetMedianBlockTimeResponse
| Field | Type | Label | Description |
|---|---|---|---|
| median_time | uint32 | Median time of recent blocks |
Provides health check information for the validation service.
swagger:model HealthResponse
| Field | Type | Label | Description |
|---|---|---|---|
| ok | bool | Overall health status | |
| details | string | Detailed health information | |
| timestamp | google.protobuf.Timestamp | Timestamp of health check |
Contains multiple transactions for batch validation.
swagger:model ValidateTransactionBatchRequest
| Field | Type | Label | Description |
|---|---|---|---|
| transactions | ValidateTransactionRequest | repeated | Array of transactions to validate |
Provides batch validation results for multiple transactions.
swagger:model ValidateTransactionBatchResponse
| Field | Type | Label | Description |
|---|---|---|---|
| valid | bool | Overall batch validation status | |
| errors | errors.TError | repeated | Array of error messages, one per transaction |
| metadata | bytes | repeated | Array of metadata for each transaction |
Contains data for transaction validation.
swagger:model ValidateTransactionRequest
| Field | Type | Label | Description |
|---|---|---|---|
| transaction_data | bytes | Raw transaction data to validate | |
| block_height | uint32 | Block height for validation context | |
| skip_utxo_creation | bool | optional | Skip UTXO creation for validation |
| add_tx_to_block_assembly | bool | optional | Add transaction to block assembly |
| skip_policy_checks | bool | optional | Skip policy checks |
| create_conflicting | bool | optional | Create conflicting transaction |
Provides transaction validation results.
swagger:model ValidateTransactionResponse
| Field | Type | Label | Description |
|---|---|---|---|
| valid | bool | Validation result (true if valid) | |
| txid | bytes | Transaction ID of the validated transaction | |
| reason | string | Reason for rejection if invalid | |
| metadata | bytes | Additional metadata for the transaction |
Service provides methods for transaction validation and related operations.
| Method Name | Request Type | Response Type | Description |
|---|---|---|---|
| HealthGRPC | EmptyMessage | HealthResponse | Checks the health status of the validation service. Returns detailed health information including service status and timestamp. |
| ValidateTransaction | ValidateTransactionRequest | ValidateTransactionResponse | Validates a single transaction. Performs comprehensive validation including script verification and UTXO checks. |
| ValidateTransactionBatch | ValidateTransactionBatchRequest | ValidateTransactionBatchResponse | Validates multiple transactions in a single request. Provides efficient batch processing of transactions. |
| GetBlockHeight | EmptyMessage | GetBlockHeightResponse | Retrieves the current block height. Used for validation context and protocol upgrade determination. |
| GetMedianBlockTime | EmptyMessage | GetMedianBlockTimeResponse | Retrieves the median time of recent blocks. Used for time-based validation rules. |
| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby |
|---|---|---|---|---|---|---|---|---|
| double | double | double | float | float64 | double | float | Float | |
| float | float | float | float | float32 | float | float | Float | |
| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) |
| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum |
| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| bool | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | |
| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |