Supported Networks
Supported Networks
While you can sign transactions for any network using Eddsa or Ecdsa keys, each chain signs transactions differently.Our example implementation shows you how to sign transactions for: Bitcoin, Solana, Cosmos, XRP, Aptos, Sui and EVM networks (Ethereum, Base, BNB Chain, Avalanche, Polygon, Arbitrum, and more).
Create a Chain Signature
There are five steps to create a Chain Signature:- Deriving the Foreign Address - Derive the address that will be controlled on the target blockchain.
- Creating a Transaction - Create the transaction or message to be signed.
- Requesting a Signature - Call the NEAR MPC contract requesting it to sign the transaction.
- Formatting the Signature - Format the signature from the MPC contract and add it to the transaction.
- Relaying the Signed Transaction - Send the signed transaction to the destination chain for execution.

@hot-labs/near-connect for wallet connections and transaction signing, and near-api-js for NEAR queries. Its NearProvider exposes the connected account and signAndSendTransactions through the local useNearWallet hook.
MPC ContractsThere is an MPC contract available on both
mainnet and testnet:- Mainnet:
v1.signer - Testnet:
v1.signer-prod.testnet
v1.signer: see The MPC network today.Chain Signatures Contract
To interact with the chain signatures library you first need to instantiate aChainSignaturesContract.
config.js
networkId and contractId are set to the values specified in the previous section depending which network you are on.
Chain Adapters
To interact with a specific chain, you need to instantiate the relevantchainAdapter.
- Ξ EVM
- ₿ Bitcoin
- ◎ Solana
- ◉ XRP
- ◈ SUI
- ⬟ Aptos
EVM.jsx
ChainSignaturesContract as an argument as well as publicClient which is constructed from an EVM RPC URL.1. Deriving the Foreign Address
Chain Signatures usederivation paths to represent accounts on the target blockchain. The foreign address to be controlled can be deterministically derived from:
- The NEAR account calling the MPC contract (e.g.,
example.near,example.testnet, etc.) - A derivation path (a string such as
ethereum-1,ethereum-2, etc.) - The MPC service’s master public key (we don’t need to worry about this as it is defined in the library we’re using).
deriveAddressAndPublicKey method passing the near account Id from which the address is being derived and the derivation path.
- Ξ EVM
- ₿ Bitcoin
- ◎ Solana
- ◉ XRP
- ◈ SUI
- ⬟ Aptos
EVM.jsx
The same NEAR account and path will always produce the same address on the target blockchain.
example.near+ethereum-1=0x1b48b83a308ea4beb845db088180dc3389f8aa3bexample.near+ethereum-2=0x99c5d3025dc736541f2d97c3ef3c90de4d221315
2. Creating the Transaction
To construct the transaction to be signed use the methodprepareTransactionForSigning.
- Ξ EVM
- ₿ Bitcoin
- ◎ Solana
- ◉ XRP
- ◈ SUI
- ⬟ Aptos
Constructing a transaction to transfer ETH is very simple. The This method returns the
value is the amount of ETH in Wei as type BigInt (1 ETH = 1018 Wei).Transfer.jsx
unsigned transaction and the transaction hash(es) (also known as the payload).EVM Function Calls
EVM Function Calls
To call a function on a smart contract we need the ABI of the contract, in our repo this is defined in the config.js file (this can be gathered from Remix or using Etherscan).Then define a Then to construct the transactionThis approach allows you to call smart contract functions by encoding the function data and including it in the transaction.
Contract object using the ethers libraryFunctionCall.jsx
FunctionCall.jsx
3. Requesting the Signature
Once the transaction is created and ready to be signed, a signature request is made by callingsign on the MPC smart contract.
The method requires four parameters:
- The
payloads(or hashes) to be signed for the target blockchain - The derivation
pathfor the account we want to use to sign the transaction - The
keyType,EcdsaforSecp256k1signatures andEddsaforEd25519signatures. - The
signerAccountwhich contains theaccountIdthat is signing and thesignAndSendTransactionsfunction from Near Connect.
- Ξ EVM
- ₿ Bitcoin
- ◎ Solana
- ◉ XRP
- ◈ SUI
- ⬟ Aptos
EVM.jsx
4. Formatting the Signature
Once the signature is returned from the MPC it needs to be formatted and added to the transaction to produce a signed transaction.- Ξ EVM
- ₿ Bitcoin
- ◎ Solana
- ◉ XRP
- ◈ SUI
- ⬟ Aptos
EVM.jsx
5. Relaying the Signed Transaction
Now that we have a signed transaction, we can relay it to the target network usingbroadcastTx.
- Ξ EVM
- ₿ Bitcoin
- ◎ Solana
- ◉ XRP
- ◈ SUI
- ⬟ Aptos
EVM.jsx
⭐️ For a deep dive into the concepts of Chain Signatures, see What are Chain Signatures?⭐️ For a complete example of a NEAR account using chain signatures in a frontend, see our web app example.