Exchange keys
Connecting an exchange is the one place Port_ holds a credential. It must be read only, it is checked before it is stored and again before every read wherever the exchange lets us ask, and it is never sent back out.
A wallet address is public, so reading one needs nothing from you. An exchange account is not, so reading your balances there needs the exchange’s permission. On most exchanges that permission is an API key you create on the exchange yourself and paste into Port_. Coinbase is connected by signing in to Coinbase and approving read access there, so there is no key to paste. That sign-in is built and not switched on yet, so Coinbase cannot be connected today. Which exchanges can be connected, and where each one keeps its keys, is in Exchanges.
Read only, checked before it is stored
Section titled “Read only, checked before it is stored”When you connect, Port_ asks the exchange what the key is allowed to do before anything is written. If the key can trade or withdraw, it is refused and never reaches the database. If the exchange cannot be reached, or will not say, the key is refused as well: “we could not check” is not the same answer as “it is safe”.
Gate and Crypto.com publish no way to ask what a key may do. On those two, the key is accepted and marked as unverified, and the connection says so beside it, asking you to check on the exchange that the key is read only. It is never shown as verified.
Create the key with read permission only. Port_ has no use for anything more, and the code that reads an exchange has no way to place an order or move funds: all it can ask an exchange is what a key may do, what the account holds, on some exchanges what has moved through it, and for SafeTrade its public prices.
Checked again before every read
Section titled “Checked again before every read”Wherever the exchange lets us ask, permissions are asked again every time a connection is read, not only when it was added. A key that gains trade or withdrawal permission later stops being read, and its row in Settings shows why. If you revoke the key on the exchange, the next read fails and the row says that too.
Sealed, and never sent back
Section titled “Sealed, and never sent back”- The credential is encrypted with AES-256-GCM before it is stored, with a key that lives in the server’s environment rather than beside the data. A server that cannot encrypt it refuses it.
- Nothing Port_ answers carries it back out, not even to you. A connection is shown by its exchange, the label you gave it and the last four characters of the key.
More on how credentials and everything else are kept is in What we hold and never hold.
A short answer is not an empty account
Section titled “A short answer is not an empty account”An exchange that answers an incomplete balance list looks exactly like an account that was emptied. So a read that is not unambiguously complete writes nothing and deletes nothing, and your last balances stay as they were. A balance goes to zero only when the exchange has answered for everything it holds and the asset is not there.
Removing a connection
Section titled “Removing a connection”Removing a connection deletes the stored credential at once, along with the balances read through it. To be sure nothing can use the key again, delete it on the exchange as well.