]> git.mxchange.org Git - friendica.git/blob - spec/zot-2012.txt
Merge pull request #341 from fermionic/auto-orient-uploaded-images
[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@macgirvin.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 POST https://example.com/post
139
140 {
141 'type' => 'post'
142 'person' => $guuid
143 'address' => $gduid
144 'post' => $post_id
145 }
146
147 Returns:
148 {
149 'success' => 'true'
150 'message' => 'OK'
151 }
152
153
154 --------
155 Callback
156 --------
157
158 POST https://macgirvin.com
159
160 {
161 'retrieve' => $post_id
162 'challenge' => you_encrypt('abc123')
163 'verify' => me_encrypt('xyz456' . '.' . $gduid)
164 }
165
166 Returns:
167
168 {
169 'success' => 'true'
170 'message' => 'OK'
171 'response' => 'abc123'
172 'data' => encrypted or raw structured post
173 }
174
175