What is Clef?
Clef is a tool for signing transactions and data in a secure local environment. It is intended to become a more composable and secure replacement for Parallax client’s built-in account management. Clef decouples key management from the Parallax client itself, meaning it can be used as an independent, standalone key management and signing application, or it can be integrated into the Parallax client. This provides a more flexible modular tool compared to the Parallax client’s account manager. Clef can be used safely in situations where access to Parallax is via a remote and/or untrusted node because signing happens locally, either manually or automatically using custom rulesets. The separation of Clef from the node itself enables it to run as a daemon on the same machine as the client software, on a secure usb-stick like USB armory, or even a separate VM in a QubesOS type setup.Installing and starting Clef
Clef comes bundled with the Parallax client and can be built along with the client and the other bundled tools using:Security model
One of the major benefits of Clef is that it is decoupled from the client software, meaning it can be used by users and dapps to sign data and transactions in a secure, local environment and send the signed packet to an arbitrary Parallax entry-point, which might include, for example, an untrusted remote node. Alternatively, Clef can simply be used as a standalone, composable signer that can be a backend component for decentralized applications. This requires a secure architecture that separates cryptographic operations from user interactions and internal/external communication. The security model of Clef is as follows:- A self-contained binary controls all cryptographic operations including encryption, decryption and storage of keystore files, and signing data and transactions.
- A well defined, deliberately minimal “external” API is used to communicate with the Clef binary - Clef considers this external traffic to be UNTRUSTED. This means Clef does not accept any credentials and does not recognize authority of requests received over this channel. Clef listens on
http.addr:http.port
oripcpath
- the same as the Parallax client - and expects messages to be formatted using the JSON-RPC 2.0 standard. Some of the external API calls require some user interaction (manual approve/deny)- if it is not received responses can be delayed indefinitely. - Clef communicates with the process that invoked the binary using stin/stout. The process invoking the binary is usually the native console-based user interface (UI) but there is also an API that enables communication with an external UI. This has to be enabled using
--stdio-ui
at startup. This channel is considered TRUSTED and is used to pass approvals and passwords between the user and Clef. - Clef does not store keys - the user is responsible for securely storing and backing up keyfiles. Clef does store account passwords in its encrypted vault if they are explicitly provided to Clef by the user to enable automatic account unlocking.

--signer <addr>:<port>
and would relay requests to eth.sendTransaction
. Text in mono font positioned along arrows shows the objects passed between each component.
Most users use Clef by manually approving transactions through the UI as in the schematic above, but it is also possible to configure Clef to sign transactions without always prompting the user. This requires defining the precise conditions under which a transaction will be signed. These conditions are known as Rules and they are small Javascript snippets that are attested by the user by injecting the snippet’s hash into Clef’s secure whitelist. Clef is then started with the rule file, so that requests that satisfy the conditions in the whitelisted rule files are automatically signed. This is covered in detail on the Rules page.
Basic usage
Clef is started on the command line using the clef command. Clef can be configured by providing flags and commands to clef on startup. The full list of command line options is available below. Frequently used options include--keystore
and --chainid
which configure the path to an existing keystore and a network to connect to. These options default to $HOME/.parallax/keystore
and 52014 (corresponding to Parallax mainnet) respectively. The following code snippet starts Clef, providing a custom path to an existing keystore and connecting to the Parallax testnet: