From 3e461abe6e93424ab8558ad21553fc6f268e750f Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 18 Jun 2012 18:13:36 -0700 Subject: some psuedo code for the basic building blocks of zot-2012 - these are just ideas without a lot of the details yet filled in and this should NOT be used as any kind of definitive reference. --- spec/zot-2012.txt | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 spec/zot-2012.txt (limited to 'spec/zot-2012.txt') diff --git a/spec/zot-2012.txt b/spec/zot-2012.txt new file mode 100644 index 000000000..d2a4a5815 --- /dev/null +++ b/spec/zot-2012.txt @@ -0,0 +1,154 @@ + +First create a global unique userid + + +Site userid: +https://macgirvin.com/1 + +$guuid = base64url_encode(hash('whirlpool','https://macgirvin.com/1.' . mt_rand(1000000,9999999),1); + + +Then create a hashed site destination. + +$gduid = base64url_encode(hash('whirlpool', $guuid . 'https://macgirvin.com',1); + +These two keys will identify you as a person+site pair in the future. +You will also obtain a password upon introducing yourself to a site. +This can be used to edit locations in the future. You will always keep your global unique userid + + +Introduce yourself to a site: + + +POST https://example.com/post + +{ +'type' => 'register' +'person' => $guuid +'address' => $gduid +'site' => 'https://macgirvin.com' +'info' => 'mike@macgirvin.com' +} + +Returns: + +{ +'success' => 'true' +'pass' => me_encrypt($random_string) +} + +--- +Add location +--- + +POST https://example.com + +{ +'type' => 'location' +'person' => $guuid +'address' => $new_gduid +'site' => 'https://newsite.com' +'info' => 'mike@macgirvin.com' +'pass' => me_encrypt($gduid . '.' . $pass) +} + +Returns: + +{ +'success' => 'true' +'pass' => me_encrypt($random_string) +} + +--- +Remove location +--- + +POST https://example.com + +{ +'type' => 'remove_location' +'person' => $guuid +'address' => $gduid +'pass' => me_encrypt($pass) +} + +Returns: + +{ +'success' => 'true' +'message' => 'OK' +} + + +------------ +Make friends +------------ +This message may be reversed/repeated by the destination site to confirm + + +POST https://example.com/post + +{ +'type' => 'contact_add' +'person' => $gduid +'address' => $guuid +'target' => 'bobjones@example.com' +'flags' => HIDDEN=0,FOLLOW=1,SHARE=1 +'confirm' => me_encrypt($guuid . '.' . $pass) +} + +Returns: + +{ +'success' => 'true' +'message' => 'OK' +} + + + + + + + +------- +Message +------- + +POST https://example.com/post + +{ +'type' => 'post' +'person' => $guuid +'address' => $gduid +'post' => $post_id +} + +Returns: +{ +'success' => 'true' +'message' => 'OK' +} + + +-------- +Callback +-------- + +POST https://macgirvin.com + +{ +'retrieve' => $post_id +'challenge' => you_encrypt('abc123') +'verify' => me_encrypt('xyz456' . '.' . $gduid) +} + +Returns: + +{ +'success' => 'true' +'message' => 'OK' +'response' => 'abc123' +'data' => encrypted or raw structured post +} + + -- cgit v1.2.3 From 9374e1966fcb42ca45e6af788852be0aafd4e34e Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 18 Jun 2012 20:01:32 -0700 Subject: some doco to explain what's happening --- spec/zot-2012.txt | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'spec/zot-2012.txt') diff --git a/spec/zot-2012.txt b/spec/zot-2012.txt index d2a4a5815..b223a27ea 100644 --- a/spec/zot-2012.txt +++ b/spec/zot-2012.txt @@ -1,4 +1,10 @@ +Initial cut at Zot-2012 protocol. This is a very rough draft of some very rough ideas and concepts. +It is not yet intended to be a definitive specification and many things like the security handshakes are yet to be specified precisely. + +All communications are https + + First create a global unique userid @@ -17,6 +23,18 @@ You will also obtain a password upon introducing yourself to a site. This can be used to edit locations in the future. You will always keep your global unique userid +The steps to connect with somebody are to first register your location with their site. +Then introduce yourself to the person. This contains flags for the desired relationship. +At some future time, they may confirm and adjust the relationship based on their comfort level. +Lack of confirmation is tantamount to denial. + +You can set either or both of FOLLOW and SHARE which indicates the relationship from your viewpoint. +They may do likewise. + +A relationship is based on you as a person and provided you register new locations with the site you can post from anywhere. +You do not need to register locations with each person, only with the site. + + Introduce yourself to a site: @@ -41,7 +59,7 @@ Returns: Add location --- -POST https://example.com +POST https://example.com/post { 'type' => 'location' @@ -63,7 +81,7 @@ Returns: Remove location --- -POST https://example.com +POST https://example.com/post { 'type' => 'remove_location' @@ -83,17 +101,19 @@ Returns: ------------ Make friends ------------ -This message may be reversed/repeated by the destination site to confirm +This message may be reversed/repeated by the destination site to confirm. +flags is the desired friendship bits. The same message may be used with different flags +to edit or remove a relationship. POST https://example.com/post { -'type' => 'contact_add' +'type' => 'contact' 'person' => $gduid 'address' => $guuid 'target' => 'bobjones@example.com' -'flags' => HIDDEN=0,FOLLOW=1,SHARE=1 +'flags' => HIDDEN=0,FOLLOW=1,SHARE=1,NOHIDDEN=1,NOFOLLOW=0,NOSHARE=0 'confirm' => me_encrypt($guuid . '.' . $pass) } @@ -102,6 +122,7 @@ Returns: { 'success' => 'true' 'message' => 'OK' +'flags' => PENDING=1 } -- cgit v1.2.3 From 9dc51113477e315470c37e0f81728e91575a3963 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 18 Jun 2012 21:13:36 -0700 Subject: a bit more description of message passing --- spec/zot-2012.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec/zot-2012.txt') diff --git a/spec/zot-2012.txt b/spec/zot-2012.txt index b223a27ea..3b8d3272d 100644 --- a/spec/zot-2012.txt +++ b/spec/zot-2012.txt @@ -135,6 +135,12 @@ Returns: Message ------- +Passing messages is done asynchronously. This may (potentially) relieve a lot of the burden of distribution from the posting site. If you're on site 'A' and make a post, site 'A' just contacts any downstream sites and informs them that there is new content (via a $post_id). The downstream site initiates the actual data transfer. + + + + + POST https://example.com/post { -- cgit v1.2.3 From 00a01e4520a0e52589f28330d2267fd7126af4fe Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 18 Jun 2012 21:28:13 -0700 Subject: minor nits --- spec/zot-2012.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'spec/zot-2012.txt') diff --git a/spec/zot-2012.txt b/spec/zot-2012.txt index 3b8d3272d..4bfab16d8 100644 --- a/spec/zot-2012.txt +++ b/spec/zot-2012.txt @@ -161,9 +161,10 @@ Returns: Callback -------- -POST https://macgirvin.com +POST https://macgirvin.com/post { +'type' => 'retrieve' 'retrieve' => $post_id 'challenge' => you_encrypt('abc123') 'verify' => me_encrypt('xyz456' . '.' . $gduid) -- cgit v1.2.3 From 777830745f60359546195ae429deab50398fef0f Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 19 Jun 2012 00:50:24 -0700 Subject: missing $submit --- spec/zot-2012.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/zot-2012.txt') diff --git a/spec/zot-2012.txt b/spec/zot-2012.txt index 4bfab16d8..2e1f3c3c4 100644 --- a/spec/zot-2012.txt +++ b/spec/zot-2012.txt @@ -66,7 +66,7 @@ POST https://example.com/post 'person' => $guuid 'address' => $new_gduid 'site' => 'https://newsite.com' -'info' => 'mike@macgirvin.com' +'info' => 'mike@newsite.com' 'pass' => me_encrypt($gduid . '.' . $pass) } -- cgit v1.2.3