From 29112cdf2afc871a0b1f7834c2b618886c2bea5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Fri, 17 Jan 2020 11:51:00 +0100 Subject: [PATCH] Add details how to do reads --- _storage/write-to-read.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/_storage/write-to-read.md b/_storage/write-to-read.md index 67998d5f..268822be 100644 --- a/_storage/write-to-read.md +++ b/_storage/write-to-read.md @@ -63,3 +63,16 @@ demonstrate that they control _that_ address. This is achieved via the authentication token which is a message _signed_ by the private key associated with that address. The message itself is a challenge text, returned via the `/hub_info/` endpoint. + +Reads can be done by everybody. The URLs to a user's app data are in a canonical location in their profile. For example, here's how you would get data from the + [Banter](https://banter.pub/) app, stored under the Blockstack ID `gavin.id`. + + 1. Get the bucket URL + `bash  $ BUCKET_URL="$(curl -sL https://core.blockstack.org/v1/users/gavin.id | jq -r '."gavin.id"["profile"]["apps"]["https://banter.pub"]')"  $ echo "$BUCKET_URL"  https://gaia.blockstack.org/hub/16E485MVpR3QpmjVkRgej7ya2Vnzu3jyTR/ ` + + 2. Get the data + `bash  $ curl -sL "${BUCKET_URL%%/}/Message/3e866af471d0-4072-beba-06ad1e7ad4bd"  {"content":"Anyone here?","votes":[],"createdBy":"gavin.id",...} ` + +This data is public and unencrypted. The same works for encrypted data. +Only the holder of the private key used for +encryption would be able to decrypt the data.