Cordial Systems Treasury Documentation
website·Indexed 33 days ago
https://docs.cordialsystems.comDocumentation for Treasury, an MPC-based custody solution for blockchain assets. Includes guides on deployment, the Cordial Scripting Language (CSL), Treasury CLI, Oracle API, and native support for staking and Bitcoin Taproot.
What's inside Cordial Systems
- Cordial Treasury is designed to safeguard digital assets by addressing two primary goals: protecting key access (ensuring keys cannot be copied or removed from secure environments) and protecting key use (ensuring keys only sign authorized requests). It achieves this by combining MPC (Multi-Party Computation) with integrated policy engines and BFT (Byzantine Fault Tolerant) consensus across nodes. Treasury is chain-agnostic, supporting over 30 chains and any chain compatible with ECDSA and Ed25519 signing protocols.
Overview of Treasury Staking
Treasury provides a uniform interface for delegated staking across supported chains, including Solana, Cosmos, and Ethereum. It uses native staking transactions to ensure clear signing, avoiding the security risks associated with blind signing. Staking typically involves moving assets into a locked state to accrue rewards, with state transitions often subject to bonding and unbonding periods (e.g., moving fromactivatingtoactiveordeactivatingtoinactive).Overview of Treasury MPC Custody Solution
Treasury is an MPC-based (Multi-Party Computation) custody solution designed to eliminate single points of compromise. It can be fully self-hosted or co-hosted with secure operating partners. To ensure consistency across participants and prevent illegal transactions, it utilizes a BFT consensus implementation viacometbft.Get started with Cordial Treasury using the treasury CLI
To interact with a Cordial Treasury deployment, use thetreasurycommand line tool and the Cordial Scripting Language (CSL). Thetreasury scriptcommand provides an interactive interpreter for executing operations against a treasury instance.treasury scriptUnderstand Transfer Rule evaluation logic
Every
Transferoperation requires a matching transfer rule to be permitted. If no matchingallowrule exists, the transfer is rejected by default. For a transfer to be successful, the following conditions must be met:- At least one matching
allowrule must exist. - No matching
denyrules must exist (deny rules always take precedence). - All matching
requirerules must evaluate to true.
- At least one matching
Treasury production hardware requirements
For each Treasury node in a production instance, the following hardware specifications are recommended:
- CPU: 2x CPU (AMD64 or ARM64 architecture)
- RAM: 8 GB
- Disk: 50 GB SSD
Get details for a specific transaction
Retrieve detailed information about a specific transaction using its transaction hash, including amount, fees, sender, and recipient.curl --request GET \ --url "$BASE_URL/v1/chains/ETH/transactions/0xa52c92804ec2bd2436cc048d663e2d916e0433f009e75df8b1084356177de713" \ -u $API_ID:$API_SECRETUnderstand Cordial Systems Encryption at Rest (EAR)
When Encryption at Rest (EAR) is configured, all data is encrypted using the AES-128-GCM-SIV authenticated cipher. This ensures that the integrity of the data is verified during decryption; if the decryption is incorrect or the data has been tampered with, the process will fail.Understand Cordial API resource naming conventions
Every resource in the system is uniquely identified by a name that is immutable and URL-safe (no percent encoding required). A resource's current representation can be retrieved via an HTTP GET request using its name as the path. Names are composed of ID segments alternating between collection IDs and resource IDs. Basic IDs must be non-zero length and consist of alphanumeric characters, dashes, or underscores (matching the regex[A-Za-z0-9_-]+).Understand the Treasury transaction lifecycle
Treasury uses an intent-based API where a resource (like a
Transfer) is created first. The system then follows these steps to execute the transaction:- Intent Creation: A resource (e.g.,
Transfer) is created to define the goal (e.g., "move Bitcoin from A to B"). - Policy Check: The request is validated against policies. It is either rejected or moved to an
authorizingstate if additional approvals are needed. - Input Fetching: A "connecting" node fetches blockchain-specific inputs (fees, sequence numbers, UTXOs) via the Connector API or a custom RPC endpoint.
- Serialization: The transaction is serialized for the specific blockchain and a signature request is generated.
- Signing: The serialized transaction is signed by the signing service.
- Broadcasting: The signed transaction is broadcast to the blockchain via the connecting node.
- Confirmation: The transaction is polled on-chain and updated in Treasury until it reaches sufficient confirmations.
- Intent Creation: A resource (e.g.,
Understand the Cordial universal transaction schema
Cordial reports transactions in a universal format regardless of the underlying blockchain. The schema is hierarchical:
- Transaction: The top-level object.
- Movements: A transaction can contain multiple movements.
- Balance Changes: Each movement contains an array of balance changes, where each change specifies an asset and the address affected.
Chain-specific modeling:
- Account-based chains (e.g., Solana, EVM): Transfers are modeled as multiple movements, each containing two balance changes (one for the sender and one for the receiver).
- UTXO-based chains (e.g., Sui, Bitcoin): Transfers are modeled as a single movement per asset, containing balance changes for all involved senders and receivers.
Understand Cordial Treasury API architecture
The Cordial Treasury API is a collaborative, permissioned, resource-oriented REST API. All client-visible state is modeled as resources. Key characteristics include:
- Collaborative: Requests are signed by a user and may require additional signatures from other users for approval.
- Permissioned: Access is controlled by a granular policy consisting of rules (which are themselves resources).
- Resource-Oriented: State is managed via CRUD operations on uniquely named resources.