Klaytn Documentation
website·Indexed 35 days ago
https://docs.klaytn.foundation/Developer documentation for the Klaytn network, featuring guides on RPC service providers and SDKs including caver-js and viem. It provides detailed API references for caver-js modules such as caver.rpc, caver.klay.accounts, caver.wallet.keyring, and caver.contract, as well as documentation for KIP-37 compliant smart contracts and JSON-RPC interfaces.
What's inside Klaytn
- StateDB Live Pruning is a storage management technique in Klaytn designed to prevent the StateTrie from accumulating excessive data. Unlike State Migration, which requires manual triggers and full Trie traversal, Live Pruning identifies outdated TrieNodes using a unique 7-byte serial index appended to the 32-byte Hash (creating an 'ExtHash'). This ensures all nodes are unique, allowing the system to safely delete data from blocks older than a specific threshold without affecting the StateRoot, maintaining backward compatibility.
Overview of caver.kct.kip37
Thecaver.kct.kip37module allows developers to handle KIP-37 compliant smart contracts as JavaScript objects on the Klaytn blockchain. It inherits fromcaver.contractand adds specific methods for KIP-37 token functionality. It supports the Ownable interface, allowing a contract owner to be designated during deployment. This module is supported in caver-js v1.5.7 and later.Overview of Klaytn Contracts Wizard (KCW)
The Klaytn Contracts Wizard (KCW) is an interactive tool designed to bootstrap smart contracts using secure, tested components from the Klaytn Contracts library. Built on the foundation of the OpenZeppelin Wizard, it allows developers to generate contract code by selecting token standards, configuring settings, and enabling specific features.Overview of caver-java for Klaytn
caver-java is a lightweight, modular Java and Android library that serves as an interface for applications to communicate with Klaytn network nodes. It provides a complete implementation of Klaytn's JSON-RPC client API over HTTP and IPC.Overview of Kaikas dApp integration methods
Kaikas is a non-custodial wallet that supports Klaytn-specific transactions and accounts. Integration can be achieved through three levels of abstraction:
- UI Libraries: High-level frameworks that provide pre-built components (like 'Connect Wallet' buttons) and manage state for accounts and networks.
- Utility Libraries: Mid-level libraries that streamline blockchain interactions, smart contract ABIs, and error handling while allowing direct Provider API calls.
- Providers: The lowest level of integration using the
window.klaytnobject, which implements the Klaytn JSON-RPC API.
Overview of Klaytn Blockchain Indexers
Blockchain indexers for Klaytn are tools that create and maintain organized databases of blockchain data. They allow developers to search, query, and access on-chain information efficiently without needing to process the entire blockchain from scratch. SubQuery Network is a supported provider that integrates with Klaytn to deliver these indexing services.Overview of Klaytn smart contract upgrades
Klaytn provides frameworks and libraries to allow Service Providers (SPs) to upgrade deployed services and migrate information. The upgrade model is designed with the following requirements:
- Only the contract owner or authorized accounts can perform upgrades.
- Upgraded contracts must be able to manipulate data maintained by the previous version.
- Other contracts referencing the old version must be able to determine if a newer, upgraded version exists.
Overview of Klaytn Wallet
Klaytn Wallet is a browser-based account management tool designed for dApp developers. It allows users to create new accounts, view account information, and transfer KLAY or Klaytn tokens without needing to run a local Klaytn node.
Available Environments:
- Cypress Mainnet: https://wallet.klaytn.com
- Baobab Testnet: https://baobab.wallet.klaytn.foundation
Key Functions:
- Account and key management (creation, loading via private key/keystore, downloading keystores).
- Asset management (viewing balances, adding tokens, transferring KLAY/tokens).
- Access to the Baobab testnet KLAY faucet.
Overview of Klaytn Ecosystem Funding and Tokenomics
Klaytn utilizes on-chain protocol tokenomics to support its ecosystem, where 66% of newly minted tokens are reinvested into the ecosystem. Additionally, initially issued reserve tokens are used as resources for ecosystem expansion investments.Overview of Orakl Network Services
Orakl Network is a decentralized oracle network that enables smart contracts to securely access off-chain data. It provides several key solutions:
- Data Feed: Real-time price and data feeds.
- VRF (Verifiable Random Function): Generation of verifiably random values for dApps.
- Request-Response: Custom data requests.
- Proof of Reserve: Verification of asset reserves.
Overview of Klaytn Precompiled Contracts
Klaytn provides several non-state-changing precompiled contracts implemented natively in the platform. Addresses 0x01 through 0x0A are identical to Ethereum's precompiles, covering elliptic curve digital signature recovery, hash methods, memory copying, and elliptic curve math for zk proofs. Klaytn also implements additional precompiled contracts from 0x3FD through 0x3FF for Klaytn-specific features.Overview of caver-js
caver-js is a JavaScript API library used to interact with a Klaytn node via HTTP or Websocket connections. It provides a complete implementation of Klaytn's JSON-RPC client API and supports Klaytn-specific transaction, account, and account key types. Key features include an in-memory wallet, support for fee-delegation, RLP encoding/decoding of transaction objects, and a smart contract package for deployment and execution.npm install caver-js