This documentation contains a set of Python classes which intend to abstract away the technical complexities of using Zymbit's hardware wallet with various blockchains.
The first iteration of the SDK encapsulates all wallet creation, management, and use (sending transactions and interacting with dApps) capabilities for Ethereum and EVM compatible chains.
To see examples of the Python SDK in use, check out this tutorial
pip install zymbitwalletsdk
The EthAccount class definition
This class provides access to EthAccount within Python.
EthAccount extends the Account abstract class.
Initialize an instance of an EthAccount context
Serialize the EthAccount object
Retrieve the public key associated with the Ethereum account
The EllipticCurve class definition
This class represents an enumeration of elliptic curves available on Zymbit's hardware wallet and extends the Python Enum class.
An enumeration value representing the secp256k1 elliptic curve, used in Ethereum and Bitcoin.
An enumeration value representing the secp256r1 elliptic curve, also known as nist256 or prime256v1.
An enumeration value representing the Ed25519 elliptic curve, used in Cardano, Solana, Polkadot, and Monero to name a few
Returns the string representation of the elliptic curve type.
The ZymbitEthKeyring class definition
This class provides access to ZymbitEthKeyring within Python.
ZymbitEthKeyring extends the Keyring abstract class.
A class level variable set to "ETH"
A class level variable set to "m/44'/60'/0'/0"
A class level variable set to EllipticCurve.secp256k1
Initialize an instance of a ZymbitEthKeyring context. Internally calls deserialize(wallet_name, master_slot)
and makes some basic checks.
Serialize the ZymbitEthKeyring instance.
Deserializes a keyring using either a wallet name or a master slot to restore an instance of a ZymbitEthKeyring context.
Add an Ethereum account to the keyring at the specified index.
Add multiple Ethereum accounts to the keyring.
Add Ethereum accounts to the keyring at specified indexes from a list.
Get a list of Ethereum accounts in the keyring.
Remove an Ethereum account from the keyring by its address, slot, or path.
Retrieve the public key of an Ethereum account in the keyring by its address, slot, or path.
Sign an Ethereum transaction using an account in the keyring by its address, slot, or path.
Sign a message using an account in the keyring by its address, slot, or path.
Generates an Ethereum address using the provided slot.
Checks if an account with the given index exists in the keyring.
Converts a given Crypto.Hash digest to its hexadecimal representation.
The ZymbitKeyringManager class definition
This class provides access to ZymbitKeyringManager within Python.
Initializes an instance of a KeyringManager with an optional list of Keyring objects.
Creates a new keyring of the specified type, associates it with a wallet name, and optionally initializes it with a master generation key.
Adds a keyring instance to the list of keyrings
Retrieves a keyring instance from the list of keyrings by either the wallet name or the master slot.
Retrieves the list of keyring instances stored in the KeyringManager.
Removes a keyring instance from the list of keyrings in the KeyringManager and deletes all related keys from the module by either the wallet name or the master slot. If the 'remove_master' flag is set to True, the method will also remove the master key associated with the keyring.
The EthTransaction class definition
This class represents an Ethereum transaction according to the EIP-1559 standard and extends the rlp.Serializable class.
An integer value of 2, representing the EIP-1559 transaction type.
A list of fields that are relevant to a raw EIP-1559 transaction. The fields are:
The SignedEthTransaction class definition
This class represents a signed Ethereum transaction according to the EIP-1559 standard and extends the rlp.Serializable class.
An integer value of 2, representing the EIP-1559 transaction type.
A list of fields that are relevant to a raw EIP-1559 transaction. The fields are:
The EthConnect class definition
This class contains an assortment of static methods which allow you to use the accounts in your ZymbitEthKeyring instances to sign Ethereum transactions and messages
Create and return an EthTransaction object with the specified parameters.
Create an EthTransaction object for deploying a smart contract with the provided parameters, bytecode, and ABI.
Create a transaction to execute a function of a smart contract on an Ethereum network.
Signs an Ethereum transaction using a Zymbit keyring.
Serialize an EthTransaction or SignedEthTransaction object using RLP encoding.
Deserialize an RLP-encoded transaction to either an EthTransaction or a SignedEthTransaction object.
Create an Ethereum message to be signed. Prepends the message that is passed in with "Ethereum Signed Message:\n"
Sign a message using an account in the keyring by its address, slot, or path.
Generate a Keccak256 hash digest from the given string or bytes data.
Generate a SHA256 hash digest from the given string or bytes data.
Converts a given amount in Ether to its equivalent value in Wei.
If you are a developer interested in creating your own custom implementations of Accounts and/or Keyrings to work with ZymbitKeyringManager
, we encourage you to explore our Github repository. By extending the Account and Keyring Abstract Base Classes (ABCs), you can implement the required methods and any additional functionality as needed. The elliptic curves we support (secp256k1, secp256r1, and ed25519) are used by many major blockchains, including Bitcoin, Ethereum, Cardano, Solana, and Polkadot. Developing your own keyrings can be incredibly beneficial for a wide range of applications, such as key management or on-chain interactions like sending transactions or interacting with smart contracts.