bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 35쪽 중 32쪽
or detailed deposit examples, see the
DEPOSIT.md guide
.
Step 2: Submit Bids
Once you identify a profitable transaction, submit a bid to the Auctioneer. Bids are sealed (hidden until the auction closes) and compete based on bid amount.
Bid Structure
A bid consists of the following fields (as defined in
types.go
):
type AuctionBid struct {
TargetTxRaw []byte // Raw transaction bytes of target tx
TargetTxHash common.Hash // Transaction to backrun
BlockNumber *big.Int // Target block number
Sender common.Address // Your searcher address
To common.Address // Contract to call
Nonce uint64 // Current nonce from AuctionEntryPoint
Bid *big.Int // Your bid in KAIA
CallGasLimit uint64 // Gas limit for your backrun logic
Data []byte // Encoded function call
SearcherSig []byte // EIP-712 signature from searcher
}
info
After you submit your bid, the Auctioneer validates and adds its own signature (
AuctioneerSignature
) before forwarding winning bids to Consensus Nodes. You only need to provide the
SearcherSig
(your EIP-712 signature).
Submit a Bid
The SDK provides a complete working example at
example/submitbid.go
. The example demonstrates:
Establishing an HTTPS connection with the Auctioneer
Detecting new blocks from the EN endpoint
Generating target transactions and corresponding bids
Submitting bids to the Auctioneer
Action Required
: Replace your private key in the code before running it. Check the
TODO:
comments in the source code.
Run the example:
# From repository root
go run example/submitbid.go
Bid Validation
The Auctioneer, Proposer, and Smart Contract each perform specific validation checks on bids. Key validation rules include:
Block number
: Must be currentBlockNumber + 1 or currentBlockNumber + 2
Bid amount
: Must be greater than 0 and less than or equal to your available deposit balance
Call data size
: Must not exceed
BidTxMaxDataSize
(64KB)
Call gas limit
: Must not exceed
BidTxMaxCallGasLimit
(10,000,000)
Nonce
: Must match your current nonce in
AuctionEntryPoint
. Query it with:
cast call 0x2fF66A8b9f133ca4774bEAd723b8a92fA1e28480 "nonces(address)(uint256)" <YOUR_ADDRESS> --rpc-url "https://public-en-kairos.node.kaia.io"
Signature
: Must be a valid EIP-712 signature (see
submitbid.go
for implementation)
Deposit coverage
: Must have sufficient deposit to cover
bid_amount + estimated_gas_fee
Uniqueness
: Cannot have another winning bid in the same block (unless targeting the same transaction)
Auctioneer signature
: Must be valid (added by Auctioneer after your submission)
For a complete validation matrix showing which entity performs which checks, see the
bid validation guide
.
Step 3: Subscribe to Pending Transactions
The Auctioneer provides a WebSocket subscription service that streams pending transactions directly from Consensus Nodes. This allows searchers to detect MEV opportunities in real-time.
The SDK provides a complete example at
example/subscribe_pendingtx.go
.
The example demonstrates:
Establishing a WebSocket connection to the Auctioneer
Subscribing to the pending transaction stream
Processing incoming transactions to identify MEV opportunities
Run the example:
# From repository root
go run example/subscribe_pendingtx.go
The subscription continuously prints transaction hashes as pending transactions are detected. You can extend this example to implement your own MEV detection logic.
Step 4: Understanding Execution
When your bid wins, the Consensus Node executes it through the
AuctionEntryPoint
contract:
Execution Flow
The execution process consists of three phases:
Validation Phase
: Contract validates block number, signatures, nonce, and bid amount
Bid Payment Phase
: Bid amount deducted from your deposit and sent to ecosystem fund
Execution Phase
: Your backrun is executed by the EntryPoint contract (bid payment occurs regardless of execution outcome)
Key Security Features:
Validators execute bids on your behalf (prevents reverting bids to dodge payment)
Nonce increments prevent replay attacks
Dual signatures (searcher + auctioneer) unauthorized bid replacement or manipulation
Bid payment occurs regardless of backrun execution result
For detailed execution flow, see the
ENTRYPOINT.md guide
.
Step 5: Withdraw Funds
Withdrawing requires a two-step process with a lock period:
1. Reserve Withdrawal
Initiate withdrawal and start the 60-second lock period:
cast send --private-key <YOUR_PRIVATE_KEY> 0x2A168bCdeB9006eC6E71f44B7686c9a9863C1FBc "reserveWithdraw()" --rpc-url "https://public-en-kairos.node.kaia.io" --confirmations 0
2. Complete Withdrawal
After 60 seconds, transfer the reserved amount:
cast send --private-key <YOUR_PRIVATE_KEY> 0x2A168bCdeB9006eC6E71f44B7686c9a9863C1FBc "withdraw()" --rpc-url "https://public-en-kairos.node.kaia.io" --confirmations 0
Security Note
The two-step withdrawal process with a lock period:
Prevents flash exits during active auction periods
Maintains protocol integrity by ensuring searchers honor their bids
Protects against rapid capital manipulation attacks
API Reference
The Auctioneer provides two primary APIs for searchers:
1. Submit Bid API
Endpoint
:
POST /api/v1/auction/send
Purpose
: Submit sealed bids for MEV opportunities
2. Pending Transaction Subscription
Endpoint
:
GET /api/v1/subscriber/pendingtx
Purpose
: Real-time stream of pending transactions from Consensus Nodes
Example
: See implementation example in
subscribe_pendingtx.go
Complete API Documentation:
OpenAPI (Swagger) specs available at:
Kairos
:
https://auctioneer-kairos.kaia.io/docs
Mainnet
: Available after mainnet launch
API Usage:
API Documentation
Troubleshooting
Common Issues
Issue Category
Symptoms
Cause
Solution
Insufficient Balance
Bid rejected by Auctioneer
Deposit balance doesn't cover bid amount + estimated gas fees
Check balance with
depositBalances()
and deposit more KAIA
Nonce Mismatch
Bid rejected or execution fails
Nonce doesn't match current nonce in
AuctionEntryPoint
Query current nonce with
nonces()
before each bid. Remember: nonces increment only on execution, not submission
Block Number Range
Bid rejected by Auctioneer
Target block outside allowed range
[current+1, current+allowFutureBlock]
Ensure block number is within range (typically +1 or +2). See FAQ for dual-submission strategy
Invalid Signature
Bid rejected by Auctioneer
Incorrect EIP-712 signature construction
Verify domain separator and type hash. Reference
submitbid.go
for correct implementation
Gas Limit Issues
Execution fails or bid rejected
CallGasLimit
too low or exceeds maximum (10,000,000)
Test backrun logic on testnet to measure actual gas consumption
FAQ
Subscription
Q: How many concurrent connections are allowed per searcher?
A: Only one pending transaction subscription connection is allowed per searcher address.
Q: How long do subscription connections remain active?
A: Connections are automatically closed after 24 hours. Note that connections may be closed earlier than 24 hours if rolling updates are in progress.
API Performance and Latency
Q: How can I minimize API latency when submitting bids?
A: The Auctioneer utilizes an L7 Load Balancer with the HTTPS protocol. The initial handshake consumes time depending on network state. To bypass this initial delay when sending subsequent bid APIs, it is strongly recommended to establish a keep-alive connection.
Q: Should I be careful about API rate limits?
A: To prevent being blocked by the Auctioneer API server, do not send the
ping
API too many times within a short period.
Q: Does geographic location affect latency?
A: Yes. The Auctioneer server is running in the GCP KR (Seoul) region. You are recommended to host your infrastructure in a geographically close region to minimize latency and reduce geographic delay.
Bid Timing and Block Targeting
Q: Why does my bid sometimes target the wrong block number?
A: The timing of your bid submission is highly sensitive to the CN (Consensus Node) mining time. If the auction starts late (close to the mining time), the bid transaction would be inserted into the block after the next one (block number +2 instead of +1). This means you should set your target block number to +2.
Q: How can I improve my bid inclusion rate?
A: The target block number is inherently sensitive to the CN mining schedule: if you target block +2 but the transaction is inserted at block +1 due to earlier processing, the bid will fail. Therefore, it is recommended to maximize inclusion probability by sending your bid transaction two times: once with a target block number of +1 and once with a target block number of +2.
Best Practices
Monitor Deposit Balance
: Maintain sufficient balance to cover multiple bids
Handle Nonces Carefully
: Always query the latest nonce before bidding
Optimize Detection
: Faster MEV detection improves competitive advantage
Test on Kairos
: Validate your strategy on testnet before mainnet deployment
Monitor Results
: Track auction outcomes through the MEV Explorer to refine your bidding strategy
Set Appropriate Gas Limits
: Balance between sufficient gas and cost efficiency
Resources
SDK Repository
KIP-249 Specification
Example Code
API Documentation:
auctioneer-kairos.kaia.io/docs
(Kairos), TBU (Mainnet)
MEV Explorer:
mev-kairos.kaia.io
(Kairos), TBU (Mainnet)
FAQ
Getting Help
For issues or questions:
Post in the
Kaia DevForum
Open an issue in the
SDK repository
Prerequisites
Step 1: Deposit Funds
Understanding Deposit Requirements
Deposit Methods
Check Your Balance
Step 2: Submit Bids
Bid Structure
Submit a Bid
Bid Validation
Step 3: Subscribe to Pending Transactions
Step 4: Understanding Execution
Execution Flow
Step 5: Withdraw Funds
1. Reserve Withdrawal
2. Complete Withdrawal
API Reference
Troubleshooting
Common Issues
FAQ
Subscription
API Performance and Latency
Bid Timing and Block Targeting
Best Practices
Resources
Getting Help
## /misc/operation/optimize-storage
On this page
Kaia v2.1.0
introduces two complementary storage optimization features that can significantly reduce disk space requirements:
Database Compression
: Reduces storage by compressing repetitive block data
FlatTrie State Scheme
: Experimental feature that drastically reduces archive node state database size
This guide explains how to apply these optimizations to your Kaia node.
Database Compression
Database compression uses LevelDB's built-in Snappy compression to reduce the size of block headers, transaction bodies, and receipts—which often contain repetitive data like zero-padding in ABI-encoded transactions.
Expected savings:
Full nodes: ~2TB reduction (from ~4.2TB to ~2TB on Mainnet)
Prerequisites
Kaia v2.1.0 or higher
For manual compaction: sufficient free disk space and ability to accept sustained disk I/O (see
Resource Impact
section below)
Enable Compression for New Installations
Starting from v2.1.0, compression is enabled by default. Simply start your node:
Package installation:
# Configure network in kend.conf
sudo vi /etc/kend/conf/kend.conf
# Set: NETWORK=mainnet or NETWORK=kairos
# Start node (compression enabled by default in v2.1.0+)
kend start
# Verify
kend status
tail -f /var/kend/logs/kend.out
All newly written data will be automatically compressed.
Enable Compression for Existing Nodes
If you're upgrading from a version prior to v2.1.0:
Step 1: Check your version
ken version
Step 2: For v2.1.0 and later
Compression is already enabled by default. New data compresses automatically. Skip to Step 4 to compress existing data.
Step 3: For versions before v2.1.0 only
Add the compression flag to your configuration:
Package installation:
sudo vi /etc/kend/conf/kend.conf
# Add to ADDITIONAL variable:
ADDITIONAL="--db.leveldb.compression 2"
The compression flag values are:
0
: No compression
1
: Compress receipts only
2
: Compress headers, bodies, and receipts (recommended)
3
: Compress all tables including state trie (not recommended)
note
Option 2 is recommended because state trie data doesn't compress well (appears random), so option 3 provides minimal additional benefit.
Then restart:
kend stop
kend start
Step 4: Compress existing data (optional but recommended)
Trigger database compaction via RPC. Attach to your node console:
ken attach --datadir /var/kend/data
In the console, trigger compaction using the "allbutstate" preset:
> debug.chaindbCompact({ "preset": "allbutstate" })
null
Available presets:
"default"
: Full-range compaction of all database components
"allbutstate"
: Selective compaction excluding state trie (recommended for compression)
"custom"
: Define custom ranges for specific database tables
The compaction runs in the background. Monitor progress in your node logs:
tail -f /var/kend/logs/kend.out | grep -i Compact
You should see log entries like:
INFO[07/25,12:50:17 Z] [3] Compacting database started range=0x48-0x49
INFO[07/25,12:55:17 Z] [3] Compacting database completed range=0x48-0x49 elapsed=5m0.085s
The node will continue processing blocks during compaction.
Expected duration:
Approximately 10 hours for a Mainnet full node (on SSD with ~4TB data). Duration varies based on hardware and data size.
Resource impact:
High disk I/O (peaks >400 MiB/s read, >300 MiB/s write)
High disk IOPS (often >2000 operations/sec)
Node remains operational and continues syncing blocks
note
While the node remains operational during compaction, query performance may be impacted during peak I/O periods. For production RPC nodes, schedule compaction during maintenance windows or low-traffic periods.
Use Pre-Compressed Chaindata Snapshots (TBD)
Pre-compressed chaindata snapshots are planned for future releases but are not yet available. When available, they will be listed on the
Chaindata Snapshot page
.
Currently, you must either:
Enable compression on a new v2.1.0+ installation (automatic for new data)
Run manual compaction on existing nodes (see above)
Check the snapshot page periodically for updates on compressed snapshot availability.
Verify Compression is Active
Check your node startup logs for compression configuration:
grep "compressionType" /var/kend/logs/kend.out
Look for log entries showing
compressionType=snappy
for non-state-trie tables.
Monitoring and Troubleshooting
Check disk usage reduction:
du -h --max-depth=1 /var/kend/data/klay/chaindata
Compare before and after compaction. You should see significant storage reductions in the directories containing block bodies and receipts.
Common issues:
Compaction fails
: Ensure sufficient disk space. Compaction temporarily requires additional space for rewriting data.
FlatTrie won't start
: FlatTrie requires an empty database. If you see errors about existing data, delete the chaindata directory and sync from genesis.
Merkle proof API errors
: FlatTrie does not support
eth_getProof
. Use a traditional node if this API is required.
FlatTrie State Scheme (Experimental)
FlatTrie is an experimental state storage scheme adapted from the Erigon Ethereum client. It stores account states in a flat structure and maintains only the latest block's complete Merkle Patricia Trie (MPT), reconstructing historical tries on-demand.
Expected savings:
Total storage: ~75% reduction (projected from Kairos testnet results)
Kairos testnet: 4.3TB → 1TB
Mainnet: ~35TB → ~10TB (estimated based on proportional reduction)
warning
FlatTrie is an experimental feature in v2.1.0. It is not recommended for production use. Expect potential stability issues, performance bottlenecks, and breaking changes in future releases. Use only for testing and development environments.
Prerequisites
Kaia v2.1.0 or higher
Must sync from genesis
(cannot convert existing database)
Empty data directory
Current Limitations
Before enabling FlatTrie, understand these restrictions:
Unsupported features:
Batch pruning and live pruning
Block rewinding (
--start-block-number
flag and
debug_setHead
API)
Merkle proof generation (
eth_getProof
API)
Incompatibilities:
Cannot migrate from existing database (must start from genesis)
Cannot switch between FlatTrie and non-FlatTrie modes
Databases with and without FlatTrie are incompatible
Enable FlatTrie
Step 1: Prepare empty data directory
# Ensure clean data directory
sudo rm -rf /var/kend/data
sudo mkdir -p /var/kend/data
Step 2: Start node with FlatTrie flag and sync from genesis
# Mainnet
ken --state.experimental-flat-trie
# Kairos testnet
ken --state.experimental-flat-trie --kairos
note
When FlatTrie is enabled, archive mode is automatically activated regardless of
--gcmode
and
--state.block-interval
flags. These flags are ignored when using FlatTrie.
Step 3: Wait for full sync
The node will sync all blocks from genesis. This may take several weeks depending on your hardware and network.
Verify FlatTrie is Active
Check your node startup logs to confirm FlatTrie mode:
grep -i "flat" /var/kend/logs/kend.out | head -20
You should see indications that experimental flat trie is active.
Monitor FlatTrie Performance
FlatTrie uses different resource profiles compared to traditional state storage:
Expected characteristics:
Lower CPU usage
Higher memory usage (~30GB)
Higher goroutine count (~900-1000)
Slower block finalization time
Monitor these metrics via your node's Prometheus metrics endpoint or Grafana dashboard.
Troubleshooting FlatTrie
Cannot start FlatTrie on existing database:
If you see errors indicating FlatTrie cannot be enabled on non-empty data, you must start from genesis. Delete your chaindata directory and perform a full sync with the
--state.experimental-flat-trie
flag.
Merkle proof API failures:
FlatTrie does not support
eth_getProof
and related Merkle proof APIs. If your application requires these APIs, use a traditional node instead.
High memory usage:
Memory usage around 30GB is expected for FlatTrie nodes during sync. Ensure your system has sufficient RAM. The team is working on optimizations to reduce this in future versions.
Slow sync speed:
Initial sync with FlatTrie is comparable to traditional nodes. If sync is significantly slower, check:
Disk I/O performance (SSD strongly recommended)
Network bandwidth
CPU utilization
Best Practices
Always backup before major changes
: Especially before running manual compaction.
Monitor disk space
: Ensure you have sufficient free space before compaction. Compaction temporarily requires additional space for rewriting database files.
Schedule compaction during low-traffic periods
: If running public RPC endpoints.
Use SSD for production nodes
: Both compression and FlatTrie benefit from fast random I/O.
Plan for experimental features
: FlatTrie is experimental in v2.1.x. Test thoroughly before production use.
Stay updated
: Check release notes for future optimizations and when FlatTrie graduates from experimental status.
Database Compression
Prerequisites
Enable Compression for New Installations
Enable Compression for Existing Nodes
Use Pre-Compressed Chaindata Snapshots (TBD)
Verify Compression is Active
Monitoring and Troubleshooting
FlatTrie State Scheme (Experimental)
Prerequisites
Current Limitations
Enable FlatTrie
Verify FlatTrie is Active
Monitor FlatTrie Performance
Troubleshooting FlatTrie
Best Practices
## /misc/updates
Documentation Updates
This page tracks all significant changes, additions, and updates to the Kaia documentation.
About Our Versioning Scheme
▼
JUMP TO YEAR:
2025
2024
2025
November
2025
Searcher's Guide to Kaia v2.1 MEV Auction SDK
NEW CONTENT
Docs Version:
1.21.6
Date:
November 17, 2025
Use the Kaia v2.1 MEV Auction SDK to deposit funds, submit sealed bids, and participate in MEV opportunity auctions on the Kaia network.
View GitHub PR
Node Storage Optimization in Kaia v2.1
NEW CONTENT
Docs Version:
1.21.5
Date:
Novembe프로젝트로 돌아가기