Transaction Signing
Sign transaction payloads for different blockchain networks. The payload format varies by network type.
EVM Transaction Signing
Sign Ethereum and EVM-compatible chain transactions.
curl -X POST 'https://tee.magiclabs.com/v1/api/wallet/sign_transaction' \
-H 'Content-Type: application/json' \
-H 'x-magic-secret-key: sk_live_XXXXXXXX' \
-d '{
"payload": {
"type": 2,
"chainId": 888888,
"nonce": 1,
"value": "0x616263646566",
"gas": 100000,
"maxFeePerGas": 2000000000,
"maxPriorityFeePerGas": 2000000000,
"to": "0x0aA818d7952c0B6a56ee97581708866C154f63AD"
},
"encryption_context": "hashed_passcode",
"access_key": "key_shard",
"wallet_id": "wallet_id"
}'
Solana Transaction Signing
Sign Solana blockchain transactions.
curl -X POST 'https://tee.magiclabs.com/v1/api/wallet/sign_transaction' \
-H 'Content-Type: application/json' \
-H 'x-magic-secret-key: sk_live_XXXXXXXX' \
-d '{
"payload": "transaction_base64",
"encryption_context": "hashed_passcode",
"access_key": "key_shard",
"wallet_id": "wallet_id"
}'
Bitcoin Transaction Signing
Sign Bitcoin blockchain transactions.
curl -X POST 'https://tee.magiclabs.com/v1/api/wallet/sign_transaction' \
-H 'Content-Type: application/json' \
-H 'x-magic-secret-key: sk_live_XXXXXXXX' \
-d '{
"payload": {
"inputs": [
{
"address": "bc1q59ehj6mza09gk8v5558dqpy8m4c...",
"value": 5,
"txid": "d12beb629cebe086149c9c7b558f09531f8...",
"tx_num": 0
}
],
"outputs": [
{
"address": "bc1q59ehj6mza09gk8v5558dqpy8m4c...",
"value": 5
}
]
},
"encryption_context": "hashed_passcode",
"access_key": "key_shard",
"wallet_id": "wallet_id"
}'
Transaction Signing Response:
{
"data": {
"signed_transaction": "0xabc...",
"transaction_hash": "0xabc..."
}
}
Request Parameters
Transaction payload to be signed. Format varies by network:
- EVM: Standard Ethereum transaction object
- Solana: Base64-encoded transaction string
- Bitcoin: Object with inputs and outputs arrays
The context used to decrypt key shards. Should match the context used during wallet creation.
The access key shard for this wallet.
The UUID of the wallet to sign with.
Response Fields
The signed transaction ready for broadcast to the blockchain.
The transaction hash that will be generated when the transaction is submitted to the network.
Message Signing
Sign Data
Sign arbitrary data using keccak256 hash.
curl -X POST 'https://tee.magiclabs.com/v1/api/wallet/sign_data' \
-H 'Content-Type: application/json' \
-H 'x-magic-secret-key: sk_live_XXXXXXXX' \
-d '{
"raw_data_hash": "keccak256_string_hash",
"encryption_context": "hashed_passcode",
"access_key": "key_shard",
"wallet_id": "wallet_id"
}'
Data Signing Response:
{
"data": {
"messageHash": "0xabc...",
"signature": "0xabc...",
"r": "",
"s": "",
"v": ""
}
}
Request Parameters
The keccak256 hash of the data to sign
The context used to decrypt key shards. Should match the context used during wallet creation.
The access key shard for this wallet.
The UUID of the wallet to sign with.
Response Fields
The complete signature in hex format
The r component of the ECDSA signature
The s component of the ECDSA signature
The recovery parameter of the ECDSA signature
Sign Message (Solana)
Sign an arbitrary message using a Solana wallet.
curl -X POST 'https://tee.magiclabs.com/v1/api/wallet/svm/sign_message' \
-H 'Content-Type: application/json' \
-H 'x-magic-secret-key: sk_live_XXXXXXXX' \
-d '{
"message_base64": "base64_string_hash",
"encryption_context": "hashed_passcode",
"access_key": "key_shard",
"wallet_id": "wallet_id"
}'
Solana Message Signing Response:
{
"data": {
"signature": "base64_encoded"
}
}
Request Parameters
The message to be signed, encoded in base64
The context used to decrypt key shards. Should match the context used during wallet creation.
The access key shard for this wallet.
The UUID of the wallet to sign with.
Response Fields
The signature in base64 format