Currency/exchange rate information API



Summary:

The Bitcoin developer community is investigating the addition of fiat currency information to Bitcoin Knots. Electrum has several implementations for each exchange rate provider, due to a lack of a common format for such data. In response to this issue, Luke Dashjr has drafted a BIP that could standardize this problem to make wallets and exchange rate providers simply interoperate without the need to reimplement the same thing many times. The draft requires using XBT (as BTC) for Bitcoin amounts. This might not be an ideal option as satoshis don't have a pseudo-ISO currency code to fit in nicely. The format of JSON used in the API is called JSON Streaming. As long as exchanges implementing the API follow the BIP and keep one JSON object per line, it won't be a problem to decode. The usage of line-feed format allows clients to cache historical data and parsing JSON can happen one result at a time. Clients should word-wrap long lines, and JSON escapes newlines as "\n" which can also be used doubly ("\n\n") for paragraph breaks. It's suggested that if you use JSON, you should use it properly. The parser should offer a way of doing that.


Updated on: 2023-06-11T21:59:03.546860+00:00