syntax = "proto3";
package structs;
import "execution.proto";
// TODO: Schema version hash
enum SignatureType {
ECDSA = 0;
EcdsaBitcoinSignMessageHardware = 1;
}
message Signature {
BytesData bytes = 1;
SignatureType signature_type = 2;
}
enum PublicKeyType {
secp256k1 = 0;
}
message PublicKey {
BytesData bytes = 1;
PublicKeyType key_type = 2;
}
// TODO: BytesData for signature?
// Multiple public key types
// TODO: Move the 'repeated' into this so that we encompass multi-sig proofs inside a single class
message Proof {
Signature signature = 1;
PublicKey public_key = 2;
}
// TODO: refactor
message PoWProof {
uint32 proof_type = 1;
bytes proof = 2;
}
message ProductId {
Hash network = 1;
Hash product = 2;
}
// TODO: We need to handle case where UtxoId is missing, a floating dependency or input based on code execution.
// TODO: Should we unify transaction hash / output_index into UtxoId?
// TODO: Support other output extraction operations, a function that processes a transaction and results ?
message FixedUtxoId {
// // The hash associated with a parent / ancestor transaction which has already been accepted as valid.
Hash transaction_hash = 1;
// // The index of the output in the parent transaction which is being spent.
int64 output_index = 2;
}
message AddressSelector {
Address address = 1;
// Some type of query predicate here -- or a bool such that the input's output marks this contract address
optional bool requires_output_contract_predicate_match = 2;
}
message FloatingUtxoId {
AddressSelector address_selector = 1;
}
message OutputIndex {
int64 output_index = 1;
}
message Input {
FixedUtxoId utxo_id = 1;
// The signed proof that this input is a valid reference to the previous output.
repeated Proof proof = 3;
// The identifier associated with the currency or product being used, for multi-currency support.
ProductId product_id = 4;
// Hydration purposes only! Not used for hashes
Output output = 5;
FloatingUtxoId floating_utxo_id = 6;
}
message TrustData {
// A score from -1 to 1 normalized to 1e3 (1000) scale for Equality avoidance of floats
// Otherwise equivalent to a rounded float
int64 label = 2;
// Confidence level associated with the label, how certain is this value?
optional int64 confidence = 3;
// Variance associated with the confidence estimate, sigma / stddev
optional int64 hardness = 5;
// Additional unstructured or otherwise custom label data
optional StandardData data = 6;
}
message TrustLabel {
// TODO: Should this be bytesData?
bytes peer_id = 1;
repeated TrustData trust_data = 2;
}
message PartitionInfo {
// Times 1000
// TODO: Change to UtxoDistance
// so we can preserve PartialEq and convert explicitly
optional int64 utxo_distance = 1;
optional int64 contract_address = 2;
}
// This also needs a proof maybe?
message NodeMetadata {
// Primary address used to reference the node, can be anything that is parsable.
string external_address = 1;
// May not be to store public key if we merkle the multi_hashes too.
PublicKey public_key = 3;
MerkleProof proof = 4;
optional NodeType node_type = 5;
optional VersionInfo version_info = 6;
optional PartitionInfo partition_info = 7;
optional int64 port_offset = 8;
optional string alias = 9;
optional string name = 10;
PeerId peer_id = 11;
optional bool nat_restricted = 12;
NetworkEnvironment network_environment = 13;
// Exact IPv4 address
optional string external_ipv4 = 14;
// Exact IPv6 address
optional string external_ipv6 = 15;
// CNAME like reference i.e. node.example.com
optional string external_host = 16;
}
/**
Used to store the version of the executable and the commit hash of the source code used to build it.
Security verifications associated with the node software should be done with this message.
*/
message VersionInfo {
// The value associated with the Sha2-256 hash of the executable calculated with shasum locally
// Should match github release page.
string executable_checksum = 1;
// This is only really useful in the security scenario where the node is building from source
// Otherwise, even if filled with a value from git, it's not really verified
optional string commit_hash = 2;
// Same as prior hash except the intended upgrade hash of a node, not yet used.
optional string next_executable_checksum = 3;
// Intended time for performing a software update, for coordination of upgrades (not yet used.)
optional int64 next_upgrade_time = 4;
}
message PeerId {
PublicKey peer_id = 1;
repeated Proof known_proof = 3;
}
message PeerData {
optional PeerId peer_id = 1;
optional MerkleProof merkle_proof = 2;
// This proof should be removed in favor of the one
// on the transaction itself
optional Proof proof = 3;
repeated NodeMetadata node_metadata = 4;
// Rename as RatingLabel
// Also we need to store model outputs on NMD dynamic?
repeated TrustLabel labels = 5;
optional VersionInfo version_info = 6;
}
//// should i use kv pairs here to capture other features?
//// or a typedValue or something?
//message StoredPeerData {
// PeerData peer_data = 1;
// uint64 time = 2;
// optional TrustLabel secret_label = 3;
// optional double deterministic_trust = 4;
// optional double trust_score = 5;
// optional StandardData data = 6;
//}
enum BytesDecoder {
STANDARD = 0;
}
message BytesData {
bytes value = 1;
BytesDecoder decoder = 2;
int64 version = 3;
}
enum HashFormatType {
Sha3_256 = 0;
}
message Hash {
BytesData bytes = 1;
HashFormatType hash_format_type = 2;
HashType hash_type = 3;
}
message DynamicNodeMetadata {
optional int64 udp_port = 1;
Proof proof = 2;
PeerId peer_id = 3;
int64 height = 4;
}
message StandardRequest {
StateSelector selector = 1;
}
// Where to store parquet schema, avro schema, etc. etc.
// Generic data structure designed to hold arbitrary data in a common format.
// This should be considered supplementary to using a regular schema, not a
// complete substitute.
message StandardData {
// Standard currency style field
optional int64 amount = 1;
// Move to separate class instance still stored here?
// Direct data storage for small values
optional TypedValue typed_value = 2;
repeated TypedValue typed_value_list = 3;
optional KeyedTypedValue keyed_typed_value = 4;
repeated KeyedTypedValue keyed_typed_value_list = 5;
optional MatrixTypedValue matrix_typed_value = 6;
repeated MatrixTypedValue matrix_typed_value_list = 7;
// TODO: ResolvableDataReference fields for larger amounts of data
// matrix typed value
// Peer metadata field
optional PeerData peer_data = 8;
optional NodeMetadata node_metadata = 9;
optional DynamicNodeMetadata dynamic_node_metadata = 10;
optional int64 height = 11;
Hash data_hash = 12;
Hash hash = 13;
Observation observation = 14;
optional string bitcoin_address = 15;
optional string bitcoin_txid = 16;
BytesData state = 17;
BytesData request = 18;
StandardRequest standard_request = 19;
}
message KeyedTypedValue {
TypedValue key = 1;
TypedValue value = 2;
}
message MatrixTypedValue {
TypedValue key_i = 1;
TypedValue key_j = 2;
TypedValue value = 3;
}
message TypedValue {
// amount
optional BytesData bytes_value = 2;
optional string string_value = 3;
optional uint64 uint64_value = 1;
optional int64 int64_value = 5;
// Used to avoid Eq comparison problem in rust for strings encoded from floats.
optional string float_value = 7;
optional string double_value = 4;
optional bool bool_value = 6;
// TODO: consider adding the rest of the proto types?
}
enum StandardContractType {
CURRENCY = 0;
DEPOSIT = 1;
SWAP = 2;
}
message KeyValueOption {
string key = 1;
string value = 2;
}
enum ExecutorBackend {
Extism = 0;
Evm = 1;
}
message CodeExecutionContract {
Address address = 1;
BytesData code = 2;
optional ExecutorBackend executor = 3;
}
message OutputContract {
// hash references, same issue as other thing
optional StandardContractType standard_contract_type = 1;
CodeExecutionContract code_execution_contract = 2;
optional int64 threshold = 3;
repeated int64 weights = 4;
// What was this for? Are we ever gonna send to an address filter predicate that is different from the output address?
// Address filter_predicate_destination = 5;
bool pay_update_descendents = 6;
}
enum OutputType {
Fee = 0;
Deploy = 1;
RequestCall = 2;
}
message Output {
// Basic unlock condition for using this as a consumable input. Script hash or hash of a public key.
Address address = 1;
ProductId product_id = 5;
repeated Proof counter_party_proofs = 6;
// change to outputData?
StandardData data = 7;
OutputContract contract = 8;
optional OutputType output_type = 9;
// Used for specifying UTXO contract reference as well as address.
FixedUtxoId utxo_id = 10;
}
// monthly / daily / window size + window center
message TimeLockWindow {
uint64 delay = 1;
uint64 offset = 2;
uint64 window_size = 3;
}
message TransactionAmount {
int64 amount = 1;
}
message TransactionData {
optional string message = 1;
optional uint64 time = 2;
optional StandardData standard_data = 3;
}
message TransactionContract {
// input gets signed with a proof;
// output gets signed with a counter-party proof;
// transaction then
// should this confirmation thing be on the output or the transaction??? Transaction
optional bool confirmation_= 1;
repeated Proof confirmation_proofs = 2;
// How long the network / each node must wait between PENDING and finalization
optional uint64 finalize_window = 3;
// How long the network must wait after FINALIZED to use.
optional uint64 lock_period = 4;
// Used to allow network criteria to vote on reversing in event of hacking.
optional bool network_reversible = 5;
optional TimeLockWindow time_lock_window = 6;
repeated KeyValueOption options = 7;
// Used only for anti-spam limiting at low limits.
optional PoWProof pow_proof = 8;
}
enum NetworkEnvironment {
// Production release, using real data and currency
MAIN = 0;
// Pre-production release, used for integration testing with release version before updating main net
TEST = 1;
// Latest dev branch code, continuously updated from latest build, unstable and non-release version
DEV = 2;
// Latest staging branch code, continuously updated but considered stable, upon verification is rolled to test net
STAGING = 3;
// Performance testing network, used for debugging performance issues and not tied to a particular version or stage
// Can be manually set as for debugging, generally paired with staging code.
PERF = 4;
// Manually deployed network over arbitrary machines
INTEGRATION = 5;
// Designation for an entire network running as local processes not connecting to external services
LOCAL = 6;
// Designation for an entire network running within a single process. Either with mock-ups or other testing
// harnesses -- generally used for debugging within an IDE,
DEBUG = 7;
// Operations which can potentially span all networks, like a host manager or infrastructure configuration.
ALL = 8;
// Testing branch before dev, force push commits here for manual debugging, one user at a time.
PREDEV = 9;
}
message Salt {
int64 value = 1;
}
// For use in providing a secondary, recent, submission time for offline signing process with delayed broadcast.
message OfflineTimeSponsor {
int64 time = 1;
Proof proof = 2;
}
message TransactionOptions {
optional int64 salt = 1;
optional NetworkEnvironment network_type = 2;
repeated KeyValueOption key_value_options = 3;
TransactionData data = 4;
TransactionContract contract = 5;
OfflineTimeSponsor offline_time_sponsor = 6;
}
message Transaction {
repeated Input inputs = 1;
repeated Output outputs = 2;
StructMetadata struct_metadata = 3;
TransactionOptions options = 4;
}
message BlockMetadata {
}
// Information about the data type itself, such as time produced and hash representations of it
message StructMetadata {
// If present, represents some time related information that should be signed, typically transaction origination time
optional int64 time = 1;
// The version of the object, used for backwards / forward compatability and to determine which fields are present
int32 version = 2;
// The hash of the present object data, including all relevant fields, but excluding any enriched / hydrated data fields
// This can be any one of the below hash values, and reflects the current state of the object.
Hash hash = 3;
// The hash of the object data, excluding any witness information, object should be cleared of other fields
// or hydration related fields before signing.
// This is equivalent to the SegWit hash.
Hash signable_hash = 5;
// The hash of the object after being signed once, this is the hash that includes the witness data / signature data.
// This is equivalent to the hash of a transaction containing witness data ala standard ETH transaction.
Hash signed_hash = 6;
// The hash of the object after being signed twice, includes witness data from a counter-signature from an
// accepting party. Used for transaction contracts that require counter party acceptance
Hash counter_party_hash = 7;
// The hash of the object after being signed three times, includes witness data from original signer,
// counter-signer accepting party, and a final signature from the original of the counter party hashed object.
Hash confirmation_hash = 8;
}
message AddressBlock {
bytes address = 1;
int64 balance = 2;
int64 height = 3;
bytes hash = 4;
}
message Block {
Hash merkle_root = 1;
// These are dropped for the hash calculation as the merkle root is present.
repeated Transaction transactions = 2;
StructMetadata struct_metadata = 3;
Hash previous_block_hash = 4;
optional BlockMetadata metadata = 5;
// This is dropped for hash calculation as it represents the calculation after the fact,
// Only stored for ease of preventing excess recalculations.
Hash hash = 6;
// Not really needed for hash calc, but harmless to include
int64 height = 7;
}
enum State {
PENDING = 0;
// TODO: Change to accepted
FINALIZED = 1;
// Does this belong here?
REJECTED = 2;
}
enum HashType {
TRANSACTION = 0;
OBSERVATION_METADATA = 1;
OBSERVATION_MERKLE_ROOT = 2;
TOMBSTONE = 3;
ADDRESS = 4;
UNKNOWN = 5;
}
message Tombstone {
bytes hash = 1;
// TODO: Other fields for the reason 'why'
}
message ObservationData {
Transaction transaction = 1;
Observation observation = 2;
}
enum ValidationType {
// Perfect validation with all resolved dependencies
FULL = 0;
PARTIAL = 1;
}
// Metadata associated with some node observing and validating data associated with some hash
message ObservationMetadata {
// The data under consideration which has had some validation performed for it.
Hash observed_hash = 1;
// Whether or not we have fully resolved all prior dependencies associated with the data internally
ValidationType observation_type = 2;
// How much we have accepted this data, whether or not sufficient time has passed to consider it confirmed
optional State state = 3;
// The degree of certainty associated with our validation, based on trustworthiness of information received from
// other peers
TrustData validation_confidence = 4;
// Information about this object itself, such as time produced and hash representations of it
StructMetadata struct_metadata = 5;
}
// TODO: Salt? Peer identifier? Etc
message Observation {
// Merkle root of observations
Hash merkle_root = 1;
// Individual metadata of observations
repeated ObservationMetadata observations = 2;
// Signature associated with node key
Proof proof = 3;
StructMetadata struct_metadata = 4;
// TODO: These can be removed after unifying to transaction ?
int64 salt = 6;
int64 height = 7;
// Hash of the preceding observation reference
Hash parent_hash = 8;
}
// Derived data structure, not a primary chain data structure
message ObservationEdge {
ObservationProof observation_proof = 1;
int64 time = 2;
}
// TODO: Update types here
// Derived data structure, not a primary chain data structure
message UtxoEntry {
// Changed this to FixedUtxoId, maybe rename FixedUtxoId just to UtxoId?
Hash transaction_hash = 1;
// TODO: Change to OutputIndex
int64 output_index = 2;
// This is duplicated, but used for indexing.
Address address = 3;
Output output = 4;
int64 time = 5;
// Consider adding additional fields to index here? amount? etc. for now just de-ser
}
//}
// should we add longer confirmation windows to transactions for fee?
// let's just assume the deposit addresses are well known?
// assume addresses are well known enough -- but network still needs to confirm that address is usable. ?? or does it
// or should we issue a unique deposit address per input?
// should we even have a deposit request??
// Should we just move this out of the schema entirely and use it as rest api call ? or leave it?
// Should a deposit just be a regular transaction?
// This type doesn't have a double spending issue, only requires single finalization.
// DepositRequest does not need to be observed. It only needs to be signed.
// how the hell do we collect the fee?
// just collect a fee from a redgold input to deposit.
//message DepositMulti {
// repeated DepositInput inputs = 1;
// repeated DepositOutput outputs = 2;
// optional uint32 version = 6;
// optional PoWProof anti_spam_proof = 7;
// optional uint64 request_ttl_seconds = 8; // default 1 day
//}
// Let's assume deposit has already happened and this is the 'claim' of it.
// Deposit address is currently just requested from active nodes.
// They must agree on the main deposit address, and maintain old ones periodically.
// Deposit should be rejected if not confirmed -- but it can later be re-attempted.
// Once a deposit has been claimed it's 'used' in same way UTXO's are.
// How do we map from a deposit to an amount??
// screw it just use transaction?
//
//message Deposit {
// bytes source_address = 1;
// uint32 network = 2;
// bytes destination_address = 3;
// repeated Proof source_proof = 4;
// OperationMetadata metadata = 5;
//}
// when the deposit is finalized, how do we determine the actual amount?
//
//message Deposit {
// bytes deposit_request_hash = 1;
// Proof control_proof = 2;
// optional uint32 version = 3;
//}
// maybe a deposit should just be to a wrapped coin?
// that adds tons of complication..
// actually, wrapped bitcoin is fine, that's easily composible actually? maybe
// TODO: unify types here
message EagerFullGossipPush {
repeated Transaction transactions = 1;
repeated Observation observations = 2;
repeated ObservationEdge observation_edges = 3;
repeated PeerData peer_data = 7;
}
// These should both be broadcasts at some point
// Consider using a response here if needed.
message GossipTransactionRequest {
Transaction transaction = 1;
}
message GossipObservationRequest {
Observation observation = 1;
}
message ResolveHashRequest {
Hash hash = 1;
optional int64 output_index = 2;
}
// Add request id's here??
message ResolveHashResponse {
TransactionInfo transaction_info = 1;
AddressInfo address_info = 2;
Observation observation = 3;
PeerData peer_data = 4;
}
enum DownloadDataType {
UTXO_ENTRY = 0;
TRANSACTION_ENTRY = 1;
OBSERVATION_ENTRY = 2;
OBSERVATION_EDGE_ENTRY = 3;
// Currently unsupported
BLOCK_ENTRY = 4;
SNAPSHOT_ENTRY = 5;
}
message DownloadRequest {
uint64 start_time = 1;
uint64 end_time = 2;
DownloadDataType data_type = 3;
optional uint64 offset = 4;
}
// Only used temporarily for download, not reliable 'time' value
message TransactionEntry {
uint64 time = 1;
Transaction transaction = 2;
}
message ObservationEntry {
uint64 time = 1;
Observation observation = 2;
}
message DownloadResponse {
repeated UtxoEntry utxo_entries = 1;
repeated TransactionEntry transactions = 2;
repeated ObservationEntry observations = 3;
repeated ObservationEdge observation_edges = 4;
bool complete_response = 5;
}
//
//message DownloadMetadataRequest {
// optional bool debug = 1;
//}
//
//message DownloadMetadataResponse {
//
//}
message GetPeersInfoRequest {
}
message PeerNodeInfo {
Transaction latest_peer_transaction = 1;
Transaction latest_node_transaction = 2;
DynamicNodeMetadata dynamic_node_metadata = 3;
}
message PeerIdInfo {
Transaction latest_peer_transaction = 1;
repeated PeerNodeInfo peer_node_info = 2;
}
message GetPeersInfoResponse {
PeerNodeInfo self_info = 1;
repeated PeerNodeInfo peer_info = 2;
}
message MultipartyBroadcast {
string room_id = 1;
string message = 2;
}
message MultipartyIssueUniqueIndex {
string room_id = 1;
}
message MultipartyIssueUniqueIndexResponse {
int64 unique_index = 1;
}
message MultipartySubscribe {
string room_id = 1;
optional int64 last_event_id = 2;
bool shutdown = 3;
}
message MultipartySubscribeEvent {
string room_id = 1;
string id = 2;
string message = 3;
}
message UtxoConflictResolveRequest {
repeated FixedUtxoId utxo_ids = 1;
Hash transaction_hash = 2;
}
message UtxoConflictResolveResponse {
repeated TransactionInfo transactions = 1;
}
message QueryObservationProofRequest{
Hash hash = 1;
}
message QueryObservationProofResponse {
repeated ObservationProof observation_proof = 1;
}
message MultipartyAuthenticationRequest {
optional string message = 1;
string room_id = 2;
}
message HealthRequest {
}
message GetNodeTransactionRequest {
}
message GetContractStateMarkerRequest {
// TODO: should this be its own id class?
Address address = 1;
StateSelector selector = 2;
}
message Request {
optional GossipTransactionRequest gossip_transaction_request = 1;
optional GossipObservationRequest gossip_observation_request = 2;
optional ResolveHashRequest resolve_hash_request = 3;
optional DownloadRequest download_request = 4;
AboutNodeRequest about_node_request = 5;
Proof proof = 7;
NodeMetadata node_metadata = 8;
GetPeersInfoRequest get_peers_info_request = 9;
// optional DownloadMetadataRequest download_metadata_request = 5;
InitiateMultipartyKeygenRequest initiate_keygen = 10;
InitiateMultipartySigningRequest initiate_signing = 17;
SubmitTransactionRequest submit_transaction_request = 11;
UtxoConflictResolveRequest utxo_conflict_resolve_request = 12;
QueryObservationProofRequest query_observation_proof_request = 13;
HashSearchRequest hash_search_request = 14;
optional string trace_id = 15;
optional bool trace = 16;
MultipartyAuthenticationRequest multiparty_authentication_request = 18;
HealthRequest health_request = 19;
GetNodeTransactionRequest get_node_transaction_request = 20;
GetContractStateMarkerRequest get_contract_state_marker_request = 21;
Address resolve_code_request = 22;
}
message HealthResponse {
}
message ResolveCodeResponse {
UtxoEntry utxo_entry = 1;
TransactionInfo transaction = 2;
ContractStateMarker contract_state_marker = 3;
}
message Response {
ResponseMetadata response_metadata = 1;
// Pull in other response classes if needed.
optional ResolveHashResponse resolve_hash_response = 2;
optional DownloadResponse download_response = 3;
AboutNodeResponse about_node_response = 4;
GetPeersInfoResponse get_peers_info_response = 5;
NodeMetadata node_metadata = 6;
Proof proof = 7;
InitiateMultipartyKeygenResponse initiate_keygen_response = 8;
InitiateMultipartySigningResponse initiate_signing_response = 13;
SubmitTransactionResponse submit_transaction_response = 9;
UtxoConflictResolveResponse utxo_conflict_resolve_response = 10;
QueryObservationProofResponse query_observation_proof_response = 11;
HashSearchResponse hash_search_response = 12;
HealthResponse health_response = 14;
ContractStateMarker get_contract_state_marker_response = 15;
ResolveCodeResponse resolve_code_response = 16;
}
message QueryTransactionRequest {
Hash transaction_id = 1;
}
message MerkleProof {
Hash root = 1;
Hash leaf = 2;
repeated Hash nodes = 3;
}
message ObservationProof {
Hash observation_hash = 1;
MerkleProof merkle_proof = 2;
ObservationMetadata metadata = 3;
Proof proof = 4;
}
message QueryTransactionResponse {
repeated ObservationProof observation_proofs = 1;
Hash block_hash = 2;
}
message SubmitTransactionRequest {
Transaction transaction = 1;
bool sync_query_response = 2;
}
// TODO: This should just return the entire transaction with it's hash also calculated
// Also include the signing hash in the response, modify transaction schema for that
message SubmitTransactionResponse {
Hash transaction_hash = 1;
QueryTransactionResponse query_transaction_response = 2;
Transaction transaction = 3;
}
message AboutNodeRequest {
bool verbose = 1;
}
message AboutNodeResponse {
Transaction latest_metadata = 2;
Transaction latest_node_metadata = 3;
int64 num_known_peers = 4;
int64 num_active_peers = 5;
repeated Transaction recent_transactions = 6;
int64 pending_transactions = 7;
int64 total_accepted_transactions = 8;
int64 observation_height = 9;
PeerNodeInfo peer_node_info = 10;
}
enum AddressType {
Sha3_224_Checksum_Public = 0;
MULTIHASH_KEYHASH = 1;
Bitcoin_External_String = 2;
ETHEREUM_COMPAT_ADDRESS = 3;
PUBLIC_KEY_DIRECT_ADDRESS = 4;
UNKNOWN_ADDRESS_TYPE = 5;
SCRIPT_HASH = 6;
}
message Address {
BytesData address = 1;
AddressType address_type = 2;
}
message QueryAddressesRequest {
repeated Address addresses = 1;
}
message QueryAddressesResponse {
repeated UtxoEntry utxo_entries = 1;
}
message FaucetRequest {
Address address = 1;
}
// Should this just be transactionInfo?
message FaucetResponse {
SubmitTransactionResponse submit_transaction_response = 1;
}
message RecentTransactionsRequest {}
message RecentTransactionsResponse {
repeated Transaction transactions = 1;
}
message HashSearchRequest {
string search_string = 1;
// TODO: Optional data types etc.
}
message UsedOutputs {
FixedUtxoId utxo_id = 1;
repeated ObservationProof proof = 2;
}
message TransactionInfo {
Transaction transaction = 1;
repeated ObservationProof observation_proofs = 2;
// Which output indexes are still considered valid.
repeated int32 valid_utxo_index = 3;
// In order to calculate this quantity, we need another index to determine if something has been used.
repeated UsedOutputs used_outputs = 4;
bool accepted = 5;
ErrorInfo rejection_reason = 6;
// Move this outside to the class / request that requires it for resolving.
optional bool queried_output_index_valid = 7;
TransactionState state = 8;
}
message AddressInfo {
Address address = 1;
repeated UtxoEntry utxo_entries = 2;
int64 balance = 3;
repeated Transaction recent_transactions = 4;
}
message HashSearchResponse {
TransactionInfo transaction_info = 1;
AddressInfo address_info = 2;
Observation observation = 3;
PeerNodeInfo peer_node_info = 4;
PeerIdInfo peer_id_info = 5;
}
message PublicRequest {
optional SubmitTransactionRequest submit_transaction_request = 1;
optional QueryTransactionRequest query_transaction_request = 2;
optional AboutNodeRequest about_node_request = 3;
optional QueryAddressesRequest query_addresses_request = 4;
// Debug only
FaucetRequest faucet_request = 5;
RecentTransactionsRequest recent_transactions_request = 6;
HashSearchRequest hash_search_request = 7;
}
message PublicResponse {
optional ResponseMetadata response_metadata = 1;
optional SubmitTransactionResponse submit_transaction_response = 2;
optional QueryTransactionResponse query_transaction_response = 3;
optional AboutNodeResponse about_node_response = 4;
optional QueryAddressesResponse query_addresses_response = 5;
FaucetResponse faucet_response = 6;
RecentTransactionsResponse recent_transactions_response = 7;
HashSearchResponse hash_search_response = 8;
}
message ErrorDetails {
string detail_name = 1;
string detail = 2;
}
message ErrorInfo {
Error code = 1;
string description = 2;
string description_extended = 3;
string message = 4;
repeated ErrorDetails details = 5;
bool retriable = 6;
string stacktrace = 7;
string lib_message = 8;
bool abort = 9;
}
message TaskLocalDetails {
string key = 1;
string value = 2;
}
message ResponseMetadata {
bool success = 1;
ErrorInfo error_info = 2;
repeated TaskLocalDetails task_local_details = 3;
optional string request_id = 4;
optional string trace_id = 5;
}
//
//message AddPeerFullRequest {
// bytes id = 1;
// double trust = 2;
// bytes public_key = 3;
// string address = 4;
// bool connect_to_peer = 5;
//}
message MultipartyIdentifier {
repeated PublicKey party_keys = 1;
int64 threshold = 2;
string uuid = 3;
}
message ControlMultipartyKeygenRequest {
optional MultipartyIdentifier multiparty_identifier = 1;
bool return_local_share = 2;
}
message ControlMultipartyKeygenResponse {
optional string local_share = 1;
MultipartyIdentifier multiparty_identifier = 2;
}
message ControlMultipartySigningRequest {
InitiateMultipartySigningRequest signing_request = 1;
}
message ControlMultipartySigningResponse {
Proof proof = 1;
MultipartyIdentifier identifier = 2;
}
message InitiateMultipartyKeygenRequest {
MultipartyIdentifier identifier = 1;
}
message InitiateMultipartyKeygenResponse {
InitiateMultipartyKeygenRequest initial_request = 2;
}
message InitiateMultipartySigningResponse{
Proof proof = 1;
InitiateMultipartySigningRequest initial_request = 2;
}
message InitiateMultipartySigningRequest {
MultipartyIdentifier identifier = 1;
string signing_room_id = 2;
repeated PublicKey signing_party_keys = 3;
BytesData data_to_sign = 4;
}
message ControlRequest {
// AddPeerFullRequest add_peer_full_request = 1;
ControlMultipartyKeygenRequest control_multiparty_keygen_request = 2;
ControlMultipartySigningRequest control_multiparty_signing_request = 3;
}
message UpdatePeerTrustRequest {}
message ControlResponse {
ResponseMetadata response_metadata = 1;
ControlMultipartyKeygenResponse control_multiparty_keygen_response = 2;
ControlMultipartySigningResponse control_multiparty_signing_response = 3;
}
enum Error {
/// Signature failed verification
IncorrectSignature = 0;
MissingInputs = 1;
MissingOutputs = 2;
InvalidAddressInputIndex = 3;
InvalidHashLength = 4;
TransactionAlreadyProcessing = 5;
UnknownUTXO = 6;
BalanceMismatch = 7;
InsufficientBalance = 8;
InsufficientFee = 9;
MissingProof = 10;
TransactionRejectedDoubleSpend = 11;
InternalDatabaseError = 12;
AddressPublicKeyProofMismatch = 13;
UnknownError = 14;
DatabaseFailure = 15;
MissingField = 16;
ProtoDecoderFailure = 17;
InvalidNetworkEnvironment = 18;
DataStoreInternalCorruption = 19;
HexDecodeFailure = 20;
AddressDecodeFailure = 21;
UnsupportedCurrency = 22;
AddressNotFound = 23;
UnknownTransaction = 24;
UnknownBlock = 25;
InternalChannelSendError = 26;
InternalChannelReceiveError = 27;
ParseFailure = 28;
DeserializationFailure = 29;
SerializationFailure = 30;
}
enum NodeType {
Ephemeral = 0;
Static = 1;
}
enum NodeState {
Ready = 0;
Offline = 2;
Initializing = 3;
Downloading = 4;
Synchronizing = 5;
ShuttingDown = 6;
}
enum KeyType {
Transport = 0;
ObservationMerkle = 2;
Deposit = 3;
Reward = 4;
}
message UdpMessage {
BytesData bytes = 1;
int64 part = 2;
int64 parts = 3;
string uuid = 4;
int64 timestamp = 5;
}
//
//message Server {
// string host = 1;
// optional string username = 2;
// optional string key_path = 3;
//
//}
/*
#[derive(Clone, Debug)]
pub struct SeedNode {
pub peer_id: Option<Vec<u8>>,
pub trust: Vec<TrustData>,
pub public_key: Option<PublicKey>,
pub external_address: String,
pub port_offset: Option<u16>,
pub environments: Vec<NetworkEnvironment>,
}
*/
message Seed {
string external_address = 1;
repeated NetworkEnvironment environments = 2;
optional uint32 port_offset = 3;
repeated TrustData trust = 4;
PeerId peer_id = 5;
optional PublicKey public_key = 6;
}
message DebugVersionChange {
optional string field1 = 1;
}
message DebugVersionChange2 {
optional string field1 = 1;
optional string field2 = 2;
}
enum TransactionState {
Rejected = 0;
Mempool = 1;
Validated = 2;
Pending = 3;
Finalized = 4;
Accepted = 5;
Unknown = 6;
}
enum ExternalCurrency {
USD = 0;
Bitcoin = 1;
Ethereum = 2;
}
message ExecutionInput {
Transaction tx = 1;
BytesData input = 2;
BytesData state = 3;
}
message ExecutionResult {
bool valid = 1;
ResponseMetadata result_metadata = 2;
StandardData data = 3;
}
message StateSelector {
// TODO: query selector
}
message ContractStateMarker {
Address address = 1;
BytesData state = 2;
StateSelector selector = 3;
Hash transaction_marker = 4;
int64 nonce = 5;
int64 time = 6;
}
message ContentionKey {
FixedUtxoId utxo_id = 1;
Address address = 2;
StateSelector selector = 3;
}
message TestContractUpdate {
string key = 1;
string value = 2;
}
message TestContractUpdate2 {
string value = 2;
}
message TestContractInternalState {
repeated TestContractUpdate test_map = 1;
optional string latest_value = 2;
}
message TestContractRequest {
TestContractUpdate test_contract_update = 1;
TestContractUpdate2 test_contract_update2 = 2;
}
// This doesn't work
//
//message TestMessageOuter {
// execution.TestMessage inner = 1;
//}