client.proto 1.33 KB
Newer Older
Axel's avatar
Axel committed
1
2
3
4
5
6
7
8
9
10
11
12
13
syntax = "proto3";

package api;

import "dfss/dfssp/api/platform.proto";

service Client {
	rpc TreatPromise(Promise) returns (ErrorCode) {}
	rpc TreatSignature(Signature) returns (ErrorCode) {}
	rpc Discover(Hello) returns (Hello) {}
}

// Promise message contains all the required information to verify
14
// the identity of the sender and reciever, and the actual promise
15
16
17
//
// * sequence is transmitted by platform and identical across clients
// * TODO implement an global signature for content
Axel's avatar
Axel committed
18
message Promise {
19
20
21
22
23
24
25
    bytes recipientKeyHash = 1; // SHA-512
    bytes senderKeyHash = 2;    // SHA-512
	uint32 index = 3;  // The index of the sequence for this message
    string contractDocumentHash = 4; // Hash of the contract to be signed
	string signatureUuid = 5; // Avoid re-use of the promise in another ctx
    string contractUuid = 6;
    // TODO the crypto payload
Axel's avatar
Axel committed
26
27
28
29
30
31
32
33
34
35
36
37
}

// Signature message contains all the required information to verify
// the identity of the sender and reciever, and the actual signature
message Signature {
	bytes recipientKeyHash = 1;	// SHA-512
	bytes senderKeyHash = 2;	// SHA-512
	string signature = 3;		// Cryptographic signature
	string signatureUuid = 4;
	string contractUuid = 5;
}

38
39
// Hello message is used when discovering peers. 
// It contains the current version of the software.
Axel's avatar
Axel committed
40
41
message Hello {
	string version = 1;
42
}