]> git.mxchange.org Git - friendica.git/blob - spec/zot-2012.txt
fix account_type
[friendica.git] / spec / zot-2012.txt
1
2 Initial cut at Zot-2012 protocol. This is a very rough draft of some very rough ideas and concepts. 
3 It is not yet intended to be a definitive specification and many things like the security handshakes are yet to be specified precisely. 
4
5 All communications are https
6
7
8 First create a global unique userid
9
10
11 Site userid:
12 https://macgirvin.com/1
13
14 $guuid = base64url_encode(hash('whirlpool','https://macgirvin.com/1.' . mt_rand(1000000,9999999),1);
15
16
17 Then create a hashed site destination.
18
19 $gduid = base64url_encode(hash('whirlpool', $guuid . 'https://macgirvin.com',1);
20
21 These two keys will identify you as a person+site pair in the future.
22 You will also obtain a password upon introducing yourself to a site.
23 This can be used to edit locations in the future. You will always keep your global unique userid
24
25
26 The steps to connect with somebody are to first register your location with their site.
27 Then introduce yourself to the person. This contains flags for the desired relationship.
28 At some future time, they may confirm and adjust the relationship based on their comfort level. 
29 Lack of confirmation is tantamount to denial. 
30
31 You can set either or both of FOLLOW and SHARE which indicates the relationship from your viewpoint.
32 They may do likewise.
33
34 A relationship is based on you as a person and provided you register new locations with the site you can post from anywhere.
35 You do not need to register locations with each person, only with the site.  
36
37
38 Introduce yourself to a site:
39
40
41 POST https://example.com/post
42
43 {
44 'type' => 'register'
45 'person' => $guuid
46 'address' => $gduid
47 'site' => 'https://macgirvin.com'
48 'info' => 'mike@macgirvin.com'
49 }
50
51 Returns:
52
53 {
54 'success' => 'true'
55 'pass' => me_encrypt($random_string)
56 }
57
58 ---
59 Add location
60 ---
61
62 POST https://example.com/post
63
64 {
65 'type' => 'location'
66 'person' => $guuid
67 'address' => $new_gduid
68 'site' => 'https://newsite.com'
69 'info' => 'mike@newsite.com'
70 'pass' => me_encrypt($gduid . '.' . $pass)
71 }
72
73 Returns:
74
75 {
76 'success' => 'true'
77 'pass' => me_encrypt($random_string)
78 }
79
80 ---
81 Remove location
82 ---
83
84 POST https://example.com/post
85
86 {
87 'type' => 'remove_location'
88 'person' => $guuid
89 'address' => $gduid
90 'pass' => me_encrypt($pass)
91 }
92
93 Returns:
94
95 {
96 'success' => 'true'
97 'message' => 'OK'
98 }
99
100
101 ------------
102 Make friends
103 ------------
104 This message may be reversed/repeated by the destination site to confirm.
105 flags is the desired friendship bits. The same message may be used with different flags 
106 to edit or remove a relationship.
107
108
109 POST https://example.com/post
110
111 {
112 'type' => 'contact'
113 'person' => $gduid
114 'address' => $guuid
115 'target' => 'bobjones@example.com'
116 'flags' => HIDDEN=0,FOLLOW=1,SHARE=1,NOHIDDEN=1,NOFOLLOW=0,NOSHARE=0
117 'confirm' => me_encrypt($guuid . '.' . $pass)
118 }
119
120 Returns:
121
122 {
123 'success' => 'true'
124 'message' => 'OK'
125 'flags' => PENDING=1
126 }
127
128
129
130
131
132
133
134 -------
135 Message
136 -------
137
138 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. 
139
140
141
142
143
144 POST https://example.com/post
145
146 {
147 'type' => 'post'
148 'person' => $guuid
149 'address' => $gduid
150 'post' => $post_id
151 }
152
153 Returns:
154 {
155 'success' => 'true'
156 'message' => 'OK'
157 }
158
159
160 --------
161 Callback
162 --------
163
164 POST https://macgirvin.com/post
165
166 {
167 'type' => 'retrieve'
168 'retrieve' => $post_id
169 'challenge' => you_encrypt('abc123')
170 'verify' => me_encrypt('xyz456' . '.' . $gduid)
171 }
172
173 Returns:
174
175 {
176 'success' => 'true'
177 'message' => 'OK'
178 'response' => 'abc123'
179 'data' => encrypted or raw structured post
180 }
181
182