Introduction
The Go Wallet Signing SDK is a powerful, open-source toolkit built with the Go programming language. It is designed to streamline the integration of various blockchain functionalities into applications. This SDK provides developers with a robust set of tools for handling core Web3 operations, including private key generation, address creation, transaction assembly, and cryptographic signing across a multitude of mainstream blockchain networks.
Its modular architecture allows for easy integration into a wide range of applications, from web platforms and mobile apps to desktop software. Each supported cryptocurrency has its own dedicated module, ensuring focused and optimized functionality. The project is continuously evolving, with support for additional blockchains being added regularly.
Core Features and Capabilities
The crypto Module
At the heart of the SDK is the crypto module. This foundational package provides implementations of essential cryptographic standards and algorithms that are critical for blockchain security and operation. It includes:
- BIP32 (HD Wallets): Functions for generating and managing hierarchical deterministic wallets, allowing for a tree of keys derived from a single seed.
- BIP39 (Mnemonic Seeds): Tools for generating human-readable mnemonic phrases, which can be used to create seeds for deterministic key generation.
- ECDSA (Elliptic Curve Digital Signature Algorithm): The signature algorithm widely used by Bitcoin, Ethereum, and many other cryptocurrencies for securing transactions.
- ED25519: A modern, high-performance elliptic curve signature scheme used by networks like Solana and Stacks.
- Hash & Encoding Utilities: Common functions for SHA256 hashing and Base64 encoding/decoding, which are fundamental to many blockchain operations.
This module ensures that all cryptographic operations adhere to industry standards, providing a secure and reliable foundation for wallet functionality.
The coins Modules
The SDK's functionality is extended through a series of individual coin modules. Each module is tailored to the specific requirements of its respective blockchain, offering methods for transaction construction, signing, and address generation. This modular approach allows developers to include only the dependencies they need for their target blockchains.
👉 Explore advanced blockchain integration tools
Supported Blockchains and Modules
The SDK offers extensive support for a vast array of blockchain networks. Below is a detailed overview of the available modules and their primary functions.
Aptos (coins/aptos)
The Aptos module facilitates interaction with the Aptos blockchain. It supports a variety of transaction types beyond simple transfers, including token operations and NFT interactions.
Key Functions: NewAddress, ValidateAddress, SignRawTransaction.
Supported Transaction Types: "transfer", "tokenTransfer", "tokenMint", "tokenBurn", "tokenRegister", "dapp", and several NFT-related operations.
Bitcoin (coins/bitcoin)
This versatile module supports not only Bitcoin (BTC) but also other Bitcoin-like chains such as Bitcoin SV (BSV), Litecoin (LTC), Dogecoin (DOGE), and testnets (TBTC). It includes functionality for creating Partially Signed Bitcoin Transactions (PSBT).
Key Functions: NewAddress, SignTx, GenerateUnsignedPSBTHex.
Cosmos (coins/cosmos)
The Cosmos SDK module supports the entire Cosmos ecosystem, including networks like Atom, Axelar, Cronos, Evmos, Juno, Kava, Osmosis, and Secret Network. It provides tools for transfers and message signing.
Key Functions: NewAddress, Transfer, SignMessage.
EOS (coins/eos)
Designed for the EOS blockchain, this module also supports the WAX network. It handles core functions like address generation and transaction signing.
Key Functions: NewAddress, SignTransaction.
Ethereum (coins/ethereum)
This is a critical module for the Ethereum mainnet and any Ethereum Virtual Machine (EVM) compatible chains, such as Polygon, BNB Smart Chain, Arbitrum, and Optimism. It covers the essentials for EVM-based development.
Key Functions: NewAddress, SignTransaction, SignMessage.
Flow (coins/flow)
The Flow module provides tools for building on the Flow blockchain, a platform designed for high-performance applications and games. It supports account creation and transaction signing.
Key Functions: CreateNewAccountTx, SignTx.
NEAR (coins/near)
This module enables interaction with the NEAR Protocol, a scalable sharded blockchain. It includes functions for account management, key derivation, and transfers.
Key Functions: NewAccount, SignTransaction, Transfer, FullAccessKey, PublicKeyFromSeed.
Polkadot (coins/polkadot)
For the heterogeneous multi-chain platform Polkadot, this module provides the necessary tools for address generation and transaction signing within its ecosystem.
Key Functions: NewAddress, SignTx.
Solana (coins/solana)
The Solana module supports development on the high-throughput Solana blockchain, offering functions for key generation and transaction signing.
Key Functions: NewAddress, SignTransaction.
Stacks (coins/stacks)
This module allows for integration with the Stacks blockchain, which brings smart contracts and decentralized apps to Bitcoin.
Key Functions: NewAddress, Transfer.
StarkNet (coins/starknet)
For the StarkNet Layer 2 validity rollup, this module provides tools for generating addresses and signing contract transactions.
Key Functions: NewAddress, CreateSignedContractTx.
SUI (coins/sui)
The SUI module supports the SUI blockchain, offering standard wallet functions along with message signing capabilities.
Key Functions: NewAddress, SignTransaction, SignMessage.
TRON (coins/tron)
This module provides the tools needed to integrate TRON blockchain functionality into applications, including address generation and transaction signing.
Key Functions: NewAddress, SignTransaction.
ZKSpace (coins/zkspace)
Focused on zk-Rollup technologies, this module supports both ZKSpace and zkSync Era, handling operations like transfers and public key changes.
Key Functions: NewAddress, CreateSignTransferTx.
Installation and Integration
Integrating the Go Wallet SDK into your project is straightforward using the go get command. You can install the entire public package or individual coin modules as needed.
To install the core crypto module:
go get github.com/okx/go-wallet-sdk/cryptoTo install a specific coin module, for example, Ethereum and Bitcoin:
go get github.com/okx/go-wallet-sdk/coins/ethereum
go get github.com/okx/go-wallet-sdk/coins/bitcoinThis flexibility helps keep your project's dependencies lean and manageable.
Standard Derivation Paths
The SDK adheres to standard BIP44 derivation paths for consistent and predictable key generation across different blockchains. This ensures interoperability with other wallets and services.
| Coin Family | Example Coins | Standard Derivation Path (BIP44) |
|---|---|---|
| Bitcoin | BTC, TBTC | m/44'/0'/0'/0/0 |
| BCH | m/44'/145'/0'/0/0 | |
| LTC | m/44'/2'/0'/0/0 | |
| DOGE | m/44'/3'/0'/0/0 | |
| Ethereum | ETH, Polygon, Arbitrum, Optimism | m/44'/60'/0'/0/0 |
| Cosmos | ATOM, OSMO | m/44'/118'/0'/0/0 |
| Cronos | m/44'/394'/0'/0/0 | |
| Other | Solana (SOL) | m/44'/501'/0'/0/0 |
| Polkadot (DOT) | m/44'/354'/0'/0/0 | |
| TRON (TRX) | m/44'/195'/0'/0/0 | |
| Aptos (APT) | m/44'/637'/0'/0/0 |
👉 Discover more strategies for secure key management
Testing and Verification
To ensure reliability and demonstrate usage, each module in the SDK includes a comprehensive suite of test cases. These tests are located in the tests directory within each coin's package on GitHub (e.g., coins/ethereum/tests). Developers are encouraged to review these tests to understand practical implementations of the SDK's functions and to verify the correctness of their own integrations.
Frequently Asked Questions
What is the primary use case for this SDK?
This SDK is designed for developers who need to integrate blockchain wallet functionalities—like generating keys, creating addresses, and signing transactions—directly into their Go applications, without relying on external wallet services.
Do I need to install all coin modules?
No, the modular design allows you to install only the specific modules you need for your project (e.g., coins/ethereum and coins/bitcoin). This helps minimize dependencies and keeps your application lightweight.
How does the SDK handle security?
The SDK leverages well-established, audited cryptographic libraries for all operations (BIP32, BIP39, ECDSA, Ed25519). It provides the tools for secure key management but follows the principle of "local signing," where private keys never leave the user's environment.
Can I use this for both mainnet and testnet?
Yes, most modules support both mainnet and testnet environments. Configuration parameters typically allow you to specify which network you want to interact with.
Where can I find detailed code examples?
The best resource for detailed code examples is the official GitHub repository. Each module has a corresponding /tests directory filled with unit tests that serve as excellent practical examples of how to use each function.
Is this SDK compatible with mobile development?
While written in Go, which can be compiled for various platforms, integrating it into a mobile project typically requires using a Go mobile build or creating a bridging layer for Android (via Gomobile) and iOS, which may involve additional setup.
Conclusion
The Go Web3 Wallet Signing SDK is a comprehensive and developer-friendly toolkit for building secure and efficient blockchain integrations. Its support for a wide range of cryptocurrencies, combined with its modular architecture and strict adherence to cryptographic standards, makes it an excellent choice for projects requiring direct on-chain interaction. By handling the complexities of transaction building and signing, it allows developers to focus on creating innovative Web3 applications.