The Go Wallet SDK is a powerful, Go-based toolkit designed to streamline blockchain integration for developers. It provides a unified interface for creating private keys, generating addresses, assembling transactions, and performing signatures across a wide array of major blockchains. Each supported cryptocurrency has its own dedicated module, ensuring tailored functionality while maintaining a consistent developer experience.
This guide offers a detailed walkthrough of the SDK’s capabilities, installation process, and core features, helping you integrate robust wallet functionality into your Web3 applications efficiently.
Supported Platforms and Integration
As a native Go SDK, it can be seamlessly integrated into a variety of applications, including web backends, mobile apps, and desktop software. Its cross-platform nature makes it a versatile choice for developers building in the Go ecosystem.
Installation and Setup
To begin using the SDK, install it using the go get command. The SDK is organized into public packages for shared utilities and individual modules for each supported blockchain.
Installing Core Packages
Fetch the latest version of the public crypto package, which contains essential cryptographic functions:
go get github.com/okx/go-wallet-sdk/cryptoInstalling Blockchain Modules
Integrate specific blockchain modules. For example, to add Ethereum and Bitcoin support:
Ethereum Integration:
go get github.com/okx/go-wallet-sdk/coins/ethereumBitcoin Integration:
go get github.com/okx/go-wallet-sdk/coins/bitcoinCore Features and Modules
The SDK is structured into two primary modules, each serving a distinct purpose in the wallet development process.
The Crypto Module
This foundational package provides implementations of common cryptographic algorithms and standards essential for blockchain operations. It includes:
- BIP32 Functions: For hierarchical deterministic wallet operations.
- BIP39 Functions: For mnemonic phrase generation and key derivation.
- ECDSA & ED25519 Functions: For elliptic curve digital signature operations.
- Hash & Encoding Utilities: Including SHA256 and Base64 encoding/decoding.
The Coins Module
This module contains individual packages for each supported blockchain, offering coin-specific methods for transaction building, signing, and address generation. Key packages include ethereum, bitcoin, solana, cosmos, and many more.
Detailed Package Overview
The SDK offers extensive support for leading blockchain networks. Here’s a breakdown of the key packages available.
| Package Name | Module | Key Description |
|---|---|---|
github.com/okx/go-wallet-sdk/crypto | crypto | Provides core cryptographic functions (BIP32, BIP39, ECDSA, Ed25519). |
github.com/okx/go-wallet-sdk/coins/aptos | aptos | Tools for interacting with the Aptos blockchain (transfers, NFT operations). |
github.com/okx/go-wallet-sdk/coins/bitcoin | bitcoin | Supports Bitcoin mainnet, testnet, and related chains like BSV, DOGE, and LTC. |
github.com/okx/go-wallet-sdk/coins/cosmos | cosmos | Integrates with the Cosmos ecosystem, including ATOM, OSMO, and JUNO. |
github.com/okx/go-wallet-sdk/coins/ethereum | ethereum | For Ethereum and all EVM-compatible chains (Polygon, BSC, Arbitrum, etc.). |
github.com/okx/go-wallet-sdk/coins/solana | solana | Provides essential functions for building on the high-performance Solana chain. |
github.com/okx/go-wallet-sdk/coins/starknet | starknet | A toolkit for integrating with the StarkNet Layer 2 network. |
github.com/okx/go-wallet-sdk/coins/sui | sui | Contains functions for interacting with the SUI blockchain. |
github.com/okx/go-wallet-sdk/coins/tron | tron | Enables integration with the TRON network. |
Ethereum SDK (coins/ethereum)
The Ethereum module is one of the most comprehensive, supporting not only Ethereum but also dozens of EVM-compatible Layer 1 and Layer 2 networks.
Key Functions:
NewAddress: Derives a new public address from a private key.SignTransaction: Signs an Ethereum-compatible transaction.SignMessage: Signs a standard message using Ethereum's personal_sign method.
This package is indispensable for developers building multi-chain DeFi applications or any product requiring broad EVM support. 👉 Explore more strategies for EVM development
Bitcoin SDK (coins/bitcoin)
The Bitcoin package supports a family of UTXO-based chains, providing robust tools for transaction handling.
Key Functions:
NewAddress: Generates a new address from a private key for various formats (Legacy, SegWit, etc.).SignTx: Signs a standard Bitcoin transaction.GenerateUnsignedPSBTHex: Creates a Partially Signed Bitcoin Transaction (PSBT) for advanced signing workflows.
Cosmos SDK (coins/cosmos)
The Cosmos package facilitates integration with the interchain ecosystem, supporting a multitude of coins within the Cosmos network.
Supported Coins: ATOM, AXELAR, OSMO, JUNO, SEI, and more.
Key Functions:
NewAddress: Generates a new address for a specific Cosmos chain.Transfer: Signs a transaction for transferring assets.SignMessage: Signs a message for authentication or verification purposes.
Testing and Verification
Each module includes a comprehensive suite of test cases located in the tests directory within its respective package on GitHub. These tests are invaluable for understanding function usage, verifying output, and ensuring your implementation is correct before moving to production.
Supported Coins and Derivation Paths
The SDK standardizes key derivation using BIP44 paths. Below is a reference table for major coin families.
| Coin Family | Coin Examples | Standard Derivation Path |
|---|---|---|
| BTC | BTC, TBTC | m/44'/0'/0'/0/0 |
| ETH | ETH, Polygon, BSC, Arbitrum | m/44'/60'/0'/0/0 |
| Cosmos | ATOM, OSMO, JUNO | m/44'/118'/0'/0/0 |
| Solana | SOL | m/44'/501'/0'/0/0 |
| Aptos | APT | m/44'/637'/0'/0/0 |
| SUI | SUI | m/44'/784'/0'/0/0 |
| TRON | TRX | m/44'/195'/0'/0/0 |
Frequently Asked Questions
What is the primary use case for the Go Wallet SDK?
The SDK is designed for developers who need to integrate secure wallet operations—like key generation, transaction signing, and address management—into their Go applications for a wide range of blockchains, without building this complex infrastructure from scratch.
How does the SDK ensure security?
It utilizes well-audited, standard cryptographic libraries for all operations (BIP39, ECDSA, etc.) and provides a clean interface that helps developers avoid common security pitfalls associated with manual private key handling and transaction signing.
Can I use this SDK for both mainnet and testnet environments?
Yes, absolutely. Most coin modules, like Bitcoin and Ethereum, explicitly support both mainnet and testnet environments, allowing you to build and test your application safely before deploying to production blockchains.
What if the blockchain I need isn't listed?
The SDK is actively maintained, with support for new blockchains added regularly. You can check the official GitHub repository for the latest updates or submit a request for a new chain. 👉 Get advanced methods for blockchain integration
Is this SDK suitable for building a full custodial wallet?
While it provides all the core cryptographic and chain-specific functions needed, building a full custodial wallet requires additional infrastructure for key storage, transaction broadcasting, and state management, which is outside the scope of this SDK.
How do I handle gas fees for EVM transactions?
The Ethereum SDK and other EVM modules provide functions to build transactions, but estimating and setting appropriate gas fees (gas limit and gas price) is typically the responsibility of the application logic, often requiring external data from a node.