教學

如何安全设置 Coinbase CDP API Key

4 分鐘

本文正文暫以英文原文展示,翻譯版本需完成來源複核後再發布。

已验证事实边界

1. Coinbase says CDP API keys are used to authenticate permissioned Advanced Trade REST API and WebSocket API channels. 2. Coinbase says API key creation includes nickname, portfolio, permission level and allowlisted IP configuration. 3. Coinbase says the user completes 2FA and the API key JSON automatically downloads. 4. Coinbase says credentials should be stored securely outside the code base and recommends environment variables. 5. Coinbase says IP whitelisting is recommended for enhanced API-key security. 6. Coinbase Advanced Trade endpoint documentation maps private endpoints to view, trade and transfer permissions, which should drive onboarding tests.

收起完整分析

决策矩阵

文章表格:可橫向滑動,或聚焦表格區域後使用方向鍵。

CheckWhat it meansPractical actionUnknown to keep explicit
Official account paththe key should be created in Coinbase Developer Platform, not through a third-party formverify the logged-in domain and account before creating a keywhether multiple Coinbase accounts are open in the browser
Permission levelView, Trade and Transfer have different consequencesstart with View and add Trade only after tests require itwhether a portfolio action needs broader scope
IP allowlistnetwork restrictions reduce misuse but can break changing runnersadd only expected egress IPs and document fallbackwhether home or cloud IP changes silently
Secret downloadthe JSON download contains sensitive key materialmove it immediately into restricted local secret storagewhether downloads sync to cloud folders
First testview-only endpoints prove auth without tradingtest list accounts or product data before any order endpointwhether an SDK retries mutating calls
Revocation conditiona key needs a written stop rulerevoke after suspected exposure, permission change, machine compromise or unused agewhether stale automation still reads the old secret

来源地图

控制说明

1. Official account path

这一项要求读者把公开来源翻译成操作规则。这里的含义是:the key should be created in Coinbase Developer Platform, not through a third-party form。可执行动作是:verify the logged-in domain and account before creating a key。仍然未知的是:whether multiple Coinbase accounts are open in the browser。因此本文不会把未知部分包装成收益承诺、牌照承诺、审批保证、安全保证、恢复保证、平台排名或价格暗示。

2. Permission level

这里的含义是:View, Trade and Transfer have different consequences。可执行动作是:start with View and add Trade only after tests require it。仍然未知的是:whether a portfolio action needs broader scope。

操作测试也必须很窄。这就是本文坚持以清单形式呈现的原因。

3. IP allowlist

这里的含义是:network restrictions reduce misuse but can break changing runners。可执行动作是:add only expected egress IPs and document fallback。仍然未知的是:whether home or cloud IP changes silently。

操作测试也必须很窄。这就是本文坚持以清单形式呈现的原因。

4. Secret download

这里的含义是:the JSON download contains sensitive key material。可执行动作是:move it immediately into restricted local secret storage。仍然未知的是:whether downloads sync to cloud folders。

操作测试也必须很窄。这就是本文坚持以清单形式呈现的原因。

5. First test

这里的含义是:view-only endpoints prove auth without trading。可执行动作是:test list accounts or product data before any order endpoint。仍然未知的是:whether an SDK retries mutating calls。

操作测试也必须很窄。这就是本文坚持以清单形式呈现的原因。

6. Revocation condition

这里的含义是:a key needs a written stop rule。可执行动作是:revoke after suspected exposure, permission change, machine compromise or unused age。仍然未知的是:whether stale automation still reads the old secret。

操作测试也必须很窄。这就是本文坚持以清单形式呈现的原因。

仍需明确的未知项

  • whether multiple Coinbase accounts are open in the browser
  • whether a portfolio action needs broader scope
  • whether home or cloud IP changes silently
  • whether downloads sync to cloud folders
  • whether an SDK retries mutating calls
  • whether stale automation still reads the old secret

实用结论

安全设置 Coinbase CDP API-key 的第一步,是选择最窄权限,并从点击创建开始就把下载的 private key 当成 secret。Coinbase API-key guide 说明,用户在 Coinbase Developer Platform 创建 key,配置 nickname、portfolio、permission level 与 allowlisted IPs,然后完成 2FA,key JSON 会下载。Coinbase 还要求安全存储凭据、不要放进代码库,建议使用环境变量,并建议 IP allowlisting。教程结果是:创建 least-privilege key,把它存到 source control 之外,先测试 view-only endpoint,仅在必要时增加 trade permission,并记录撤销条件。 本文停在证据边界内,帮助读者决定下一步核验什么,而不是把公开文档改写成私人账户、钱包、API key、池子路径、稳定币余额、代币化资产或政策框架在任何未来条件下都能成功的承诺。

來源與證據

03
  1. Coinbase Developer PlatformCreate API Keys on Coinbase Developer Platform
  2. Coinbase Developer PlatformAdvanced Trade API Endpoints
  3. Coinbase Developer PlatformPython SDK Overview