Custody Rules for China-Built Crypto Bots: Keys Should Never Withdraw

The custody question for a crypto trading bot built in China is not who holds the assets overnight; on most venues assets remain in the buyer’s own account. The real custody boundary is the API key: a secret that can place orders, and sometimes move or withdraw funds, from wherever the bot runs. The governing rule is simple and should be written into the engagement: keys used by the bot must never carry withdrawal permission, and the account that owns those keys, the identity records behind it, and the secrets in the bot’s environment must all remain under the buyer’s control. This article walks the onboarding sequence as a set of checkpoints, each with an artifact the buyer can verify. Buyers should confirm that crypto trading and any derivatives used are permitted under their own jurisdiction, and obtain local legal advice before deployment. The article is technical information, not investment advice, and makes no statement about expected returns or risk-free operation.

Why the bot key acts as a custody boundary

A withdrawal-capable key is functionally a second access path to the account. Anyone who obtains it can move assets to an external address without the account holder touching the venue’s web interface, and many venues do not require a second confirmation for API-originated withdrawals once the key holds that scope. The bot also runs unattended, which means a software bug, a leaked secret, or a compromised server can act without a human in the loop. Removing withdrawal permission does not protect every exposure, but it closes the one path that moves assets off the venue entirely; trade-only keys leave loss limited to price movement and order decisions rather than asset disappearance.

Api key permissions should therefore be designed around the minimum the bot needs: read access for balances and orders, trade access for the required pairs and order types, and nothing else. Transfer permissions between wallets and sub-accounts are a middle case: they may be needed for rebalancing, but they should be enumerated and logged rather than left open. Vendors sometimes request broader scope because it makes integration testing faster, but the production key is a different artifact from the test key, and scope that was convenient in staging must be narrowed before live deployment. The permission choices across models are laid out in API permission models in China-built trading bots, and the custody rules here are the constraint those models must satisfy.

The onboarding sequence and its checkpoints

Checkpoint one: the venue account belongs to the buyer. The registration email, two-factor recovery, and account owner records should be set up under the buyer’s own control, not the vendor’s. A bot built against an account the vendor registered on the buyer’s behalf transfers only a password at handover, and the underlying identity still belongs to whoever completed verification. Where a sub-account structure is supported, the vendor operates inside a sub-account and the parent account stays with the buyer. Completing this checkpoint before code is written avoids rebuilding the account relationship after the pilot.

Checkpoint two: kyc requirements are satisfied in the buyer’s own name. Venue verification typically asks for identity documents, proof of address, and sometimes a facial or document match, and the records remain tied to the registered account. Buyers should confirm which verification tier the bot’s trading needs require, and should not let the vendor complete verification using its own documents on the assumption the account can be transferred later; venue rules often restrict account transfer or require re-verification after a change. The licensing and identity checks buyers should apply to the vendor separately are reviewed in licensing and KYC checks for China-based vendors, which addresses the vendor side rather than the venue account side.

Checkpoint three: the production key is created with trade-only scope. On the venue’s key-management page, withdrawal is disabled, transfer toggles are off unless the strategy explicitly needs them, and the allowed order types and pairs match the written scope. The key should be created once, copied directly into the bot’s secret store, and never pasted into chat, email, or a repository commit. Checkpoint four: network binding is applied where the venue supports it, restricting the key to the bot’s outgoing IP addresses, and any venue-side region or IP allowlist is set to match the buyer’s hosting plan. Checkpoint five: the bot deploys against a sandbox or testnet first, then a small live account, with the kill switch and exposure limits tested before any production capital is attached.

Where secrets live after deployment

The secret must sit in the bot’s secrets manager, environment variables supplied by the host, or an encrypted configuration file with restricted file permissions. It should not appear in application logs, error reports, screenshots, or the vendor’s shared documentation. Each environment keeps its own key: one for staging, one for production, and none for public demos. When the bot runs in the buyer’s own cloud account, secrets are managed under the buyer’s IAM policy and the vendor receives operator access that can be revoked without rotating the account; when it runs on the vendor’s host, the buyer must trust the vendor’s server security as part of the custody model, and that trade-off should be stated in the contract rather than discovered later.

Rotation is the checkpoint buyers skip. A key should be rotatable without redeploying the whole system: create a replacement key with the same narrow scope, inject it into the secret store, confirm the bot orders against it, then revoke the original. The practice should be run once during the pilot so the rotation path is known to work. Any suspected leak triggers immediate revocation, not investigation first: the venue disables the old key, a new one is issued, and only then does the review of what the old key touched begin. Server and access review around these secrets is organized in security audit of a China-built trading bot, which buyers can use as the post-pilot inspection checklist.

Shortcuts that fail a custody review

The first shortcut is sharing one full-access key across the bot, the vendor’s dashboard, and the buyer’s manual tools. If that key exists, every party who can reach the dashboard can withdraw, and revoking it breaks every tool at once. The fix is separate keys for separate roles: one trade-only key for the bot, one read-only key for monitoring, and no API key attached to manual account operations. The second shortcut is storing the secret in a code repository under a claim that the repository is private. Private repositories are still copied to laptops, shared with contractors, and exposed by accident; secrets belong outside version control, and any secret committed to history should be treated as compromised and rotated.

The third shortcut is letting the vendor hold the account’s recovery methods. A registration email the vendor controls, a two-factor device on the vendor’s phone, or a recovery question only the vendor knows means the buyer cannot lock the vendor out later. Recovery methods should be set up on the buyer’s devices at registration, and the vendor should receive only the specific access the engagement requires. The fourth shortcut is an undocumented sub-account or API key created during debugging. Vendors sometimes create a second key to reproduce an issue and forget to delete it; the custody record should list every key ever created, and the venue’s active-key page should be checked against that list at each review.

Buyers should also watch for custody assumptions hidden in the pricing model. A hosted bot service that keeps keys in its own platform, routes orders through its own venue accounts, or holds the buyer’s funds in a shared pool is not delivering a bot under the buyer’s custody at all; it is operating a managed account arrangement, which carries different compliance and accountability questions. The distinction matters because the contract, the records, and the buyer’s exposure all differ. Where the engagement is a genuine build, the custody rules above are enforceable through the repository, the account, and the secret store; where it is a managed arrangement, buyers should audit that model separately rather than assume trade-only key rules cover it.

What custody looks like at exit

The exit path should be defined before the first live order. If the relationship ends, the buyer keeps the venue account, the identity records, and the account balance; the vendor keeps no ongoing key. Every key the vendor ever created should be listed in the handover record, checked against the venue’s active-key page, and revoked at exit, including keys used only for testing. The bot’s configuration, limits, and order history should be exportable in a readable format so a replacement system or a manual wind-down can take over. A clean exit means no hidden second key remains active, no sub-account still routes to the vendor’s infrastructure, and no secret survives in an old server image.

Custody rules also cover what the bot is permitted to do with funds it controls internally. Any automated rebalance between wallets or sub-accounts should log source, destination, amount, and reason, and should reconcile against the venue’s transfer records after each reconnect. Manual funding and withdrawal decisions remain outside the bot: the buyer adds funds, checks balances, and initiates transfers through the venue’s own interface. This division keeps the unattended system inside an order-playing role while the account holder retains every custody decision. Buyers in jurisdictions where crypto activity or derivatives are restricted should treat the legal check as a precondition to onboarding at all; a technically sound custody model cannot cure a deployment that violates local rules. Everything above describes engineering and account setup only, not a recommendation to trade, and no outcome under live markets is guaranteed or implied.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *