--- source: crates/contract/tests/abi.rs expression: abi --- { "schema_version": "0.4.0", "metadata": { "name": "mpc-contract", "version": "3.13.0", "build": { "compiler": "[RUSTC_VERSION]", "builder": "[CARGO_NEAR_BUILD_VERSION]" }, "wasm_hash": "[WASM_HASH]" }, "body": { "functions": [ { "name": "allowed_docker_image_hashes", "doc": " Returns all allowed code hashes in order from most recent to least recent allowed code hashes. The first element is the most recent allowed code hash.", "kind": "view", "result": { "serialization_type": "json", "type_schema": { "type": "array", "items": { "$ref": "#/definitions/DockerImageHash" } } } }, { "name": "allowed_foreign_chain_providers", "doc": " On-chain RPC provider whitelist keyed by `ForeignChain`. Nodes read this at\n startup to validate their local `foreign_chains.yaml`. Borsh-encoded result.", "kind": "view", "result": { "serialization_type": "borsh", "type_schema": { "declaration": "BTreeMap", "definitions": { "()": { "Primitive": 0 }, "(ForeignChain, ChainEntry)": { "Tuple": [ "ForeignChain", "ChainEntry" ] }, "(ProviderId, ProviderConfig)": { "Tuple": [ "ProviderId", "ProviderConfig" ] }, "AuthScheme": { "Enum": { "tag_width": 1, "variants": [ [ 0, "Header", "AuthScheme__Header" ], [ 1, "Path", "AuthScheme__Path" ], [ 2, "Query", "AuthScheme__Query" ], [ 3, "None", "AuthScheme__None" ] ] } }, "AuthScheme__Header": { "Struct": [ [ "name", "String" ], [ "scheme", "Option" ] ] }, "AuthScheme__None": { "Struct": null }, "AuthScheme__Path": { "Struct": [ [ "placeholder", "String" ] ] }, "AuthScheme__Query": { "Struct": [ [ "name", "String" ] ] }, "BTreeMap": { "Sequence": { "length_width": 4, "length_range": { "start": 0, "end": 4294967295 }, "elements": "(ForeignChain, ChainEntry)" } }, "BTreeMap": { "Sequence": { "length_width": 4, "length_range": { "start": 0, "end": 4294967295 }, "elements": "(ProviderId, ProviderConfig)" } }, "ChainEntry": { "Struct": [ [ "providers", "NonEmptyBTreeMap" ], [ "quorum", "u64" ] ] }, "ChainRouting": { "Enum": { "tag_width": 1, "variants": [ [ 0, "Embedded", "ChainRouting__Embedded" ], [ 1, "PathSegment", "ChainRouting__PathSegment" ], [ 2, "QueryParam", "ChainRouting__QueryParam" ] ] } }, "ChainRouting__Embedded": { "Struct": null }, "ChainRouting__PathSegment": { "Struct": [ [ "segment", "String" ] ] }, "ChainRouting__QueryParam": { "Struct": [ [ "name", "String" ], [ "value", "String" ] ] }, "ForeignChain": { "Enum": { "tag_width": 1, "variants": [ [ 0, "Solana", "ForeignChain__Solana" ], [ 1, "Bitcoin", "ForeignChain__Bitcoin" ], [ 2, "Ethereum", "ForeignChain__Ethereum" ], [ 3, "Base", "ForeignChain__Base" ], [ 4, "Bnb", "ForeignChain__Bnb" ], [ 5, "Arbitrum", "ForeignChain__Arbitrum" ], [ 6, "Abstract", "ForeignChain__Abstract" ], [ 7, "Starknet", "ForeignChain__Starknet" ], [ 8, "Polygon", "ForeignChain__Polygon" ], [ 9, "HyperEvm", "ForeignChain__HyperEvm" ], [ 10, "Ton", "ForeignChain__Ton" ], [ 11, "Aptos", "ForeignChain__Aptos" ] ] } }, "ForeignChain__Abstract": { "Struct": null }, "ForeignChain__Aptos": { "Struct": null }, "ForeignChain__Arbitrum": { "Struct": null }, "ForeignChain__Base": { "Struct": null }, "ForeignChain__Bitcoin": { "Struct": null }, "ForeignChain__Bnb": { "Struct": null }, "ForeignChain__Ethereum": { "Struct": null }, "ForeignChain__HyperEvm": { "Struct": null }, "ForeignChain__Polygon": { "Struct": null }, "ForeignChain__Solana": { "Struct": null }, "ForeignChain__Starknet": { "Struct": null }, "ForeignChain__Ton": { "Struct": null }, "NonEmptyBTreeMap": { "Sequence": { "length_width": 4, "length_range": { "start": 1, "end": 4294967295 }, "elements": "(ProviderId, ProviderConfig)" } }, "Option": { "Enum": { "tag_width": 1, "variants": [ [ 0, "None", "()" ], [ 1, "Some", "String" ] ] } }, "ProviderConfig": { "Struct": [ [ "base_url", "String" ], [ "auth_scheme", "AuthScheme" ], [ "chain_routing", "ChainRouting" ] ] }, "ProviderId": { "Struct": [ "String" ] }, "String": { "Sequence": { "length_width": 4, "length_range": { "start": 0, "end": 4294967295 }, "elements": "u8" } }, "u64": { "Primitive": 8 }, "u8": { "Primitive": 1 } } } } }, { "name": "allowed_launcher_compose_hashes", "kind": "view", "result": { "serialization_type": "json", "type_schema": { "type": "array", "items": { "$ref": "#/definitions/LauncherDockerComposeHash" } } } }, { "name": "allowed_launcher_image_hashes", "kind": "view", "result": { "serialization_type": "json", "type_schema": { "type": "array", "items": { "$ref": "#/definitions/LauncherImageHash" } } } }, { "name": "allowed_os_measurements", "doc": " Returns all currently allowed OS measurements.", "kind": "view", "result": { "serialization_type": "json", "type_schema": { "type": "array", "items": { "$ref": "#/definitions/ContractExpectedMeasurements" } } } }, { "name": "clean_foreign_chain_data", "doc": " Private endpoint to clean up foreign chain policy votes and node configurations\n for non-participants after resharing.", "kind": "call", "modifiers": [ "private" ], "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "clean_invalid_attestations", "doc": " Prunes up to `max_scan` stored attestations that fail re-verification (expired or\n referencing stale whitelists). Returns the number of entries removed. Callable by\n anyone while the protocol is in `Running`.", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "max_scan", "type_schema": { "type": "integer", "format": "uint32", "minimum": 0.0 } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "integer", "format": "uint32", "minimum": 0.0 } } }, { "name": "clean_tee_status", "doc": " Private endpoint to drop votes cast by non-participants after resharing.\n Attestation cleanup is handled separately by [`MpcContract::clean_invalid_attestations`].", "kind": "call", "modifiers": [ "private" ], "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "cleanup_orphaned_node_migrations", "kind": "call", "modifiers": [ "private" ], "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "code_hash_votes", "doc": " Returns the current code hash votes, showing each participant's vote.", "kind": "view", "result": { "serialization_type": "json", "type_schema": { "$ref": "#/definitions/CodeHashesVotes" } } }, { "name": "conclude_node_migration", "doc": " Finalizes a node migration for the calling account.\n\n This method can only be called while the protocol is in a `Running` state\n and by an existing participant. On success, the participant’s information is\n updated to the new destination node.\n\n # Errors\n Returns the following errors:\n - `InvalidState::ProtocolStateNotRunning`: if protocol is not in `Running` state\n - `InvalidState::NotParticipant`: if caller is not a current participant\n - `NodeMigrationError::KeysetMismatch`: if provided keyset does not match the expected keyset\n - `NodeMigrationError::MigrationNotFound`: if no migration record exists for the caller\n - `NodeMigrationError::AccountPublicKeyMismatch`: if caller’s public key does not match the expected destination node\n - `InvalidParameters::InvalidTeeRemoteAttestation`: if destination node’s TEE quote is invalid", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "keyset", "type_schema": { "$ref": "#/definitions/Keyset" } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "config", "kind": "view", "result": { "serialization_type": "json", "type_schema": { "$ref": "#/definitions/Config" } } }, { "name": "contract_source_metadata", "kind": "view" }, { "name": "derived_public_key", "doc": " This is the derived public key of the caller given path and predecessor\n if predecessor is not provided, it will be the caller of the contract.\n\n The domain parameter specifies which domain we're deriving the public key for;\n the default is the first domain.", "kind": "view", "params": { "serialization_type": "json", "args": [ { "name": "path", "type_schema": { "type": "string" } }, { "name": "predecessor", "type_schema": { "description": "NEAR Account Identifier.\n\nThis is a unique, syntactically valid, human-readable account identifier on the NEAR network.\n\n[See the crate-level docs for information about validation.](index.html#account-id-rules)\n\nAlso see [Error kind precedence](AccountId#error-kind-precedence).\n\n## Examples\n\n``` use near_account_id::AccountId;\n\nlet alice: AccountId = \"alice.near\".parse().unwrap();\n\nassert!(\"ƒelicia.near\".parse::().is_err()); // (ƒ is not f) ```", "type": [ "string", "null" ] } }, { "name": "domain_id", "type_schema": { "anyOf": [ { "$ref": "#/definitions/DomainId" }, { "type": "null" } ] } } ] }, "result": { "serialization_type": "json", "type_schema": { "$ref": "#/definitions/PublicKey" } } }, { "name": "fail_on_timeout", "kind": "view", "modifiers": [ "private" ] }, { "name": "get_attestation", "kind": "view", "params": { "serialization_type": "json", "args": [ { "name": "tls_public_key", "type_schema": { "$ref": "#/definitions/Ed25519PublicKey" } } ] }, "result": { "serialization_type": "json", "type_schema": { "anyOf": [ { "$ref": "#/definitions/VerifiedAttestation" }, { "type": "null" } ] } } }, { "name": "get_available_foreign_chains", "doc": " The **available** foreign chains: whitelisted chains that are supported\n by at least the signing threshold of active participants.", "kind": "view", "result": { "serialization_type": "json", "type_schema": { "$ref": "#/definitions/AvailableForeignChains" } } }, { "name": "get_foreign_chain_support_by_node", "kind": "view", "result": { "serialization_type": "json", "type_schema": { "$ref": "#/definitions/ForeignChainSupportByNode" } } }, { "name": "get_foreign_chains_configs", "doc": " Per-participant view of which foreign chains each node currently covers. Feeds the\n available-set computation ([`Self::get_available_foreign_chains`]) and coverage alerting.", "kind": "view", "result": { "serialization_type": "json", "type_schema": { "$ref": "#/definitions/ForeignChainsConfigs" } } }, { "name": "get_pending_ckd_request", "doc": " Presence check for a pending CKD request, exposed as a view call.\n\n See [`Self::get_pending_request`] for the contract: the returned `YieldIndex`\n is an arbitrary representative of a fan-out queue, not \"the\" yield. Only the\n `Some`/`None` distinction is meaningful.", "kind": "view", "params": { "serialization_type": "json", "args": [ { "name": "request", "type_schema": { "$ref": "#/definitions/CKDRequest" } } ] }, "result": { "serialization_type": "json", "type_schema": { "anyOf": [ { "$ref": "#/definitions/YieldIndex" }, { "type": "null" } ] } } }, { "name": "get_pending_request", "doc": " Presence check for a pending signature request, exposed as a view call.\n\n **The returned `YieldIndex` is an arbitrary representative, not \"the\" yield\n for this request.** Since the duplicate-request fan-out feature (PR #3187),\n a single request key can have N queued yields; this method returns the head of the\n queue. Callers that need to act on the full set are wrong to use this. The\n only correct interpretation is presence: `Some(_)` vs `None`.\n\n The `Option` shape is retained for JSON wire compatibility with\n out-of-tree consumers; the in-tree caller (`tx_sender::observe_tx_result`)\n only matches on presence. Prefer a `bool`-shaped accessor if one is added.", "kind": "view", "params": { "serialization_type": "json", "args": [ { "name": "request", "type_schema": { "$ref": "#/definitions/SignatureRequest" } } ] }, "result": { "serialization_type": "json", "type_schema": { "anyOf": [ { "$ref": "#/definitions/YieldIndex" }, { "type": "null" } ] } } }, { "name": "get_pending_verify_foreign_tx_request", "doc": " Presence check for a pending foreign-tx verification request, exposed as a\n view call.\n\n See [`Self::get_pending_request`] for the contract: the returned `YieldIndex`\n is an arbitrary representative of a fan-out queue, not \"the\" yield. Only the\n `Some`/`None` distinction is meaningful.", "kind": "view", "params": { "serialization_type": "json", "args": [ { "name": "request", "type_schema": { "$ref": "#/definitions/VerifyForeignTransactionRequest" } } ] }, "result": { "serialization_type": "json", "type_schema": { "anyOf": [ { "$ref": "#/definitions/YieldIndex" }, { "type": "null" } ] } } }, { "name": "get_supported_foreign_chains", "kind": "view", "result": { "serialization_type": "json", "type_schema": { "$ref": "#/definitions/SupportedForeignChains" } } }, { "name": "get_tee_accounts", "doc": " Returns all accounts that have TEE attestations stored in the contract.\n Note: This includes both current protocol participants and accounts that may have\n submitted TEE information but are not currently part of the active participant set.", "kind": "view", "result": { "serialization_type": "json", "type_schema": { "type": "array", "items": { "$ref": "#/definitions/NodeId" } } } }, { "name": "init", "kind": "call", "modifiers": [ "init" ], "params": { "serialization_type": "json", "args": [ { "name": "parameters", "type_schema": { "$ref": "#/definitions/ThresholdParameters" } }, { "name": "init_config", "type_schema": { "anyOf": [ { "$ref": "#/definitions/InitConfig" }, { "type": "null" } ] } } ] } }, { "name": "init_running", "kind": "call", "modifiers": [ "init", "private" ], "params": { "serialization_type": "json", "args": [ { "name": "domains", "type_schema": { "type": "array", "items": { "$ref": "#/definitions/DomainConfig" } } }, { "name": "next_domain_id", "type_schema": { "type": "integer", "format": "uint64", "minimum": 0.0 } }, { "name": "keyset", "type_schema": { "$ref": "#/definitions/Keyset" } }, { "name": "parameters", "type_schema": { "$ref": "#/definitions/ThresholdParameters" } }, { "name": "init_config", "type_schema": { "anyOf": [ { "$ref": "#/definitions/InitConfig" }, { "type": "null" } ] } } ] } }, { "name": "latest_key_version", "doc": " Key versions refer new versions of the root key that we may choose to generate on cohort\n changes. Older key versions will always work but newer key versions were never held by\n older signers. Newer key versions may also add new security features, like only existing\n within a secure enclave. The signature_scheme parameter specifies which protocol\n we're querying the latest version for. The default is Secp256k1. The default is **NOT**\n to query across all protocols.", "kind": "view", "params": { "serialization_type": "json", "args": [ { "name": "signature_scheme", "type_schema": { "anyOf": [ { "$ref": "#/definitions/Curve" }, { "type": "null" } ] } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "integer", "format": "uint32", "minimum": 0.0 } } }, { "name": "launcher_hash_votes", "doc": " Returns the current launcher hash votes, showing each participant's vote.", "kind": "view", "result": { "serialization_type": "json", "type_schema": { "$ref": "#/definitions/LauncherHashVotes" } } }, { "name": "metrics", "kind": "view", "result": { "serialization_type": "json", "type_schema": { "$ref": "#/definitions/Metrics" } } }, { "name": "migrate", "doc": " This will be called internally by the contract to migrate the state when a new contract\n is deployed. This function should be changed every time state is changed to do the proper\n migrate flow.\n\n If nothing is changed, then this function will just return the current state. If it fails\n to read the state, then it will return an error.", "kind": "call", "modifiers": [ "init", "private" ] }, { "name": "migration_info", "kind": "view", "result": { "serialization_type": "json", "type_schema": { "type": "object", "additionalProperties": { "type": "array", "items": [ { "anyOf": [ { "$ref": "#/definitions/BackupServiceInfo" }, { "type": "null" } ] }, { "anyOf": [ { "$ref": "#/definitions/DestinationNodeInfo" }, { "type": "null" } ] } ], "maxItems": 2, "minItems": 2 } } } }, { "name": "os_measurement_votes", "doc": " Returns the current OS measurement votes, showing each participant's vote.", "kind": "view", "result": { "serialization_type": "json", "type_schema": { "$ref": "#/definitions/MeasurementVotes" } } }, { "name": "propose_update", "doc": " Propose update to either code or config, but not both of them at the same time.", "kind": "call", "modifiers": [ "payable" ], "params": { "serialization_type": "borsh", "args": [ { "name": "args", "type_schema": { "declaration": "ProposeUpdateArgs", "definitions": { "()": { "Primitive": 0 }, "Config": { "Struct": [ [ "key_event_timeout_blocks", "u64" ], [ "tee_upgrade_deadline_duration_seconds", "u64" ], [ "contract_upgrade_deposit_tera_gas", "u64" ], [ "sign_call_gas_attachment_requirement_tera_gas", "u64" ], [ "ckd_call_gas_attachment_requirement_tera_gas", "u64" ], [ "return_signature_and_clean_state_on_success_call_tera_gas", "u64" ], [ "return_ck_and_clean_state_on_success_call_tera_gas", "u64" ], [ "fail_on_timeout_tera_gas", "u64" ], [ "clean_tee_status_tera_gas", "u64" ], [ "clean_invalid_attestations_tera_gas", "u64" ], [ "cleanup_orphaned_node_migrations_tera_gas", "u64" ], [ "remove_non_participant_update_votes_tera_gas", "u64" ], [ "clean_foreign_chain_data_tera_gas", "u64" ], [ "remove_non_participant_tee_verifier_votes_tera_gas", "u64" ] ] }, "Option": { "Enum": { "tag_width": 1, "variants": [ [ 0, "None", "()" ], [ 1, "Some", "Config" ] ] } }, "Option>": { "Enum": { "tag_width": 1, "variants": [ [ 0, "None", "()" ], [ 1, "Some", "Vec" ] ] } }, "ProposeUpdateArgs": { "Struct": [ [ "code", "Option>" ], [ "config", "Option" ] ] }, "Vec": { "Sequence": { "length_width": 4, "length_range": { "start": 0, "end": 4294967295 }, "elements": "u8" } }, "u64": { "Primitive": 8 }, "u8": { "Primitive": 1 } } } } ] }, "result": { "serialization_type": "json", "type_schema": { "$ref": "#/definitions/UpdateId" } } }, { "name": "proposed_updates", "doc": " returns all proposed updates", "kind": "view", "result": { "serialization_type": "json", "type_schema": { "$ref": "#/definitions/ProposedUpdates" } } }, { "name": "public_key", "doc": " This is the root public key combined from all the public keys of the participants.\n The domain parameter specifies which domain we're querying the public key for;\n the default is the first domain.", "kind": "view", "params": { "serialization_type": "json", "args": [ { "name": "domain_id", "type_schema": { "anyOf": [ { "$ref": "#/definitions/DomainId" }, { "type": "null" } ] } } ] }, "result": { "serialization_type": "json", "type_schema": { "$ref": "#/definitions/PublicKey" } } }, { "name": "register_backup_service", "doc": " Registers or updates the backup service information for the caller account.\n\n The caller (`signer_account_id`) must be an existing or prospective participant.\n Otherwise, the transaction will fail.\n\n # Notes\n - A deposit requirement may be added in the future.", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "backup_service_info", "type_schema": { "$ref": "#/definitions/BackupServiceInfo" } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "register_foreign_chain_config", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "foreign_chain_configuration", "type_schema": { "$ref": "#/definitions/ForeignChainConfiguration" } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "register_foreign_chain_support", "doc": " Registers the set of foreign chains the calling node supports.\n\n Must be called directly from the participant's own NEAR account\n (`voter_or_panic` requires `signer == predecessor`, blocking calls forwarded\n through another contract). Callable by a participant in any active protocol phase\n (Initializing, Running, or Resharing — authenticated against that phase's participant\n set); panics in `NotInitialized` or when the caller is not a participant. Entries for\n accounts that are no longer participants are pruned after resharing by\n [`Self::clean_foreign_chain_data`].", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "foreign_chain_support", "type_schema": { "$ref": "#/definitions/SupportedForeignChains" } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "register_foreign_chains_config", "doc": " (Re)registers the foreign chains this node currently covers.", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "foreign_chains_config", "type_schema": { "$ref": "#/definitions/ForeignChainsConfig" } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "remove_non_participant_tee_verifier_votes", "doc": " Private endpoint to drop verifier-change votes cast by non-participants\n after resharing.", "kind": "call", "modifiers": [ "private" ], "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "remove_non_participant_update_votes", "doc": " Cleans update votes from non-participants after resharing.\n Can only be called by participants or by the contract itself.", "kind": "call", "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "remove_update_vote", "doc": " Removes an update vote by the caller\n panics if the contract is not in a running state or if the caller is not a participant", "kind": "call" }, { "name": "request_app_private_key", "doc": " To avoid overloading the network with too many requests,\n we ask for a small deposit for each ckd request.\n\n Note: identity points are accepted in `AppPublicKeyPV` to support use cases\n where the derived key is intentionally public (no encryption).", "kind": "call", "modifiers": [ "payable" ], "params": { "serialization_type": "json", "args": [ { "name": "request", "type_schema": { "$ref": "#/definitions/CKDRequestArgs" } } ] } }, { "name": "respond", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "request", "type_schema": { "$ref": "#/definitions/SignatureRequest" } }, { "name": "response", "type_schema": { "$ref": "#/definitions/SignatureResponse" } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "respond_ckd", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "request", "type_schema": { "$ref": "#/definitions/CKDRequest" } }, { "name": "response", "type_schema": { "$ref": "#/definitions/CKDResponse" } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "respond_verify_foreign_tx", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "request", "type_schema": { "$ref": "#/definitions/VerifyForeignTransactionRequest" } }, { "name": "response", "type_schema": { "$ref": "#/definitions/VerifyForeignTransactionResponse" } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "return_ck_and_clean_state_on_success", "doc": " Yield-resume callback for a single queued CKD request.\n\n On success, returns the confidential key to the original caller. On timeout,\n pops this yield's slot (the head of the FIFO fan-out queue) from the\n pending-request map and fires `fail_on_timeout` to fail the original\n transaction. Sibling yields queued under the same request key remain pending\n and are cleaned up by their own timeouts (or drained together by a subsequent\n `respond_ckd`).", "kind": "call", "modifiers": [ "private" ], "params": { "serialization_type": "json", "args": [ { "name": "request", "type_schema": { "$ref": "#/definitions/CKDRequest" } } ] }, "callbacks": [ { "serialization_type": "json", "type_schema": { "$ref": "#/definitions/CKDResponse" } } ], "result": { "serialization_type": "json", "type_schema": { "$ref": "#/definitions/PromiseOrValueCKDResponse" } } }, { "name": "return_signature_and_clean_state_on_success", "doc": " Yield-resume callback for a single queued `sign` request.\n\n On success, returns the signature to the original caller. On timeout, pops this\n yield's slot (the head of the FIFO fan-out queue) from the pending-request map\n and fires `fail_on_timeout` to fail the original transaction. Sibling yields\n queued under the same request key remain pending and are cleaned up by their\n own timeouts (or drained together by a subsequent `respond`).", "kind": "call", "modifiers": [ "private" ], "params": { "serialization_type": "json", "args": [ { "name": "request", "type_schema": { "$ref": "#/definitions/SignatureRequest" } } ] }, "callbacks": [ { "serialization_type": "json", "type_schema": { "$ref": "#/definitions/SignatureResponse" } } ], "result": { "serialization_type": "json", "type_schema": { "$ref": "#/definitions/PromiseOrValueSignatureResponse" } } }, { "name": "return_verify_foreign_tx_and_clean_state_on_success", "doc": " Yield-resume callback for a single queued foreign-tx verification request.\n\n On success, returns the verification response to the original caller. On\n timeout, pops this yield's slot (the head of the FIFO fan-out queue) from the\n pending-request map and fires `fail_on_timeout` to fail the original\n transaction. Sibling yields queued under the same request key remain pending\n and are cleaned up by their own timeouts (or drained together by a subsequent\n `respond_verify_foreign_tx`).", "kind": "call", "modifiers": [ "private" ], "params": { "serialization_type": "json", "args": [ { "name": "request", "type_schema": { "$ref": "#/definitions/VerifyForeignTransactionRequest" } } ] }, "callbacks": [ { "serialization_type": "json", "type_schema": { "$ref": "#/definitions/VerifyForeignTransactionResponse" } } ], "result": { "serialization_type": "json", "type_schema": { "$ref": "#/definitions/PromiseOrValueVerifyForeignTransactionResponse" } } }, { "name": "sign", "doc": " `key_version` must be less than or equal to the value at `latest_key_version`\n To avoid overloading the network with too many requests,\n we ask for a small deposit for each signature request.", "kind": "call", "modifiers": [ "payable" ], "params": { "serialization_type": "json", "args": [ { "name": "request", "type_schema": { "$ref": "#/definitions/SignRequestArgs" } } ] } }, { "name": "start_keygen_instance", "doc": " Starts a new attempt to generate a key for the current domain.\n This only succeeds if the signer is the leader (the participant with the lowest ID).", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "key_event_id", "type_schema": { "$ref": "#/definitions/KeyEventId" } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "start_node_migration", "doc": " Sets the destination node for the calling account.\n\n This function can only be called while the protocol is in a `Running` state.\n The signer must be a current participant of the current epoch, otherwise an error is returned.\n On success, the provided `DestinationNodeInfo` is stored in the contract state\n under the signer’s account ID.\n\n # Errors\n - [`InvalidState::ProtocolStateNotRunning`] if the protocol is not in the `Running` state.\n - [`InvalidState::NotParticipant`] if the signer is not a current participant.\n # Note:\n - might require a deposit", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "destination_node_info", "type_schema": { "$ref": "#/definitions/DestinationNodeInfo" } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "start_reshare_instance", "doc": " Starts a new attempt to reshare the key for the current domain.\n This only succeeds if the signer is the leader (the participant with the lowest ID).", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "key_event_id", "type_schema": { "$ref": "#/definitions/KeyEventId" } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "state", "kind": "view", "result": { "serialization_type": "json", "type_schema": { "$ref": "#/definitions/ProtocolContractState" } } }, { "name": "submit_participant_info", "doc": " (Prospective) Participants can submit their tee participant information through this\n endpoint.", "kind": "call", "modifiers": [ "payable" ], "params": { "serialization_type": "json", "args": [ { "name": "proposed_participant_attestation", "type_schema": { "$ref": "#/definitions/Attestation" } }, { "name": "tls_public_key", "type_schema": { "$ref": "#/definitions/Ed25519PublicKey" } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "tee_verifier_votes", "doc": " Returns the pending TEE verifier-change votes, keyed by proposal.", "kind": "view", "result": { "serialization_type": "json", "type_schema": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/AuthenticatedParticipantId2" }, "uniqueItems": true } } } }, { "name": "update_config", "kind": "call", "modifiers": [ "private" ], "params": { "serialization_type": "json", "args": [ { "name": "config", "type_schema": { "$ref": "#/definitions/Config" } } ] } }, { "name": "verify_foreign_transaction", "doc": " Submit a verification + signing request for a foreign chain transaction.\n MPC nodes will verify the transaction on the foreign chain before signing.\n The signed payload is derived from the transaction ID (hash of tx_id).", "kind": "call", "modifiers": [ "payable" ], "params": { "serialization_type": "json", "args": [ { "name": "request", "type_schema": { "$ref": "#/definitions/VerifyForeignTransactionRequestArgs" } } ] } }, { "name": "verify_tee", "doc": " Verifies if all current participants have an accepted TEE state.\n Automatically enters a resharing, in case one or more participants do not have an accepted\n TEE state.\n Returns `false` and stops the contract from accepting new signature requests or responses,\n in case less than `threshold` participants run in an accepted TEE State.", "kind": "call", "result": { "serialization_type": "json", "type_schema": { "type": "boolean" } } }, { "name": "version", "kind": "view", "result": { "serialization_type": "json", "type_schema": { "type": "string" } } }, { "name": "vote_abort_key_event_instance", "doc": " Casts a vote to abort the current key event instance. If succesful, the contract aborts the\n instance and a new instance with the next attempt_id can be started.", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "key_event_id", "type_schema": { "$ref": "#/definitions/KeyEventId" } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "vote_add_domains", "doc": " Propose adding a new set of domains for the MPC network.\n If a threshold number of votes are reached on the exact same proposal, this will transition\n the contract into the Initializing state to generate keys for the new domains.\n\n The specified list of domains must have increasing and contiguous IDs, and the first ID\n must be the same as the `next_domain_id` returned by state().", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "domains", "type_schema": { "type": "array", "items": { "$ref": "#/definitions/DomainConfig" } } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "vote_add_launcher_hash", "doc": " Vote to add a new launcher image hash to the allowed set. Requires threshold votes.\n When the threshold is reached, compose hashes are automatically derived for all\n currently allowed MPC image hashes.", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "launcher_hash", "type_schema": { "$ref": "#/definitions/LauncherImageHash" } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "vote_add_os_measurement", "doc": " Vote to add a new OS measurement set to the allowed list. Requires threshold votes.", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "measurement", "type_schema": { "$ref": "#/definitions/ContractExpectedMeasurements" } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "vote_cancel_keygen", "doc": " Casts a vote to cancel key generation. Any keys that have already been generated\n are kept and we transition into Running state; remaining domains are permanently deleted.\n Deleted domain IDs cannot be reused again in future calls to vote_add_domains.\n\n A next_domain_id that matches that in the state's domains struct must be passed in. This is\n to prevent stale requests from accidentally cancelling a future key generation state.", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "next_domain_id", "type_schema": { "type": "integer", "format": "uint64", "minimum": 0.0 } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "vote_cancel_resharing", "doc": " Casts a vote to cancel the current key resharing. If a threshold number of unique\n votes are collected to cancel the resharing, the contract state will revert back to the\n previous running state.\n\n - This method is idempotent, meaning a single account can not make more than one vote.\n - Only nodes from the previous running state are allowed to vote.\n\n Return value:\n - [Ok] if the vote was successfully collected.\n - [Err] if:\n - The signer is not a participant in the previous running state.\n - The contract is not in a resharing state.", "kind": "call", "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "vote_code_hash", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "code_hash", "type_schema": { "$ref": "#/definitions/DockerImageHash" } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "vote_new_parameters", "doc": " Propose new parameters for the MPC network: participants, governance\n threshold, and optional per-domain `ReconstructionThreshold` updates\n (empty map keeps the current ones), applied on resharing completion.\n If a threshold number of votes are reached on the exact same proposal, this will transition\n the contract into the Resharing state.\n\n The epoch_id must be equal to 1 plus the current epoch ID (if Running) or prospective epoch\n ID (if Resharing). Otherwise the vote is ignored. This is to prevent late transactions from\n accidentally voting on outdated proposals.\n\n Like the other governance voting methods, this must be called directly from the\n participant's own NEAR account: `assert_caller_is_signer()` requires\n `signer_account_id == predecessor_account_id`, so calls forwarded through another\n contract are rejected.", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "prospective_epoch_id", "type_schema": { "$ref": "#/definitions/EpochId" } }, { "name": "proposal", "type_schema": { "$ref": "#/definitions/ProposedThresholdParameters" } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "vote_pk", "doc": " Casts a vote for `public_key` for the attempt identified by `key_event_id`.\n\n The effect of this method is either:\n - Returns error (which aborts with no changes), if there is no active key generation\n attempt (including if the attempt timed out), if the signer is not a participant, or if\n the key_event_id corresponds to a different domain, different epoch, or different attempt\n from the current key generation attempt.\n - Returns Ok(()), with one of the following changes:\n - A vote has been collected but we don't have enough votes yet.\n - This vote is for a public key that disagrees from an earlier voted public key, causing\n the attempt to abort; another call to `start` is then necessary.\n - Everyone has now voted for the same public key; the state transitions into generating a\n key for the next domain.\n - Same as the last case, except that all domains have a generated key now, and the state\n transitions into Running with the newly generated keys.", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "key_event_id", "type_schema": { "$ref": "#/definitions/KeyEventId" } }, { "name": "public_key", "type_schema": { "$ref": "#/definitions/PublicKey" } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "vote_remove_launcher_hash", "doc": " Vote to remove a launcher image hash from the allowed set. Requires ALL participants\n to vote for removal, since this invalidates attestations of nodes running that launcher.", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "launcher_hash", "type_schema": { "$ref": "#/definitions/LauncherImageHash" } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "vote_remove_os_measurement", "doc": " Vote to remove an OS measurement set from the allowed list. Requires ALL participants\n to vote for removal.", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "measurement", "type_schema": { "$ref": "#/definitions/ContractExpectedMeasurements" } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "vote_reshared", "doc": " Casts a vote for the successful resharing of the attempt identified by `key_event_id`.\n\n The effect of this method is either:\n - Returns error (which aborts with no changes), if there is no active key resharing attempt\n (including if the attempt timed out), if the signer is not a participant, or if the\n key_event_id corresponds to a different domain, different epoch, or different attempt\n from the current key resharing attempt.\n - Returns Ok(()), with one of the following changes:\n - A vote has been collected but we don't have enough votes yet.\n - Everyone has now voted; the state transitions into resharing the key for the next\n domain.\n - Same as the last case, except that all domains' keys have been reshared now, and the\n state transitions into Running with the newly reshared keys.", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "key_event_id", "type_schema": { "$ref": "#/definitions/KeyEventId" } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "vote_tee_verifier_change", "doc": " Vote for a candidate account to become the trusted verifier contract\n account, committing to the code hash the voter audited. When the proposal\n crosses the signing threshold, the trusted verifier account is updated\n and all pending verifier-change votes are cleared.", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "candidate_account_id", "type_schema": { "description": "NEAR Account Identifier.\n\nThis is a unique, syntactically valid, human-readable account identifier on the NEAR network.\n\n[See the crate-level docs for information about validation.](index.html#account-id-rules)\n\nAlso see [Error kind precedence](AccountId#error-kind-precedence).\n\n## Examples\n\n``` use near_account_id::AccountId;\n\nlet alice: AccountId = \"alice.near\".parse().unwrap();\n\nassert!(\"ƒelicia.near\".parse::().is_err()); // (ƒ is not f) ```", "type": "string" } }, { "name": "expected_code_hash", "type_schema": { "$ref": "#/definitions/TeeVerifierCodeHash" } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "null" } } }, { "name": "vote_update", "doc": " Vote for a proposed update given the [`UpdateId`] of the update.\n\n Returns `Ok(true)` if the amount of voters surpassed the threshold and the update was\n executed. Returns `Ok(false)` if the amount of voters did not surpass the threshold.\n Returns [`Error`] if the update was not found or if the voter is not a participant\n in the protocol.", "kind": "call", "params": { "serialization_type": "json", "args": [ { "name": "id", "type_schema": { "$ref": "#/definitions/UpdateId" } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "boolean" } } }, { "name": "vote_update_foreign_chain_providers", "doc": " Vote on per-chain RPC provider whitelist state. The input is keyed by\n `ForeignChain`; each `ChainEntry` value carries the proposed full provider list\n and the RPC response quorum for that chain. The chain's stored state is replaced\n once the protocol's signing threshold of participants has voted the same\n `(providers, quorum)` pair. `NonEmptyBTreeMap` enforces a non-empty batch and\n at-most-one entry per chain at borsh-deserialize time.", "kind": "call", "params": { "serialization_type": "borsh", "args": [ { "name": "votes", "type_schema": { "declaration": "NonEmptyBTreeMap", "definitions": { "()": { "Primitive": 0 }, "(ForeignChain, ChainEntry)": { "Tuple": [ "ForeignChain", "ChainEntry" ] }, "(ProviderId, ProviderConfig)": { "Tuple": [ "ProviderId", "ProviderConfig" ] }, "AuthScheme": { "Enum": { "tag_width": 1, "variants": [ [ 0, "Header", "AuthScheme__Header" ], [ 1, "Path", "AuthScheme__Path" ], [ 2, "Query", "AuthScheme__Query" ], [ 3, "None", "AuthScheme__None" ] ] } }, "AuthScheme__Header": { "Struct": [ [ "name", "String" ], [ "scheme", "Option" ] ] }, "AuthScheme__None": { "Struct": null }, "AuthScheme__Path": { "Struct": [ [ "placeholder", "String" ] ] }, "AuthScheme__Query": { "Struct": [ [ "name", "String" ] ] }, "BTreeMap": { "Sequence": { "length_width": 4, "length_range": { "start": 0, "end": 4294967295 }, "elements": "(ForeignChain, ChainEntry)" } }, "BTreeMap": { "Sequence": { "length_width": 4, "length_range": { "start": 0, "end": 4294967295 }, "elements": "(ProviderId, ProviderConfig)" } }, "ChainEntry": { "Struct": [ [ "providers", "NonEmptyBTreeMap" ], [ "quorum", "u64" ] ] }, "ChainRouting": { "Enum": { "tag_width": 1, "variants": [ [ 0, "Embedded", "ChainRouting__Embedded" ], [ 1, "PathSegment", "ChainRouting__PathSegment" ], [ 2, "QueryParam", "ChainRouting__QueryParam" ] ] } }, "ChainRouting__Embedded": { "Struct": null }, "ChainRouting__PathSegment": { "Struct": [ [ "segment", "String" ] ] }, "ChainRouting__QueryParam": { "Struct": [ [ "name", "String" ], [ "value", "String" ] ] }, "ForeignChain": { "Enum": { "tag_width": 1, "variants": [ [ 0, "Solana", "ForeignChain__Solana" ], [ 1, "Bitcoin", "ForeignChain__Bitcoin" ], [ 2, "Ethereum", "ForeignChain__Ethereum" ], [ 3, "Base", "ForeignChain__Base" ], [ 4, "Bnb", "ForeignChain__Bnb" ], [ 5, "Arbitrum", "ForeignChain__Arbitrum" ], [ 6, "Abstract", "ForeignChain__Abstract" ], [ 7, "Starknet", "ForeignChain__Starknet" ], [ 8, "Polygon", "ForeignChain__Polygon" ], [ 9, "HyperEvm", "ForeignChain__HyperEvm" ], [ 10, "Ton", "ForeignChain__Ton" ], [ 11, "Aptos", "ForeignChain__Aptos" ] ] } }, "ForeignChain__Abstract": { "Struct": null }, "ForeignChain__Aptos": { "Struct": null }, "ForeignChain__Arbitrum": { "Struct": null }, "ForeignChain__Base": { "Struct": null }, "ForeignChain__Bitcoin": { "Struct": null }, "ForeignChain__Bnb": { "Struct": null }, "ForeignChain__Ethereum": { "Struct": null }, "ForeignChain__HyperEvm": { "Struct": null }, "ForeignChain__Polygon": { "Struct": null }, "ForeignChain__Solana": { "Struct": null }, "ForeignChain__Starknet": { "Struct": null }, "ForeignChain__Ton": { "Struct": null }, "NonEmptyBTreeMap": { "Sequence": { "length_width": 4, "length_range": { "start": 1, "end": 4294967295 }, "elements": "(ForeignChain, ChainEntry)" } }, "NonEmptyBTreeMap": { "Sequence": { "length_width": 4, "length_range": { "start": 1, "end": 4294967295 }, "elements": "(ProviderId, ProviderConfig)" } }, "Option": { "Enum": { "tag_width": 1, "variants": [ [ 0, "None", "()" ], [ 1, "Some", "String" ] ] } }, "ProviderConfig": { "Struct": [ [ "base_url", "String" ], [ "auth_scheme", "AuthScheme" ], [ "chain_routing", "ChainRouting" ] ] }, "ProviderId": { "Struct": [ "String" ] }, "String": { "Sequence": { "length_width": 4, "length_range": { "start": 0, "end": 4294967295 }, "elements": "u8" } }, "u64": { "Primitive": 8 }, "u8": { "Primitive": 1 } } } } ] }, "result": { "serialization_type": "json", "type_schema": { "type": "array", "items": { "$ref": "#/definitions/ForeignChain" } } } }, { "name": "withdraw_tee_verifier_vote", "doc": " Withdraw the caller's current vote on any pending verifier-change\n proposal. No-op if the caller has not voted.", "kind": "call", "result": { "serialization_type": "json", "type_schema": { "type": "null" } } } ], "root_schema": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "String", "type": "string", "definitions": { "AddDomainsVotes": { "description": "Votes for adding new domains.", "type": "object", "required": [ "proposal_by_account" ], "properties": { "proposal_by_account": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/DomainConfig" } } } } }, "AptosExtractor": { "oneOf": [ { "type": "object", "required": [ "Event" ], "properties": { "Event": { "type": "object", "required": [ "event_index" ], "properties": { "event_index": { "type": "integer", "format": "uint64", "minimum": 0.0 } } } }, "additionalProperties": false } ] }, "AptosFinality": { "type": "string", "enum": [ "Committed" ] }, "AptosRpcRequest": { "type": "object", "required": [ "extractors", "finality", "tx_id" ], "properties": { "extractors": { "type": "array", "items": { "$ref": "#/definitions/AptosExtractor" } }, "finality": { "$ref": "#/definitions/AptosFinality" }, "tx_id": { "$ref": "#/definitions/AptosTxId" } } }, "AptosTxId": { "type": "string", "pattern": "^(?:[0-9A-Fa-f]{2})*$" }, "AttemptId": { "description": "Attempt identifier within a key event. Incremented for each attempt within the same epoch and domain.", "type": "integer", "format": "uint64", "minimum": 0.0 }, "Attestation": { "oneOf": [ { "type": "object", "required": [ "Dstack" ], "properties": { "Dstack": { "$ref": "#/definitions/DstackAttestation" } }, "additionalProperties": false }, { "type": "object", "required": [ "Mock" ], "properties": { "Mock": { "$ref": "#/definitions/MockAttestation" } }, "additionalProperties": false } ] }, "AuthenticatedAccountId": { "description": "An account ID that has been authenticated (i.e., the caller is this account).", "type": "string" }, "AuthenticatedParticipantId": { "description": "A participant ID that has been authenticated (i.e., the caller is this participant).", "allOf": [ { "$ref": "#/definitions/ParticipantId" } ] }, "AuthenticatedParticipantId2": { "description": "This struct is supposed to contain the participant id associated to the account `env::signer_account_id()`, but is only constructible given a set of participants that includes the signer, thus acting as a type system-based enforcement mechanism (albeit a best-effort one) for authenticating the signer.", "allOf": [ { "$ref": "#/definitions/ParticipantId" } ] }, "AvailableForeignChains": { "description": "The set of foreign chains available across the threshold of active participants. Returned by `get_available_foreign_chains`; computed from the per-node [`ForeignChainsConfig`] reports.", "type": "array", "items": { "$ref": "#/definitions/ForeignChain" }, "uniqueItems": true }, "BackupServiceInfo": { "type": "object", "required": [ "public_key" ], "properties": { "public_key": { "$ref": "#/definitions/Ed25519PublicKey" } } }, "BitcoinExtractor": { "type": "string", "enum": [ "BlockHash" ] }, "BitcoinRpcRequest": { "type": "object", "required": [ "confirmations", "extractors", "tx_id" ], "properties": { "confirmations": { "$ref": "#/definitions/BlockConfirmations" }, "extractors": { "type": "array", "items": { "$ref": "#/definitions/BitcoinExtractor" } }, "tx_id": { "$ref": "#/definitions/BitcoinTxId" } } }, "BitcoinTxId": { "type": "string", "pattern": "^(?:[0-9A-Fa-f]{2})*$" }, "BlockConfirmations": { "type": "integer", "format": "uint64", "minimum": 0.0 }, "Bls12381G1PublicKey": { "type": "string" }, "Bls12381G2PublicKey": { "type": "string" }, "CKDAppPublicKey": { "oneOf": [ { "type": "object", "required": [ "AppPublicKey" ], "properties": { "AppPublicKey": { "$ref": "#/definitions/Bls12381G1PublicKey" } }, "additionalProperties": false }, { "type": "object", "required": [ "AppPublicKeyPV" ], "properties": { "AppPublicKeyPV": { "$ref": "#/definitions/CKDAppPublicKeyPV" } }, "additionalProperties": false } ] }, "CKDAppPublicKeyPV": { "type": "object", "required": [ "pk1", "pk2" ], "properties": { "pk1": { "$ref": "#/definitions/Bls12381G1PublicKey" }, "pk2": { "$ref": "#/definitions/Bls12381G2PublicKey" } } }, "CKDRequest": { "type": "object", "required": [ "app_id", "app_public_key", "domain_id" ], "properties": { "app_id": { "$ref": "#/definitions/CkdAppId" }, "app_public_key": { "description": "The app ephemeral public key", "allOf": [ { "$ref": "#/definitions/CKDAppPublicKey" } ] }, "domain_id": { "$ref": "#/definitions/DomainId" } } }, "CKDRequestArgs": { "type": "object", "required": [ "app_public_key", "derivation_path", "domain_id" ], "properties": { "app_public_key": { "$ref": "#/definitions/CKDAppPublicKey" }, "derivation_path": { "type": "string" }, "domain_id": { "$ref": "#/definitions/DomainId" } } }, "CKDResponse": { "type": "object", "required": [ "big_c", "big_y" ], "properties": { "big_c": { "$ref": "#/definitions/Bls12381G1PublicKey" }, "big_y": { "$ref": "#/definitions/Bls12381G1PublicKey" } } }, "CkdAppId": { "description": "AppId for CKD", "type": "array", "items": { "type": "integer", "format": "uint8", "minimum": 0.0 }, "maxItems": 32, "minItems": 32 }, "CodeHashesVotes": { "description": "Tracks votes to add whitelisted TEE code hashes. Each participant can at any given time vote for a code hash to add.", "type": "object", "required": [ "proposal_by_account" ], "properties": { "proposal_by_account": { "type": "object", "additionalProperties": { "$ref": "#/definitions/DockerImageHash" } } } }, "Collateral": { "type": "object", "required": [ "pck_crl", "pck_crl_issuer_chain", "qe_identity", "qe_identity_issuer_chain", "qe_identity_signature", "root_ca_crl", "tcb_info", "tcb_info_issuer_chain", "tcb_info_signature" ], "properties": { "pck_certificate_chain": { "type": [ "string", "null" ] }, "pck_crl": { "type": "string", "pattern": "^(?:[0-9A-Fa-f]{2})*$" }, "pck_crl_issuer_chain": { "type": "string" }, "qe_identity": { "type": "string" }, "qe_identity_issuer_chain": { "type": "string" }, "qe_identity_signature": { "type": "string", "pattern": "^(?:[0-9A-Fa-f]{2})*$" }, "root_ca_crl": { "type": "string", "pattern": "^(?:[0-9A-Fa-f]{2})*$" }, "tcb_info": { "type": "string" }, "tcb_info_issuer_chain": { "type": "string" }, "tcb_info_signature": { "type": "string", "pattern": "^(?:[0-9A-Fa-f]{2})*$" } } }, "Config": { "description": "Configuration parameters of the contract.", "type": "object", "required": [ "ckd_call_gas_attachment_requirement_tera_gas", "clean_foreign_chain_data_tera_gas", "clean_invalid_attestations_tera_gas", "clean_tee_status_tera_gas", "cleanup_orphaned_node_migrations_tera_gas", "contract_upgrade_deposit_tera_gas", "fail_on_timeout_tera_gas", "key_event_timeout_blocks", "remove_non_participant_tee_verifier_votes_tera_gas", "remove_non_participant_update_votes_tera_gas", "return_ck_and_clean_state_on_success_call_tera_gas", "return_signature_and_clean_state_on_success_call_tera_gas", "sign_call_gas_attachment_requirement_tera_gas", "tee_upgrade_deadline_duration_seconds" ], "properties": { "ckd_call_gas_attachment_requirement_tera_gas": { "description": "Prepaid gas for a `return_signature_and_clean_state_on_success` call.", "type": "integer", "format": "uint64", "minimum": 0.0 }, "clean_foreign_chain_data_tera_gas": { "description": "Prepaid gas for a `clean_foreign_chain_data` call.", "type": "integer", "format": "uint64", "minimum": 0.0 }, "clean_invalid_attestations_tera_gas": { "description": "Prepaid gas for the reshare-time `clean_invalid_attestations` promise.", "type": "integer", "format": "uint64", "minimum": 0.0 }, "clean_tee_status_tera_gas": { "description": "Prepaid gas for a `clean_tee_status` call.", "type": "integer", "format": "uint64", "minimum": 0.0 }, "cleanup_orphaned_node_migrations_tera_gas": { "description": "Prepaid gas for a `cleanup_orphaned_node_migrations` call.", "type": "integer", "format": "uint64", "minimum": 0.0 }, "contract_upgrade_deposit_tera_gas": { "description": "Amount of gas to deposit for contract and config updates.", "type": "integer", "format": "uint64", "minimum": 0.0 }, "fail_on_timeout_tera_gas": { "description": "Prepaid gas for a `fail_on_timeout` call.", "type": "integer", "format": "uint64", "minimum": 0.0 }, "key_event_timeout_blocks": { "description": "If a key event attempt has not successfully completed within this many blocks, it is considered failed.", "type": "integer", "format": "uint64", "minimum": 0.0 }, "remove_non_participant_tee_verifier_votes_tera_gas": { "description": "Prepaid gas for a `remove_non_participant_tee_verifier_votes` call.", "type": "integer", "format": "uint64", "minimum": 0.0 }, "remove_non_participant_update_votes_tera_gas": { "description": "Prepaid gas for a `remove_non_participant_update_votes` call.", "type": "integer", "format": "uint64", "minimum": 0.0 }, "return_ck_and_clean_state_on_success_call_tera_gas": { "description": "Prepaid gas for a `return_ck_and_clean_state_on_success` call.", "type": "integer", "format": "uint64", "minimum": 0.0 }, "return_signature_and_clean_state_on_success_call_tera_gas": { "description": "Prepaid gas for a `return_signature_and_clean_state_on_success` call.", "type": "integer", "format": "uint64", "minimum": 0.0 }, "sign_call_gas_attachment_requirement_tera_gas": { "description": "Gas required for a sign request.", "type": "integer", "format": "uint64", "minimum": 0.0 }, "tee_upgrade_deadline_duration_seconds": { "description": "The grace period duration for expiry of old mpc image hashes once a new one is added.", "type": "integer", "format": "uint64", "minimum": 0.0 } } }, "ContractExpectedMeasurements": { "description": "On-chain representation of expected TDX measurements. Mirrors [`mpc_attestation::attestation::ExpectedMeasurements`] with contract-compatible serialization (hex strings in JSON, borsh for storage).", "type": "object", "required": [ "key_provider_event_digest", "mrtd", "rtmr0", "rtmr1", "rtmr2" ], "properties": { "key_provider_event_digest": { "$ref": "#/definitions/KeyProviderEventDigest" }, "mrtd": { "$ref": "#/definitions/MrtdHash" }, "rtmr0": { "$ref": "#/definitions/Rtmr0Hash" }, "rtmr1": { "$ref": "#/definitions/Rtmr1Hash" }, "rtmr2": { "$ref": "#/definitions/Rtmr2Hash" } } }, "Curve": { "description": "Elliptic curve used by a domain.", "type": "string", "enum": [ "Secp256k1", "Edwards25519", "Bls12381" ] }, "DestinationNodeInfo": { "type": "object", "required": [ "destination_node_info", "signer_account_pk" ], "properties": { "destination_node_info": { "$ref": "#/definitions/ParticipantInfo" }, "signer_account_pk": { "description": "The public key used by the node to sign transactions to the contract. This key is different from the TLS key stored in [`ParticipantInfo::tls_public_key`].", "allOf": [ { "$ref": "#/definitions/Ed25519PublicKey" } ] } } }, "DockerImageHash": { "type": "string", "maxLength": 64, "minLength": 64, "pattern": "^[0-9a-fA-F]+$" }, "DomainConfig": { "description": "Configuration for a signature domain.", "type": "object", "required": [ "id", "protocol", "purpose", "reconstruction_threshold" ], "properties": { "id": { "$ref": "#/definitions/DomainId" }, "protocol": { "$ref": "#/definitions/Protocol" }, "purpose": { "$ref": "#/definitions/DomainPurpose" }, "reconstruction_threshold": { "type": "integer", "format": "uint64", "minimum": 0.0 } } }, "DomainId": { "description": "Each domain corresponds to a specific root key on a specific elliptic curve. There may be multiple domains per curve. The domain ID uniquely identifies a domain.", "type": "integer", "format": "uint64", "minimum": 0.0 }, "DomainPurpose": { "description": "The purpose that a domain serves.", "oneOf": [ { "description": "Domain is used by `sign()`.", "type": "string", "enum": [ "Sign" ] }, { "description": "Domain is used by `verify_foreign_transaction()`.", "type": "string", "enum": [ "ForeignTx" ] }, { "description": "Domain is used by `request_app_private_key()` (Confidential Key Derivation).", "type": "string", "enum": [ "CKD" ] } ] }, "DomainRegistry": { "description": "Registry of all signature domains.", "type": "object", "required": [ "domains", "next_domain_id" ], "properties": { "domains": { "type": "array", "items": { "$ref": "#/definitions/DomainConfig" } }, "next_domain_id": { "type": "integer", "format": "uint64", "minimum": 0.0 } } }, "DstackAttestation": { "type": "object", "required": [ "collateral", "quote", "tcb_info" ], "properties": { "collateral": { "$ref": "#/definitions/Collateral" }, "quote": { "type": "string", "pattern": "^(?:[0-9A-Fa-f]{2})*$" }, "tcb_info": { "$ref": "#/definitions/TcbInfo" } } }, "Ed25519PublicKey": { "type": "array", "items": { "type": "integer", "format": "uint8", "minimum": 0.0 }, "maxItems": 32, "minItems": 32 }, "Ed25519Signature": { "type": "array", "items": { "type": "integer", "format": "uint8", "minimum": 0.0 } }, "EpochId": { "description": "An EpochId uniquely identifies a ThresholdParameters (but not vice-versa). Every time we change the ThresholdParameters (participants and threshold), we increment EpochId. Locally on each node, each keyshare is uniquely identified by the tuple (EpochId, DomainId, AttemptId).", "type": "integer", "format": "uint64", "minimum": 0.0 }, "EventLog": { "description": "Represents an event log entry in the system", "type": "object", "required": [ "digest", "event", "event_payload", "event_type", "imr" ], "properties": { "digest": { "description": "The cryptographic digest of the event", "type": "string" }, "event": { "description": "The type of event as a string", "type": "string" }, "event_payload": { "description": "The payload data associated with the event", "type": "string" }, "event_type": { "description": "The type of event being logged", "type": "integer", "format": "uint32", "minimum": 0.0 }, "imr": { "description": "The index of the IMR (Integrity Measurement Register)", "type": "integer", "format": "uint32", "minimum": 0.0 } } }, "EvmExtractor": { "oneOf": [ { "type": "string", "enum": [ "BlockHash" ] }, { "type": "object", "required": [ "Log" ], "properties": { "Log": { "type": "object", "required": [ "log_index" ], "properties": { "log_index": { "type": "integer", "format": "uint64", "minimum": 0.0 } } } }, "additionalProperties": false } ] }, "EvmFinality": { "type": "string", "enum": [ "Latest", "Safe", "Finalized" ] }, "EvmRpcRequest": { "type": "object", "required": [ "extractors", "finality", "tx_id" ], "properties": { "extractors": { "type": "array", "items": { "$ref": "#/definitions/EvmExtractor" } }, "finality": { "$ref": "#/definitions/EvmFinality" }, "tx_id": { "$ref": "#/definitions/EvmTxId" } } }, "EvmTxId": { "type": "string", "pattern": "^(?:[0-9A-Fa-f]{2})*$" }, "ForeignChain": { "type": "string", "enum": [ "Solana", "Bitcoin", "Ethereum", "Base", "Bnb", "Arbitrum", "Abstract", "Starknet", "Polygon", "HyperEvm", "Ton", "Aptos" ] }, "ForeignChainConfiguration": { "deprecated": true, "type": "object", "additionalProperties": { "$ref": "#/definitions/NonEmptyBTreeSet_RpcProvider" } }, "ForeignChainRpcRequest": { "oneOf": [ { "type": "object", "required": [ "Abstract" ], "properties": { "Abstract": { "$ref": "#/definitions/EvmRpcRequest" } }, "additionalProperties": false }, { "type": "object", "required": [ "Ethereum" ], "properties": { "Ethereum": { "$ref": "#/definitions/EvmRpcRequest" } }, "additionalProperties": false }, { "type": "object", "required": [ "Solana" ], "properties": { "Solana": { "$ref": "#/definitions/SolanaRpcRequest" } }, "additionalProperties": false }, { "type": "object", "required": [ "Bitcoin" ], "properties": { "Bitcoin": { "$ref": "#/definitions/BitcoinRpcRequest" } }, "additionalProperties": false }, { "type": "object", "required": [ "Starknet" ], "properties": { "Starknet": { "$ref": "#/definitions/StarknetRpcRequest" } }, "additionalProperties": false }, { "type": "object", "required": [ "Bnb" ], "properties": { "Bnb": { "$ref": "#/definitions/EvmRpcRequest" } }, "additionalProperties": false }, { "type": "object", "required": [ "Base" ], "properties": { "Base": { "$ref": "#/definitions/EvmRpcRequest" } }, "additionalProperties": false }, { "type": "object", "required": [ "Arbitrum" ], "properties": { "Arbitrum": { "$ref": "#/definitions/EvmRpcRequest" } }, "additionalProperties": false }, { "type": "object", "required": [ "Polygon" ], "properties": { "Polygon": { "$ref": "#/definitions/EvmRpcRequest" } }, "additionalProperties": false }, { "type": "object", "required": [ "HyperEvm" ], "properties": { "HyperEvm": { "$ref": "#/definitions/EvmRpcRequest" } }, "additionalProperties": false }, { "type": "object", "required": [ "Ton" ], "properties": { "Ton": { "$ref": "#/definitions/TonRpcRequest" } }, "additionalProperties": false }, { "type": "object", "required": [ "Aptos" ], "properties": { "Aptos": { "$ref": "#/definitions/AptosRpcRequest" } }, "additionalProperties": false } ] }, "ForeignChainSupportByNode": { "type": "object", "required": [ "foreign_chain_support_by_node" ], "properties": { "foreign_chain_support_by_node": { "type": "object", "additionalProperties": { "$ref": "#/definitions/SupportedForeignChains" } } } }, "ForeignChainsConfig": { "description": "Set of foreign chains a node reports it can serve; aggregated into [`AvailableForeignChains`] by the contract.", "type": "array", "items": { "$ref": "#/definitions/ForeignChain" }, "uniqueItems": true }, "ForeignChainsConfigs": { "description": "Per-node foreign-chain configs, keyed by each node's TLS public key.", "type": "object", "additionalProperties": { "$ref": "#/definitions/ForeignChainsConfig" } }, "Hash256": { "type": "string", "pattern": "^(?:[0-9A-Fa-f]{2})*$" }, "HexString_Min32_Max1232": { "type": "string", "maxLength": 2464, "minLength": 64, "pattern": "^[0-9a-fA-F]*$" }, "HexString_Min32_Max32": { "type": "string", "maxLength": 64, "minLength": 64, "pattern": "^[0-9a-fA-F]*$" }, "InitConfig": { "description": "The initial configuration parameters for when initializing the contract. All fields are optional, as the contract can fill in defaults for any missing fields.", "type": "object", "properties": { "ckd_call_gas_attachment_requirement_tera_gas": { "description": "Prepaid gas for a `return_signature_and_clean_state_on_success` call.", "type": [ "integer", "null" ], "format": "uint64", "minimum": 0.0 }, "clean_foreign_chain_data_tera_gas": { "description": "Prepaid gas for a `clean_foreign_chain_data` call.", "type": [ "integer", "null" ], "format": "uint64", "minimum": 0.0 }, "clean_invalid_attestations_tera_gas": { "description": "Prepaid gas for the reshare-time `clean_invalid_attestations` promise.", "type": [ "integer", "null" ], "format": "uint64", "minimum": 0.0 }, "clean_tee_status_tera_gas": { "description": "Prepaid gas for a `clean_tee_status` call.", "type": [ "integer", "null" ], "format": "uint64", "minimum": 0.0 }, "cleanup_orphaned_node_migrations_tera_gas": { "description": "Prepaid gas for a `cleanup_orphaned_node_migrations` call.", "type": [ "integer", "null" ], "format": "uint64", "minimum": 0.0 }, "contract_upgrade_deposit_tera_gas": { "description": "Amount of gas to deposit for contract and config updates.", "type": [ "integer", "null" ], "format": "uint64", "minimum": 0.0 }, "fail_on_timeout_tera_gas": { "description": "Prepaid gas for a `fail_on_timeout` call.", "type": [ "integer", "null" ], "format": "uint64", "minimum": 0.0 }, "key_event_timeout_blocks": { "description": "If a key event attempt has not successfully completed within this many blocks, it is considered failed.", "type": [ "integer", "null" ], "format": "uint64", "minimum": 0.0 }, "remove_non_participant_tee_verifier_votes_tera_gas": { "description": "Prepaid gas for a `remove_non_participant_tee_verifier_votes` call.", "type": [ "integer", "null" ], "format": "uint64", "minimum": 0.0 }, "remove_non_participant_update_votes_tera_gas": { "description": "Prepaid gas for a `remove_non_participant_update_votes` call.", "type": [ "integer", "null" ], "format": "uint64", "minimum": 0.0 }, "return_ck_and_clean_state_on_success_call_tera_gas": { "description": "Prepaid gas for a `return_ck_and_clean_state_on_success` call.", "type": [ "integer", "null" ], "format": "uint64", "minimum": 0.0 }, "return_signature_and_clean_state_on_success_call_tera_gas": { "description": "Prepaid gas for a `return_signature_and_clean_state_on_success` call.", "type": [ "integer", "null" ], "format": "uint64", "minimum": 0.0 }, "sign_call_gas_attachment_requirement_tera_gas": { "description": "Gas required for a sign request.", "type": [ "integer", "null" ], "format": "uint64", "minimum": 0.0 }, "tee_upgrade_deadline_duration_seconds": { "description": "The grace period duration for expiry of old mpc image hashes once a new one is added.", "type": [ "integer", "null" ], "format": "uint64", "minimum": 0.0 } } }, "InitializingContractState": { "description": "State when the contract is generating keys for new domains.", "type": "object", "required": [ "cancel_votes", "domains", "epoch_id", "generated_keys", "generating_key" ], "properties": { "cancel_votes": { "type": "array", "items": { "$ref": "#/definitions/AuthenticatedParticipantId" }, "uniqueItems": true }, "domains": { "$ref": "#/definitions/DomainRegistry" }, "epoch_id": { "$ref": "#/definitions/EpochId" }, "generated_keys": { "type": "array", "items": { "$ref": "#/definitions/KeyForDomain2" } }, "generating_key": { "$ref": "#/definitions/KeyEvent" } } }, "K256AffinePoint": { "description": "AffinePoint on the Secp256k1 curve", "type": "object", "required": [ "affine_point" ], "properties": { "affine_point": { "type": "string", "pattern": "^(?:[0-9A-Fa-f]{2})*$" } } }, "K256Scalar": { "type": "object", "required": [ "scalar" ], "properties": { "scalar": { "type": "string", "pattern": "^(?:[0-9A-Fa-f]{2})*$" } } }, "KeyEvent": { "description": "Key generation or resharing event state.", "type": "object", "required": [ "domain", "epoch_id", "next_attempt_id", "parameters" ], "properties": { "domain": { "$ref": "#/definitions/DomainConfig" }, "epoch_id": { "$ref": "#/definitions/EpochId" }, "instance": { "anyOf": [ { "$ref": "#/definitions/KeyEventInstance" }, { "type": "null" } ] }, "next_attempt_id": { "$ref": "#/definitions/AttemptId" }, "parameters": { "$ref": "#/definitions/ThresholdParameters" } } }, "KeyEventId": { "description": "A unique identifier for a key event (generation or resharing): `epoch_id`: identifies the ThresholdParameters that this key is intended to function in. `domain_id`: the domain this key is intended for. `attempt_id`: identifies a particular attempt for this key event, in case multiple attempts yielded partially valid results. This is incremented for each attempt within the same epoch and domain.", "type": "object", "required": [ "attempt_id", "domain_id", "epoch_id" ], "properties": { "attempt_id": { "$ref": "#/definitions/AttemptId" }, "domain_id": { "$ref": "#/definitions/DomainId" }, "epoch_id": { "$ref": "#/definitions/EpochId" } } }, "KeyEventInstance": { "description": "State of a key generation/resharing instance.", "type": "object", "required": [ "attempt_id", "completed", "expires_on", "started_in" ], "properties": { "attempt_id": { "$ref": "#/definitions/AttemptId" }, "completed": { "type": "array", "items": { "$ref": "#/definitions/AuthenticatedParticipantId" }, "uniqueItems": true }, "expires_on": { "type": "integer", "format": "uint64", "minimum": 0.0 }, "public_key": { "anyOf": [ { "$ref": "#/definitions/PublicKeyExtended2" }, { "type": "null" } ] }, "started_in": { "type": "integer", "format": "uint64", "minimum": 0.0 } } }, "KeyForDomain": { "description": "The identification of a specific distributed key, based on which a node would know exactly what keyshare it has corresponds to this distributed key. (A distributed key refers to a specific set of keyshares that nodes have which can be pieced together to form the secret key.)", "type": "object", "required": [ "attempt", "domain_id", "key" ], "properties": { "attempt": { "description": "The attempt ID that generated (initially or as a result of resharing) this distributed key. Nodes may have made multiple attempts to generate the distributed key, and this uniquely identifies which one should ultimately be used.", "allOf": [ { "$ref": "#/definitions/AttemptId" } ] }, "domain_id": { "description": "Identifies the domain this key is intended for.", "allOf": [ { "$ref": "#/definitions/DomainId" } ] }, "key": { "description": "Identifies the public key. Although technically redundant given that we have the AttemptId, we keep it here in the contract so that it can be verified against and queried.", "allOf": [ { "$ref": "#/definitions/PublicKeyExtended" } ] } } }, "KeyForDomain2": { "description": "The identification of a specific distributed key, based on which a node would know exactly what keyshare it has corresponds to this distributed key. (A distributed key refers to a specific set of keyshares that nodes have which can be pieced together to form the secret key.)", "type": "object", "required": [ "attempt", "domain_id", "key" ], "properties": { "attempt": { "description": "The attempt ID that generated (initially or as a result of resharing) this distributed key. Nodes may have made multiple attempts to generate the distributed key, and this uniquely identifies which one should ultimately be used.", "allOf": [ { "$ref": "#/definitions/AttemptId" } ] }, "domain_id": { "description": "Identifies the domain this key is intended for.", "allOf": [ { "$ref": "#/definitions/DomainId" } ] }, "key": { "description": "Identifies the public key. Although technically redundant given that we have the AttemptId, we keep it here in the contract so that it can be verified against and queried.", "allOf": [ { "$ref": "#/definitions/PublicKeyExtended2" } ] } } }, "KeyProviderEventDigest": { "type": "string", "maxLength": 96, "minLength": 96, "pattern": "^[0-9a-fA-F]+$" }, "Keyset": { "description": "Represents a key for every domain in a specific epoch.", "type": "object", "required": [ "domains", "epoch_id" ], "properties": { "domains": { "type": "array", "items": { "$ref": "#/definitions/KeyForDomain" } }, "epoch_id": { "$ref": "#/definitions/EpochId" } } }, "Keyset2": { "description": "Represents a key for every domain in a specific epoch.", "type": "object", "required": [ "domains", "epoch_id" ], "properties": { "domains": { "type": "array", "items": { "$ref": "#/definitions/KeyForDomain2" } }, "epoch_id": { "$ref": "#/definitions/EpochId" } } }, "LauncherDockerComposeHash": { "type": "string", "maxLength": 64, "minLength": 64, "pattern": "^[0-9a-fA-F]+$" }, "LauncherHashVotes": { "description": "Tracks votes for adding or removing launcher image hashes. Each participant can have at most one active vote at a time.", "type": "object", "required": [ "vote_by_account" ], "properties": { "vote_by_account": { "type": "object", "additionalProperties": { "$ref": "#/definitions/LauncherVoteAction" } } } }, "LauncherImageHash": { "type": "string", "maxLength": 64, "minLength": 64, "pattern": "^[0-9a-fA-F]+$" }, "LauncherVoteAction": { "description": "The action a participant is voting for on a launcher image hash.", "oneOf": [ { "type": "object", "required": [ "Add" ], "properties": { "Add": { "$ref": "#/definitions/LauncherImageHash" } }, "additionalProperties": false }, { "type": "object", "required": [ "Remove" ], "properties": { "Remove": { "$ref": "#/definitions/LauncherImageHash" } }, "additionalProperties": false } ] }, "MeasurementVoteAction": { "description": "The action a participant is voting for on an OS measurement set.", "oneOf": [ { "type": "object", "required": [ "Add" ], "properties": { "Add": { "$ref": "#/definitions/ContractExpectedMeasurements" } }, "additionalProperties": false }, { "type": "object", "required": [ "Remove" ], "properties": { "Remove": { "$ref": "#/definitions/ContractExpectedMeasurements" } }, "additionalProperties": false } ] }, "MeasurementVotes": { "description": "Tracks votes for adding or removing OS measurements. Each participant can have at most one active vote at a time.", "type": "object", "required": [ "vote_by_account" ], "properties": { "vote_by_account": { "type": "object", "additionalProperties": { "$ref": "#/definitions/MeasurementVoteAction" } } } }, "Metrics": { "type": "object", "required": [ "sign_with_v1_payload_count", "sign_with_v2_payload_count" ], "properties": { "sign_with_v1_payload_count": { "type": "integer", "format": "uint64", "minimum": 0.0 }, "sign_with_v2_payload_count": { "type": "integer", "format": "uint64", "minimum": 0.0 } } }, "MockAttestation": { "oneOf": [ { "description": "Always pass validation", "type": "string", "enum": [ "Valid" ] }, { "description": "Always fails validation", "type": "string", "enum": [ "Invalid" ] }, { "description": "Pass validation depending on the set constraints", "type": "object", "required": [ "WithConstraints" ], "properties": { "WithConstraints": { "type": "object", "properties": { "expected_measurements": { "anyOf": [ { "$ref": "#/definitions/VerifiedMeasurements" }, { "type": "null" } ] }, "expiry_timestamp_seconds": { "description": "Unix time stamp for when this attestation expires.", "type": [ "integer", "null" ], "format": "uint64", "minimum": 0.0 }, "launcher_docker_compose_hash": { "anyOf": [ { "$ref": "#/definitions/LauncherDockerComposeHash" }, { "type": "null" } ] }, "mpc_docker_image_hash": { "anyOf": [ { "$ref": "#/definitions/DockerImageHash" }, { "type": "null" } ] } } } }, "additionalProperties": false } ] }, "MrtdHash": { "type": "string", "maxLength": 96, "minLength": 96, "pattern": "^[0-9a-fA-F]+$" }, "NodeId": { "type": "object", "required": [ "account_id", "account_public_key", "tls_public_key" ], "properties": { "account_id": { "description": "Operator account.", "type": "string" }, "account_public_key": { "description": "Full-access Ed25519 public key of the operator account.", "allOf": [ { "$ref": "#/definitions/Ed25519PublicKey" } ] }, "tls_public_key": { "description": "TLS public key used by the node for peer-to-peer communication.", "allOf": [ { "$ref": "#/definitions/Ed25519PublicKey" } ] } } }, "NonEmptyBTreeSet_RpcProvider": { "type": "array", "items": { "$ref": "#/definitions/RpcProvider" }, "minItems": 1, "uniqueItems": true }, "ParticipantId": { "description": "Stable identifier for a participant within the MPC protocol's participant set.", "type": "integer", "format": "uint32", "minimum": 0.0 }, "ParticipantInfo": { "type": "object", "required": [ "tls_public_key", "url" ], "properties": { "tls_public_key": { "$ref": "#/definitions/Ed25519PublicKey" }, "url": { "type": "string" } } }, "Participants": { "description": "DTO representation of the contract-internal `Participants` type.\n\nIt decouples the JSON wire format (used in view methods like `state()` via [`ThresholdParameters`](crate::types::state::ThresholdParameters)) from the internal `Participants` representation, allowing internal changes (e.g., migrating to [`BTreeMap`](std::collections::BTreeMap) in [#1861](https://github.com/near/mpc/pull/1861)) without breaking the public API.", "type": "object", "required": [ "next_id", "participants" ], "properties": { "next_id": { "$ref": "#/definitions/ParticipantId" }, "participants": { "type": "array", "items": { "type": "array", "items": [ { "description": "NEAR Account Identifier.\n\nThis is a unique, syntactically valid, human-readable account identifier on the NEAR network.\n\n[See the crate-level docs for information about validation.](index.html#account-id-rules)\n\nAlso see [Error kind precedence](AccountId#error-kind-precedence).\n\n## Examples\n\n``` use near_account_id::AccountId;\n\nlet alice: AccountId = \"alice.near\".parse().unwrap();\n\nassert!(\"ƒelicia.near\".parse::().is_err()); // (ƒ is not f) ```", "type": "string" }, { "$ref": "#/definitions/ParticipantId" }, { "$ref": "#/definitions/ParticipantInfo" } ], "maxItems": 3, "minItems": 3 } } } }, "Payload": { "description": "A signature payload; the right payload must be passed in for the curve. The json encoding for this payload converts the bytes to hex string.", "oneOf": [ { "type": "object", "required": [ "Ecdsa" ], "properties": { "Ecdsa": { "$ref": "#/definitions/HexString_Min32_Max32" } }, "additionalProperties": false }, { "type": "object", "required": [ "Eddsa" ], "properties": { "Eddsa": { "$ref": "#/definitions/HexString_Min32_Max1232" } }, "additionalProperties": false } ] }, "PromiseOrValueCKDResponse": { "type": "object", "required": [ "big_c", "big_y" ], "properties": { "big_c": { "$ref": "#/definitions/Bls12381G1PublicKey" }, "big_y": { "$ref": "#/definitions/Bls12381G1PublicKey" } } }, "PromiseOrValueSignatureResponse": { "oneOf": [ { "type": "object", "required": [ "big_r", "recovery_id", "s", "scheme" ], "properties": { "big_r": { "$ref": "#/definitions/K256AffinePoint" }, "recovery_id": { "type": "integer", "format": "uint8", "minimum": 0.0 }, "s": { "$ref": "#/definitions/K256Scalar" }, "scheme": { "type": "string", "enum": [ "Secp256k1" ] } } }, { "type": "object", "required": [ "scheme", "signature" ], "properties": { "scheme": { "type": "string", "enum": [ "Ed25519" ] }, "signature": { "$ref": "#/definitions/Ed25519Signature" } } } ] }, "PromiseOrValueVerifyForeignTransactionResponse": { "type": "object", "required": [ "payload_hash", "signature" ], "properties": { "payload_hash": { "$ref": "#/definitions/Hash256" }, "signature": { "$ref": "#/definitions/SignatureResponse" } } }, "ProposedThresholdParameters": { "description": "A proposed set of threshold parameters submitted to `vote_new_parameters`: the proposed [`ThresholdParameters`] plus per-domain `ReconstructionThreshold` updates for the resharing it would trigger. An empty `per_domain_thresholds` keeps the current ones; a populated map must reference only existing domains (contract-validated), is applied to the `DomainRegistry` on resharing, and never persists onto the stored [`ThresholdParameters`].", "type": "object", "required": [ "parameters" ], "properties": { "parameters": { "$ref": "#/definitions/ThresholdParameters" }, "per_domain_thresholds": { "default": {}, "type": "object", "additionalProperties": { "type": "integer", "format": "uint64", "minimum": 0.0 } } } }, "ProposedUpdates": { "type": "object", "required": [ "updates", "votes" ], "properties": { "updates": { "type": "object", "additionalProperties": { "$ref": "#/definitions/UpdateHash" } }, "votes": { "type": "object", "additionalProperties": { "type": "integer", "format": "uint64", "minimum": 0.0 } } } }, "Protocol": { "description": "MPC protocol run for a domain.", "type": "string", "enum": [ "CaitSith", "Frost", "ConfidentialKeyDerivation", "DamgardEtAl" ] }, "ProtocolContractState": { "description": "The main protocol contract state enum.", "oneOf": [ { "type": "string", "enum": [ "NotInitialized" ] }, { "type": "object", "required": [ "Initializing" ], "properties": { "Initializing": { "$ref": "#/definitions/InitializingContractState" } }, "additionalProperties": false }, { "type": "object", "required": [ "Running" ], "properties": { "Running": { "$ref": "#/definitions/RunningContractState" } }, "additionalProperties": false }, { "type": "object", "required": [ "Resharing" ], "properties": { "Resharing": { "$ref": "#/definitions/ResharingContractState" } }, "additionalProperties": false } ] }, "PublicKey": { "oneOf": [ { "type": "object", "required": [ "Secp256k1" ], "properties": { "Secp256k1": { "$ref": "#/definitions/Secp256k1PublicKey" } }, "additionalProperties": false }, { "type": "object", "required": [ "Ed25519" ], "properties": { "Ed25519": { "$ref": "#/definitions/Ed25519PublicKey" } }, "additionalProperties": false }, { "type": "object", "required": [ "Bls12381" ], "properties": { "Bls12381": { "$ref": "#/definitions/Bls12381G2PublicKey" } }, "additionalProperties": false } ] }, "PublicKeyExtended": { "oneOf": [ { "type": "object", "required": [ "Secp256k1" ], "properties": { "Secp256k1": { "type": "object", "required": [ "near_public_key" ], "properties": { "near_public_key": { "type": "string" } } } }, "additionalProperties": false }, { "type": "object", "required": [ "Ed25519" ], "properties": { "Ed25519": { "type": "object", "required": [ "edwards_point", "near_public_key_compressed" ], "properties": { "edwards_point": { "description": "Decompressed Edwards point used for curve arithmetic operations.", "allOf": [ { "$ref": "#/definitions/SerializableEdwardsPoint" } ] }, "near_public_key_compressed": { "description": "Serialized compressed Edwards-y point.", "type": "string" } } } }, "additionalProperties": false }, { "type": "object", "required": [ "Bls12381" ], "properties": { "Bls12381": { "type": "object", "required": [ "public_key" ], "properties": { "public_key": { "$ref": "#/definitions/PublicKey" } } } }, "additionalProperties": false } ] }, "PublicKeyExtended2": { "description": "Extended public key representation for different signature schemes.", "oneOf": [ { "description": "Secp256k1 public key (ECDSA).", "type": "object", "required": [ "Secp256k1" ], "properties": { "Secp256k1": { "type": "object", "required": [ "near_public_key" ], "properties": { "near_public_key": { "description": "The public key in NEAR SDK format (string representation).", "type": "string" } } } }, "additionalProperties": false }, { "description": "Ed25519 public key.", "type": "object", "required": [ "Ed25519" ], "properties": { "Ed25519": { "type": "object", "required": [ "edwards_point", "near_public_key_compressed" ], "properties": { "edwards_point": { "description": "The Edwards point (32 bytes).", "type": "array", "items": { "type": "integer", "format": "uint8", "minimum": 0.0 }, "maxItems": 32, "minItems": 32 }, "near_public_key_compressed": { "description": "The compressed public key in NEAR SDK format.", "type": "string" } } } }, "additionalProperties": false }, { "description": "BLS12-381 public key.", "type": "object", "required": [ "Bls12381" ], "properties": { "Bls12381": { "type": "object", "required": [ "public_key" ], "properties": { "public_key": { "description": "The public key.", "allOf": [ { "$ref": "#/definitions/PublicKey" } ] } } } }, "additionalProperties": false } ] }, "ResharingContractState": { "description": "State when the contract is resharing keys to new participants.", "type": "object", "required": [ "cancellation_requests", "previous_running_state", "reshared_keys", "resharing_key" ], "properties": { "cancellation_requests": { "type": "array", "items": { "$ref": "#/definitions/AuthenticatedAccountId" }, "uniqueItems": true }, "per_domain_thresholds": { "description": "Per-domain `ReconstructionThreshold` updates carried from the accepted proposal. Applied to the `DomainRegistry` when resharing completes.", "default": {}, "type": "object", "additionalProperties": { "type": "integer", "format": "uint64", "minimum": 0.0 } }, "previous_running_state": { "$ref": "#/definitions/RunningContractState" }, "reshared_keys": { "type": "array", "items": { "$ref": "#/definitions/KeyForDomain2" } }, "resharing_key": { "$ref": "#/definitions/KeyEvent" } } }, "RpcProvider": { "type": "object", "required": [ "rpc_url" ], "properties": { "rpc_url": { "type": "string" } } }, "Rtmr0Hash": { "type": "string", "maxLength": 96, "minLength": 96, "pattern": "^[0-9a-fA-F]+$" }, "Rtmr1Hash": { "type": "string", "maxLength": 96, "minLength": 96, "pattern": "^[0-9a-fA-F]+$" }, "Rtmr2Hash": { "type": "string", "maxLength": 96, "minLength": 96, "pattern": "^[0-9a-fA-F]+$" }, "RunningContractState": { "description": "State when the contract is ready for signature operations.", "type": "object", "required": [ "add_domains_votes", "domains", "keyset", "parameters", "parameters_votes" ], "properties": { "add_domains_votes": { "$ref": "#/definitions/AddDomainsVotes" }, "domains": { "$ref": "#/definitions/DomainRegistry" }, "keyset": { "$ref": "#/definitions/Keyset2" }, "parameters": { "$ref": "#/definitions/ThresholdParameters" }, "parameters_votes": { "$ref": "#/definitions/ThresholdParametersVotes" }, "previously_cancelled_resharing_epoch_id": { "anyOf": [ { "$ref": "#/definitions/EpochId" }, { "type": "null" } ] } } }, "Secp256k1PublicKey": { "type": "string" }, "SerializableEdwardsPoint": { "type": "array", "items": { "type": "integer", "format": "uint8", "minimum": 0.0 }, "maxItems": 32, "minItems": 32 }, "Sha384Digest": { "type": "string", "maxLength": 96, "minLength": 96, "pattern": "^[0-9a-fA-F]+$" }, "SignRequestArgs": { "description": "Sign request args with backward-compatible deserialization.\n\nThe struct field is `payload` but serializes as `payload_v2` on the wire for compatibility with existing consumers. Deserialization accepts both `payload_v2` and the deprecated `payload` (as raw `[u8; 32]`) plus `key_version` as an alias for `domain_id`.", "type": "object", "required": [ "domain_id", "path", "payload_v2" ], "properties": { "domain_id": { "$ref": "#/definitions/DomainId" }, "path": { "type": "string" }, "payload_v2": { "$ref": "#/definitions/Payload" } } }, "SignatureRequest": { "description": "A signature request after computing the tweak from the caller's account and derivation path. This is what gets stored in the contract state and sent back to the respond function.", "type": "object", "required": [ "domain_id", "payload", "tweak" ], "properties": { "domain_id": { "$ref": "#/definitions/DomainId" }, "payload": { "$ref": "#/definitions/Payload" }, "tweak": { "$ref": "#/definitions/Tweak" } } }, "SignatureResponse": { "oneOf": [ { "type": "object", "required": [ "big_r", "recovery_id", "s", "scheme" ], "properties": { "big_r": { "$ref": "#/definitions/K256AffinePoint" }, "recovery_id": { "type": "integer", "format": "uint8", "minimum": 0.0 }, "s": { "$ref": "#/definitions/K256Scalar" }, "scheme": { "type": "string", "enum": [ "Secp256k1" ] } } }, { "type": "object", "required": [ "scheme", "signature" ], "properties": { "scheme": { "type": "string", "enum": [ "Ed25519" ] }, "signature": { "$ref": "#/definitions/Ed25519Signature" } } } ] }, "SolanaExtractor": { "oneOf": [ { "type": "object", "required": [ "SolanaProgramIdIndex" ], "properties": { "SolanaProgramIdIndex": { "type": "object", "required": [ "ix_index" ], "properties": { "ix_index": { "type": "integer", "format": "uint32", "minimum": 0.0 } } } }, "additionalProperties": false }, { "type": "object", "required": [ "SolanaDataHash" ], "properties": { "SolanaDataHash": { "type": "object", "required": [ "ix_index" ], "properties": { "ix_index": { "type": "integer", "format": "uint32", "minimum": 0.0 } } } }, "additionalProperties": false } ] }, "SolanaFinality": { "type": "string", "enum": [ "Processed", "Confirmed", "Finalized" ] }, "SolanaRpcRequest": { "type": "object", "required": [ "extractors", "finality", "tx_id" ], "properties": { "extractors": { "type": "array", "items": { "$ref": "#/definitions/SolanaExtractor" } }, "finality": { "$ref": "#/definitions/SolanaFinality" }, "tx_id": { "$ref": "#/definitions/SolanaTxId" } } }, "SolanaTxId": { "type": "array", "items": { "type": "integer", "format": "uint8", "minimum": 0.0 } }, "StarknetExtractor": { "oneOf": [ { "type": "string", "enum": [ "BlockHash" ] }, { "type": "object", "required": [ "Log" ], "properties": { "Log": { "type": "object", "required": [ "log_index" ], "properties": { "log_index": { "type": "integer", "format": "uint64", "minimum": 0.0 } } } }, "additionalProperties": false } ] }, "StarknetFelt": { "type": "string", "pattern": "^(?:[0-9A-Fa-f]{2})*$" }, "StarknetFinality": { "type": "string", "enum": [ "AcceptedOnL2", "AcceptedOnL1" ] }, "StarknetRpcRequest": { "type": "object", "required": [ "extractors", "finality", "tx_id" ], "properties": { "extractors": { "type": "array", "items": { "$ref": "#/definitions/StarknetExtractor" } }, "finality": { "$ref": "#/definitions/StarknetFinality" }, "tx_id": { "$ref": "#/definitions/StarknetTxId" } } }, "StarknetTxId": { "$ref": "#/definitions/StarknetFelt" }, "SupportedForeignChains": { "type": "array", "items": { "$ref": "#/definitions/ForeignChain" }, "uniqueItems": true }, "TcbInfo": { "description": "Trusted Computing Base information structure", "type": "object", "required": [ "app_compose", "compose_hash", "device_id", "event_log", "mrtd", "rtmr0", "rtmr1", "rtmr2", "rtmr3" ], "properties": { "app_compose": { "description": "The app compose", "type": "string" }, "compose_hash": { "description": "The hash of the compose configuration", "type": "string" }, "device_id": { "description": "The device identifier", "type": "string" }, "event_log": { "description": "The event log entries", "type": "array", "items": { "$ref": "#/definitions/EventLog" } }, "mrtd": { "description": "The measurement root of trust", "type": "string" }, "os_image_hash": { "description": "The hash of the OS image. This is empty if the OS image is not measured by KMS.", "default": "", "type": "string" }, "rtmr0": { "description": "The value of RTMR0 (Runtime Measurement Register 0)", "type": "string" }, "rtmr1": { "description": "The value of RTMR1 (Runtime Measurement Register 1)", "type": "string" }, "rtmr2": { "description": "The value of RTMR2 (Runtime Measurement Register 2)", "type": "string" }, "rtmr3": { "description": "The value of RTMR3 (Runtime Measurement Register 3)", "type": "string" } } }, "TeeVerifierCodeHash": { "type": "string", "maxLength": 64, "minLength": 64, "pattern": "^[0-9a-fA-F]+$" }, "Threshold": { "description": "Cryptographic threshold (`k`) for a distributed key: the minimum number of participants that must collaborate to produce a signature.", "type": "integer", "format": "uint64", "minimum": 0.0 }, "ThresholdParameters": { "description": "Threshold parameters for distributed key operations: the current participant set and the governance threshold. This is the stored, always-current shape; per-domain reconstruction-threshold *proposals* live on [`ProposedThresholdParameters`].", "type": "object", "required": [ "participants", "threshold" ], "properties": { "participants": { "$ref": "#/definitions/Participants" }, "threshold": { "$ref": "#/definitions/Threshold" } } }, "ThresholdParametersVotes": { "description": "Votes for threshold parameter changes.", "type": "object", "required": [ "proposal_by_account" ], "properties": { "proposal_by_account": { "type": "object", "additionalProperties": { "$ref": "#/definitions/ProposedThresholdParameters" } } } }, "TonAddress": { "type": "object", "required": [ "hash", "workchain" ], "properties": { "hash": { "$ref": "#/definitions/Hash256" }, "workchain": { "type": "integer", "format": "int32" } } }, "TonExtractor": { "oneOf": [ { "type": "object", "required": [ "Log" ], "properties": { "Log": { "type": "object", "required": [ "message_index" ], "properties": { "message_index": { "type": "integer", "format": "uint64", "minimum": 0.0 } } } }, "additionalProperties": false } ] }, "TonFinality": { "type": "string", "enum": [ "MasterchainIncluded" ] }, "TonRpcRequest": { "type": "object", "required": [ "account", "extractors", "finality", "tx_id" ], "properties": { "account": { "$ref": "#/definitions/TonAddress" }, "extractors": { "type": "array", "items": { "$ref": "#/definitions/TonExtractor" } }, "finality": { "$ref": "#/definitions/TonFinality" }, "tx_id": { "$ref": "#/definitions/TonTxId" } } }, "TonTxId": { "type": "string", "pattern": "^(?:[0-9A-Fa-f]{2})*$" }, "Tweak": { "type": "array", "items": { "type": "integer", "format": "uint8", "minimum": 0.0 }, "maxItems": 32, "minItems": 32 }, "UpdateHash": { "description": "An update hash", "oneOf": [ { "type": "object", "required": [ "Code" ], "properties": { "Code": { "type": "array", "items": { "type": "integer", "format": "uint8", "minimum": 0.0 }, "maxItems": 32, "minItems": 32 } }, "additionalProperties": false }, { "type": "object", "required": [ "Config" ], "properties": { "Config": { "type": "array", "items": { "type": "integer", "format": "uint8", "minimum": 0.0 }, "maxItems": 32, "minItems": 32 } }, "additionalProperties": false } ] }, "UpdateId": { "type": "integer", "format": "uint64", "minimum": 0.0 }, "VerifiedAttestation": { "oneOf": [ { "type": "object", "required": [ "Dstack" ], "properties": { "Dstack": { "$ref": "#/definitions/VerifiedDstackAttestation" } }, "additionalProperties": false }, { "type": "object", "required": [ "Mock" ], "properties": { "Mock": { "$ref": "#/definitions/MockAttestation" } }, "additionalProperties": false } ] }, "VerifiedDstackAttestation": { "type": "object", "required": [ "expiry_timestamp_seconds", "launcher_compose_hash", "measurements", "mpc_image_hash" ], "properties": { "expiry_timestamp_seconds": { "description": "Unix time stamp for when this attestation expires.", "type": "integer", "format": "uint64", "minimum": 0.0 }, "launcher_compose_hash": { "description": "The digest of the launcher compose file running.", "allOf": [ { "$ref": "#/definitions/LauncherDockerComposeHash" } ] }, "measurements": { "description": "The OS measurements that were verified during initial attestation.", "allOf": [ { "$ref": "#/definitions/VerifiedMeasurements" } ] }, "mpc_image_hash": { "description": "The digest of the MPC image running.", "allOf": [ { "$ref": "#/definitions/DockerImageHash" } ] } } }, "VerifiedMeasurements": { "type": "object", "required": [ "key_provider_event_digest", "mrtd", "rtmr0", "rtmr1", "rtmr2" ], "properties": { "key_provider_event_digest": { "$ref": "#/definitions/Sha384Digest" }, "mrtd": { "$ref": "#/definitions/Sha384Digest" }, "rtmr0": { "$ref": "#/definitions/Sha384Digest" }, "rtmr1": { "$ref": "#/definitions/Sha384Digest" }, "rtmr2": { "$ref": "#/definitions/Sha384Digest" } } }, "VerifyForeignTransactionRequest": { "type": "object", "required": [ "domain_id", "payload_version", "request" ], "properties": { "domain_id": { "$ref": "#/definitions/DomainId" }, "payload_version": { "type": "integer", "format": "uint8", "minimum": 0.0 }, "request": { "$ref": "#/definitions/ForeignChainRpcRequest" } } }, "VerifyForeignTransactionRequestArgs": { "type": "object", "required": [ "domain_id", "payload_version", "request" ], "properties": { "domain_id": { "$ref": "#/definitions/DomainId" }, "payload_version": { "type": "integer", "format": "uint8", "minimum": 0.0 }, "request": { "$ref": "#/definitions/ForeignChainRpcRequest" } } }, "VerifyForeignTransactionResponse": { "type": "object", "required": [ "payload_hash", "signature" ], "properties": { "payload_hash": { "$ref": "#/definitions/Hash256" }, "signature": { "$ref": "#/definitions/SignatureResponse" } } }, "YieldIndex": { "description": "The index into calling the YieldResume feature of NEAR. This will allow to resume a yield call after the contract has been called back via this index.", "type": "object", "required": [ "data_id" ], "properties": { "data_id": { "type": "array", "items": { "type": "integer", "format": "uint8", "minimum": 0.0 }, "maxItems": 32, "minItems": 32 } } } } } } }