From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id AE1565B1 for ; Tue, 7 Mar 2017 09:29:26 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-ua0-f169.google.com (mail-ua0-f169.google.com [209.85.217.169]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id D1013136 for ; Tue, 7 Mar 2017 09:29:25 +0000 (UTC) Received: by mail-ua0-f169.google.com with SMTP id u30so68180949uau.0 for ; Tue, 07 Mar 2017 01:29:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jamin-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=BVILZIm24cFq4X45pRaGKflI87FETShFs15vymH+kJY=; b=hWXRAuMtzH+bZZ7FE0lSGTPCBYExliAPwqv42xptM97YbphVjDX8WoyPwPnYM5U+Yq MuwHLNKNhx71KKJbdGEaJiyC3lgBnRNh2V7oRolBg5w1HHPUzAipcZm0EFyYOaEhWQWb BrQwJXRjOCEQhrBVeCrvpgBR7rvj0ktuyDTQvMdbYj9sEvurIWYcfp+OikGdud64vXPL 6p8WnJaQ0I5m0jFV1c+LmFKoqEdUDp0Y7xklHsicuF2qoNVExPyxUUARvUEq99KUkjxo IfXTYiEPA2sJbL9j80xlGHgsyhN43ra3o+urn1ZV3P7hN9qMVqhWC0RmgpztYi5TM6oo ciGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=BVILZIm24cFq4X45pRaGKflI87FETShFs15vymH+kJY=; b=qivHhuPR/jPW4LymT1c1rMiQyp3Y800dwxB6uDRNv11wo/Lki6+qvxNAunP9mM3CkE shPS1IbDJ17yIj85E8bd6pqQhDFCFL1hmoZPxJ8n81pylpzaIqEsKfn/AyJaS8Wa//eR MYwNdcZG+QEWcMS3a3wNPDLTky/UlxWCJkrpU1Ml+dG7XdmgNq4tZ5stpm3OIXrr/DVZ CuzRJ+ImNq9x4zt12CINelS50Vb+p/x06/HuBLWL16Grn1pZ+MkSzxAqwgWg0WfldiOu DeyEhrk+eiVEq01jLM1/SImC1IVBp1KI2lkfsA7Pi+WNWMymA9Gy41Qs4kzs8vtfOzsv o42A== X-Gm-Message-State: AMke39m6YUZJgNT8O72nu0rMYN2dSqL7X/8jvoPavOlJE+OwqOk7JGe7jqxnEB0SzrP/fmTekc3mtMcAdj6+lw== X-Received: by 10.176.69.137 with SMTP id u9mr9462888uau.164.1488878964777; Tue, 07 Mar 2017 01:29:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.30.194 with HTTP; Tue, 7 Mar 2017 01:29:24 -0800 (PST) In-Reply-To: <201703040827.33798.luke@dashjr.org> References: <201703040827.33798.luke@dashjr.org> From: Marcel Jamin Date: Tue, 7 Mar 2017 10:29:24 +0100 Message-ID: To: Luke Dashjr , Bitcoin Protocol Discussion Content-Type: text/plain; charset=UTF-8 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org X-Mailman-Approved-At: Tue, 07 Mar 2017 14:07:38 +0000 Subject: Re: [bitcoin-dev] Currency/exchange rate information API X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Mar 2017 09:29:26 -0000 > Why are multiple results separated by a line-feed rather than using a JSON Array? > * Clients ought to cache historical data, and using a line-feed format allows them to simply append to a cache file. > * Parsing JSON typically requires the entire data parsed together as a single memory object. Using simple lines to separate results, however, allows parsing a single result at a time. > What if long descriptions require line and paragraph breaks? > * Clients should word-wrap long lines, and JSON escapes newlines as "\n" which can be used doubly ("\n\n") for paragraph breaks. I'd file this under premature optimization at the cost of interoperability. If you use JSON, then please use it properly. I'd also say it's the job of the parser to offer a way of doing that, e.g. in .NET you can easily achieve that with Newtonsoft's JSON parser: http://stackoverflow.com/questions/20374083/deserialize-json-array-stream-one-item-at-a-time. On 4 March 2017 at 09:27, Luke Dashjr via bitcoin-dev wrote: > > Investigating what it would take to add fiat currency information to Bitcoin > Knots, I noticed Electrum currently has many implementations, one for each > exchange rate provider, due to lack of a common format for such data. > > Therefore, I put together an initial draft of a BIP that could standardise > this so wallets (or other software) and exchange rate providers can simply > interoperate without a lot of overhead reimplementing the same thing many > ways. > > One thing I am unsure about, is that currently this draft requires using XBT > (as BTC) for Bitcoin amounts. It would seem nicer to use satoshis, but those > don't really have a pseudo-ISO currency code to fit in nicely... > > Current draft here: > https://github.com/luke-jr/bips/blob/bip-xchgrate/bip-xchgrate.mediawiki > > Thoughts? Anything critical missing? Ways to make the interface better? > > Luke > _______________________________________________ > bitcoin-dev mailing list > bitcoin-dev@lists.linuxfoundation.org > https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev