Java SDK Development Guide for OKTC

ยท

1. Package Utils

1.1 Class Utils

Essential utility functions for Java SDK operations.

1.1.1 Complement 18-bit Accuracy

Ensures precise decimal handling for financial calculations.

1.1.2 Convert BigInteger to Bytes

Facilitates cryptographic operations by converting large integers to byte arrays.

2. Package Crypto

2.1 Class AddressUtil

Handles address conversions for OKTC blockchain interactions.

2.1.1 Generate Bech32 Address from Pubkey

Converts public keys into human-readable Bech32 addresses.

2.1.2 Convert Pubkey to Bech32 Pubkey

Encodes public keys in Bech32 format for compatibility.

2.1.3 Convert Hex Address to Bech32

Transforms hexadecimal addresses into user-friendly Bech32 format.

2.1.4 Convert Bech32 Address to Hex

Reverts Bech32 addresses back to hexadecimal format when needed.

๐Ÿ‘‰ Explore advanced crypto tools

2.2 Class Crypto

Core cryptographic operations for wallet management.

2.2.1 Sign Messages with Private Key

Secures transactions using ECDSA signatures.

2.2.2 Generate Random Private Key

Creates cryptographically secure wallet keys.

2.2.3 Derive Public Key from Private Key

Generates corresponding public keys for wallet addresses.

2.2.4 Generate Random Mnemonic

Produces BIP-39 compliant seed phrases for wallet creation.

2.2.5 Derive Private Key from Mnemonic

Recovers wallet keys from backup seed phrases.

2.2.6 Generate Validator Operator Address

Creates specialized addresses for staking operations.

2.3 Class PrivateKey

Flexible key management constructor.

2.3.1 PrivateKey Initialization

Accepts either mnemonic phrases or hexadecimal private keys.

3. Package Msg

Defines transaction message types for OKTC modules with practical implementation examples.

3.1 Environment Configuration

Setup instructions for development environments.

3.2 Token Transfers

Step-by-step guide for account-to-account token transfers.

๐Ÿ‘‰ Learn more about OKTC transactions

Frequently Asked Questions

What is the main purpose of this Java SDK?

The SDK provides tools for interacting with the OKTC blockchain, including wallet management, transaction signing, and address conversion.

How secure are the generated private keys?

All keys are generated using cryptographically secure methods compliant with industry standards.

Can I use this SDK for staking operations?

Yes, the SDK includes specific methods for validator operations and staking-related transactions.

What's the difference between Bech32 and hex addresses?

Bech32 addresses are human-readable while hex addresses are machine-optimized - the SDK handles conversions seamlessly.

Is mnemonic phrase recovery supported?

Absolutely, the SDK fully supports BIP-39 mnemonics for wallet recovery.

Where can I report issues with the SDK?

You can open issues directly on the GitHub repository for the project.