Sui.

Post

Share your knowledge.

290697tz.
Jul 28, 2025
Expert Q&A

How do I integrate Sui with a hardware wallet for secure signing

I want to use a hardware wallet for signing transactions on Sui. Is this supported, and how do I set it up securely?

  • Sui
  • Architecture
  • Move
1
8
Share
Comments
.

Answers

8
BigSneh.
Jul 28 2025, 03:37
  1. Ledger is currently the only major hardware wallet with emerging support for Sui. However, full integration is still being rolled out, and may not yet be available on the Ledger Live app.

  2. You need a Sui-compatible wallet like Suiet, Surf Wallet, or Ethos, which are planning or have begun integrating hardware wallet support (especially via Ledger).

  3. Use a browser extension or dApp that supports hardware wallet connection, where your Ledger signs messages offline and returns the signature for submission.

  4. On the dApp/backend side, Sui transactions must be serialized and sent to the device for signing using BIP-32 paths (typically starting with 44'/784' for Sui).

  5. Be cautious about exposing private keys or derivation paths. Signing should happen strictly via the hardware interface, not exported keys.

  6. If you're building an app, use the Sui SDK (TypeScript or Rust) to prepare the transaction block, and pass it to the hardware wallet via supported UI bridge.

  7. Test on Sui Testnet or Devnet before using real funds on Mainnet, especially as hardware wallet support is still evolving.

  8. Keep your hardware wallet firmware up to date, and monitor announcements from both Sui Foundation and Ledger for support updates.

  9. For full backend signing with a hardware wallet (e.g., server-controlled), use a bridge library like @ledgerhq/hw-transport to communicate with the device securely.

  10. Never store the private key or mnemonic in any software layer. All signing should be confirmed physically on the device by the user.

2
Best Answer
Comments
.
Owen.
Owen4662
Jul 30 2025, 03:13

Sui supports hardware wallet integration through Ledger devices via the Sui Wallet browser extension. To set it up securely:

  1. Connect your Ledger device and open the Sui app.
  2. In the Sui Wallet, select "Connect Hardware Wallet" and follow the prompts to import your account using the device's public key.
  3. All transaction signing occurs on the Ledger device, ensuring private keys never leave the hardware.

This integration uses the standard Sui key derivation path and supports secure signing for transactions, including those involving programmable transaction blocks (PTBs). Ensure you download the official Sui Wallet from a trusted source and verify the Ledger app is up to date.

6
Comments
.
Paul.
Paul4340
Jul 31 2025, 09:44

Integrating a hardware wallet for secure signing of transactions on the Sui blockchain is possible, but it requires a few steps to ensure security and compatibility. Sui does not natively support hardware wallet integration out-of-the-box, but you can use general principles and libraries to facilitate it. The steps will involve connecting the hardware wallet to your application and signing the transaction securely using the wallet's private keys.

Here’s a detailed guide on how you can do this:

1. Hardware Wallet Compatibility

  • Sui supports transaction signing through the use of a compatible wallet that can sign transactions without exposing the private key to the application.

  • The hardware wallets you can integrate include:

    • Ledger (e.g., Nano S, Nano X)
    • Trezor
    • Other wallets that support the BIP-32/39/44 standards.

2. Software Tools Required

  • Sui Wallet SDK: You'll need to interact with Sui’s SDK or use its RPC API to sign transactions.

  • Hardware Wallet SDK: Depending on the hardware wallet you're using, you'll need its SDK or API to interact with the device.

  • Sui RPC: To send transactions after they are signed, you’ll interact with Sui’s RPC API to broadcast the transaction.

3. Integrating Ledger or Trezor with Sui

Using Ledger with Sui

To use a Ledger hardware wallet to sign Sui transactions, you need to:

  • Install Ledger Live: Install Ledger Live on your computer and make sure the Sui app is installed on your Ledger device (or use a generic app if it's not directly supported).

  • Setup LedgerJS: Use LedgerJS to communicate with your Ledger device and sign transactions.

  • Code Sample for Signing a Transaction: Below is a basic outline of how to use Ledger to sign a transaction using JavaScript (Node.js):

    const { TransportWebUSB } = require('@ledgerhq/hw-transport-webusb');
    const { AppSui } = require('@ledgerhq/hw-app-sui');  // Hypothetical package (will need to check for real Sui package)
    
    async function signTransaction() {
        const transport = await TransportWebUSB.create();
        const app = new AppSui(transport);
    
        // Prepare the transaction details (example)
        const transaction = {
            // Construct your transaction data here
        };
    
        // Sign the transaction
        const signedTransaction = await app.signTransaction(transaction);
        
        // Broadcast the transaction via Sui's RPC API
        const response = await fetch('https://rpc.sui.io', {
            method: 'POST',
            headers: { 'Content-Type': 'application/json' },
            body: JSON.stringify({
                method: 'sui_executeTransaction',
                params: [signedTransaction],
            })
        });
    
        const result = await response.json();
        console.log(result);
    }
    
    signTransaction();
    

Using Trezor with Sui

For Trezor, you will similarly use the Trezor Connect SDK to interact with the wallet.

  • Install Trezor Connect: Follow Trezor’s documentation to include the SDK in your project.

  • Code Sample:

    const TrezorConnect = require('trezor-connect').default;
    
    async function signTransaction() {
        const response = await TrezorConnect.ethereumSignTransaction({
            path: "m/44'/60'/0'/0/0", // Use the path corresponding to your Sui address
            transaction: {
                to: 'SuiTransactionAddress',
                value: '0.1',  // Amount to send in the transaction
                data: 'data_to_send',
            },
        });
    
        if (response.success) {
            const signedTx = response.payload;
            console.log(signedTx);
            // Broadcast the signed transaction to Sui
        } else {
            console.error('Failed to sign transaction:', response.payload);
        }
    }
    
    signTransaction();
    

4. Broadcasting the Signed Transaction

Once you have the transaction signed by the hardware wallet, you need to send the signed transaction to the Sui network via RPC.

  • Broadcasting via RPC: After obtaining the signed transaction, you can broadcast it using Sui’s RPC endpoint, for example:
async function broadcastTransaction(signedTransaction) {
    const response = await fetch('https://rpc.sui.io', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({
            method: 'sui_executeTransaction',
            params: [signedTransaction],
        }),
    });

    const result = await response.json();
    return result;
}

5. Security Best Practices

  • Never Expose Private Keys: Hardware wallets should always keep the private key on the device. Ensure that all signing operations happen inside the wallet, and the private key never leaves the hardware wallet.
  • Use WebUSB or Bluetooth Securely: Use secure connections (WebUSB for Ledger, Bluetooth for Trezor) and ensure your code handles timeouts and failures gracefully.
  • Confirm Transactions: Always ensure users can verify their transactions on the hardware wallet screen before signing them to prevent phishing or accidental signing.

6. Testing on Testnet

Before deploying on Mainnet, always test your integration on Sui Testnet. This allows you to simulate transactions and ensure that your integration works seamlessly with the hardware wallet.

7. Community and Documentation

Since Sui may not have explicit documentation for hardware wallet integration, it would be helpful to:

  • Follow the Sui Discord or other developer channels for advice.
  • Review the Ledger and Trezor communities for best practices and examples from other developers who might have done similar integrations.

Conclusion

While Sui does not natively support hardware wallets for transaction signing, you can integrate Ledger or Trezor with Sui by using their respective SDKs and signing the transaction offline on the hardware device. After signing, you can broadcast the transaction to the Sui network using the Sui RPC API. Make sure to follow security best practices and test thoroughly on the Testnet.

6
Comments
.
Arnold.
Arnold3036
Jul 30 2025, 08:11

Yes! Use Ledger via the Sui Wallet or Sui TS SDK for hardware signing.

1. Ledger Setup

  • Install the Sui Ledger app.
  • Connect to Sui Wallet (Browser extension).

2. Sign with SDK (TS Example)

import { SuiLedgerClient } from '@mysten/ledgerjs-sui';

const transport = await SuiLedgerClient.createTransport(); // USB/BLE
const ledgerClient = new SuiLedgerClient(transport);
const signedTx = await ledgerClient.signTransaction(txBytes);
5
Comments
.
SuiLover.
Jul 28 2025, 03:47

Sui does not currently allow developers to implement a fully custom gas model at the protocol level. Gas metering and fee computation are handled by the Sui protocol itself and apply uniformly to all smart contracts. However, you can simulate a custom gas model at the application level by introducing your own logic for usage tracking or token-based fees inside Move modules. For example, you can require users to pay with a dApp-specific token, enforce balance checks, or consume units from a custom “usage credit” object. You can also track function call counts or transaction volume per user using internal counters. This logic won’t override actual Sui gas costs but can add a custom pricing layer. Be sure to clearly communicate the model to users since it adds overhead beyond standard gas fees. On the frontend or backend, you can estimate real gas costs using dry run simulations via the Sui SDK. You should avoid designing patterns that rely on refunds or rebate logic since Sui does not support post-execution gas adjustments. For advanced experiments, running a forked localnet with protocol modifications is possible but not recommended for production.

2
Comments
.
Thorfin.
Jul 30 2025, 07:20

Yes, Sui supports hardware wallet integration (like Ledger) via Sui Wallet and compatible dApps.

Steps: Use Ledger Nano X/S Plus with latest firmware.

Install the Sui app via Ledger Live (Developer Mode ON).

Connect via Sui Wallet Extension → Add Account → "Connect Hardware Wallet".

Use the hardware wallet to sign transactions securely; private keys never leave the device.

Make sure to update Sui CLI or SDK if integrating custom code.

2
Comments
.

Do you know the answer?

Please log in and share it.