From 3b72c2540fa6201c4d086ac0b7f676a7220386ff Mon Sep 17 00:00:00 2001
From: Nicolas Mahe <nicolas@mahe.me>
Date: Mon, 2 Sep 2019 18:14:30 +0700
Subject: [PATCH 1/3] Update api/core proto to latest version

---
 src/protobuf/api/core.proto | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/protobuf/api/core.proto b/src/protobuf/api/core.proto
index 305e461..40afdee 100644
--- a/src/protobuf/api/core.proto
+++ b/src/protobuf/api/core.proto
@@ -24,7 +24,7 @@ message InfoRequest {}
 message InfoReply {
   message CoreService {
     string sid = 1;   // sid of the service
-    string hash = 2;  // hash of the service
+    bytes  hash = 2;  // hash of the service
     string url = 3;   // url used to deploy the service
     string key = 4;   // key to identify the core service
   }

From bdadeed6650565a2bb20487f45ec10e62029cd85 Mon Sep 17 00:00:00 2001
From: Nicolas Mahe <nicolas@mahe.me>
Date: Mon, 2 Sep 2019 18:14:34 +0700
Subject: [PATCH 2/3] 4.3.0-beta.3

---
 package-lock.json | 2 +-
 package.json      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package-lock.json b/package-lock.json
index c41f668..010dc3f 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
 {
   "name": "mesg-js",
-  "version": "4.3.0-beta.1",
+  "version": "4.3.0-beta.3",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {
diff --git a/package.json b/package.json
index f70ed33..abc9025 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "mesg-js",
-  "version": "4.3.0-beta.1",
+  "version": "4.3.0-beta.3",
   "description": "",
   "main": "lib/index.js",
   "scripts": {

From b751c92ff542ef257e96816957d82507398f9791 Mon Sep 17 00:00:00 2001
From: Anthony ESTEBE <anthony@mesg.com>
Date: Wed, 4 Sep 2019 15:13:16 +0700
Subject: [PATCH 3/3] update proto definitions

---
 src/protobuf/api/event.proto       |  21 +++-
 src/protobuf/api/execution.proto   |  26 +++-
 src/protobuf/api/instance.proto    |  26 +++-
 src/protobuf/api/process.proto     |  16 ++-
 src/protobuf/api/service.proto     |  20 +++-
 src/protobuf/types/event.proto     |  25 +++-
 src/protobuf/types/execution.proto |  73 ++++++++---
 src/protobuf/types/instance.proto  |  17 ++-
 src/protobuf/types/process.proto   | 186 +++++++++++++++++++++++------
 src/protobuf/types/service.proto   |  64 +++++-----
 10 files changed, 362 insertions(+), 112 deletions(-)

diff --git a/src/protobuf/api/event.proto b/src/protobuf/api/event.proto
index 0b76519..7e77ba6 100644
--- a/src/protobuf/api/event.proto
+++ b/src/protobuf/api/event.proto
@@ -1,6 +1,7 @@
 syntax = "proto3";
 
 import "google/protobuf/struct.proto";
+import "gogo/protobuf/gogoproto/gogo.proto";
 import "protobuf/types/event.proto";
 
 package api;
@@ -24,10 +25,16 @@ message StreamEventRequest {
   // Filter contains filtering criteria.
   message Filter {
     // hash to filter events.
-    bytes hash = 1;
+    bytes hash = 1 [
+      (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+      (gogoproto.nullable) = false
+    ];
 
     // instance's hash to filter events.
-    bytes instanceHash = 2;
+    bytes instanceHash = 2 [
+      (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+      (gogoproto.nullable) = false
+    ];
 
     // key is the key of the event.
     string key = 3;
@@ -40,7 +47,10 @@ message StreamEventRequest {
 // CreateEventRequest defines request for execution update.
 message CreateEventRequest {
   // instanceHash is hash of instance that can proceed an execution.
-  bytes instanceHash = 1;
+  bytes instanceHash = 1 [
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
 
   // key is the key of the event.
   string key = 2;
@@ -52,5 +62,8 @@ message CreateEventRequest {
 // CreateEventResponse defines response for execution update.
 message CreateEventResponse {
   // Hash represents event.
-  bytes hash = 1;
+  bytes hash = 1 [
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
 }
diff --git a/src/protobuf/api/execution.proto b/src/protobuf/api/execution.proto
index fc1ca26..918742e 100644
--- a/src/protobuf/api/execution.proto
+++ b/src/protobuf/api/execution.proto
@@ -1,6 +1,7 @@
 syntax = "proto3";
 
 import "google/protobuf/struct.proto";
+import "gogo/protobuf/gogoproto/gogo.proto";
 import "protobuf/types/execution.proto";
 
 package api;
@@ -28,7 +29,10 @@ service Execution {
 
 // CreateExecutionRequest defines request to create a single execution.
 message CreateExecutionRequest {
-  bytes instanceHash = 1;
+  bytes instanceHash = 1 [
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
   string taskKey = 2;
   google.protobuf.Struct inputs = 3;
   repeated string tags = 4;
@@ -37,13 +41,19 @@ message CreateExecutionRequest {
 // CreateExecutionResponse defines response for execution creation.
 message CreateExecutionResponse {
   // Execution's hash.
-  bytes hash = 1;
+  bytes hash = 1 [
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
 }
 
 // GetExecutionRequest defines request to retrieve a single execution.
 message GetExecutionRequest {
   // Execution's hash to fetch.
-  bytes hash = 1;
+  bytes hash = 1 [
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
 }
 
 // StreamExecutionRequest defines request to retrieve a stream of executions.
@@ -54,7 +64,10 @@ message StreamExecutionRequest{
     repeated types.Status statuses = 1;
 
     // Instance's hash to filter executions.
-    bytes instanceHash = 2;
+    bytes instanceHash = 2 [
+      (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+      (gogoproto.nullable) = false
+    ];
 
     // taskKey to filter executions.
     string taskKey = 3;
@@ -70,7 +83,10 @@ message StreamExecutionRequest{
 // UpdateExecutionRequest defines request for execution update.
 message UpdateExecutionRequest {
   // Hash represents execution.
-  bytes hash = 1;
+  bytes hash = 1 [
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
 
   // result pass to execution
   oneof result {
diff --git a/src/protobuf/api/instance.proto b/src/protobuf/api/instance.proto
index 12c7691..951a7e0 100644
--- a/src/protobuf/api/instance.proto
+++ b/src/protobuf/api/instance.proto
@@ -1,6 +1,7 @@
 syntax = "proto3";
 
 import "protobuf/types/instance.proto";
+import "gogo/protobuf/gogoproto/gogo.proto";
 
 package api;
 
@@ -27,13 +28,19 @@ service Instance {
 
 // The request's data for the `Get` API.
 message GetInstanceRequest {
-  bytes hash = 1;
+  bytes hash = 1 [
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
 }
 
 // The request's data for the `List` API.
 message ListInstancesRequest {
   // Filter by Services' hash.
-  bytes serviceHash = 1;
+  bytes serviceHash = 1 [
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
 }
 
 // The response's data for the `List` API.
@@ -45,7 +52,10 @@ message ListInstancesResponse {
 // The request's data for the `Create` API.
 message CreateInstanceRequest {
   // Service's hash.
-  bytes serviceHash = 1;
+  bytes serviceHash = 1 [
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
 
   // Environmental variables to apply to the Instance.
   repeated string env = 2;
@@ -54,13 +64,19 @@ message CreateInstanceRequest {
 // The response's data for the `Create` API.
 message CreateInstanceResponse {
   // The instance's hash created.
-  bytes hash = 1;
+  bytes hash = 1 [
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
 }
 
 // The request's data for the `Delete` API.
 message DeleteInstanceRequest {
   // Instance's hash
-  bytes hash = 1;
+  bytes hash = 1 [
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
 
   // If true, any persistent data (volumes) that belongs to the instance and its dependencies will also be deleted.
   bool deleteData = 2;
diff --git a/src/protobuf/api/process.proto b/src/protobuf/api/process.proto
index 244e9d2..7c54195 100644
--- a/src/protobuf/api/process.proto
+++ b/src/protobuf/api/process.proto
@@ -1,5 +1,6 @@
 syntax = "proto3";
 
+import "gogo/protobuf/gogoproto/gogo.proto";
 import "protobuf/types/process.proto";
 
 package api;
@@ -36,13 +37,19 @@ message CreateProcessRequest {
 // The response's data for the `Create` API.
 message CreateProcessResponse {
   // The process's hash created.
-  bytes hash = 1;
+  bytes hash = 1 [
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
 }
 
 // The request's data for the `Delete` API.
 message DeleteProcessRequest {
   // The process's hash to delete.
-  bytes hash = 1;
+  bytes hash = 1 [
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
 }
 
 // The response's data for the `Delete` API, doesn't contain anything.
@@ -52,7 +59,10 @@ message DeleteProcessResponse {
 // The request's data for the `Get` API.
 message GetProcessRequest {
   // The process's hash to fetch.
-  bytes hash = 1;
+  bytes hash = 1 [
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
 }
 
 // The request's data for the `List` API.
diff --git a/src/protobuf/api/service.proto b/src/protobuf/api/service.proto
index 9dbaa2c..10e9761 100644
--- a/src/protobuf/api/service.proto
+++ b/src/protobuf/api/service.proto
@@ -1,6 +1,7 @@
 syntax = "proto3";
 
 import "protobuf/types/service.proto";
+import "gogo/protobuf/gogoproto/gogo.proto";
 
 package api;
 
@@ -38,7 +39,9 @@ message CreateServiceRequest {
   string description = 3;
 
   // Configurations related to the service
-  types.Service.Configuration configuration = 4;
+  types.Service.Configuration configuration = 4 [
+    (gogoproto.nullable) = false
+  ];
 
   // The list of tasks this service can execute.
   repeated types.Service.Task tasks = 5;
@@ -59,13 +62,19 @@ message CreateServiceRequest {
 // The response's data for the `Create` API.
 message CreateServiceResponse {
   // The service's hash created.
-  bytes hash = 1;
+  bytes hash = 1 [
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
 }
 
 // The request's data for the `Delete` API.
 message DeleteServiceRequest {
   // The service's hash to delete.
-  bytes hash = 1;
+  bytes hash = 1 [
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
 }
 
 // The response's data for the `Delete` API, doesn't contain anything.
@@ -75,7 +84,10 @@ message DeleteServiceResponse {
 // The request's data for the `Get` API.
 message GetServiceRequest {
   // The service's hash to fetch.
-  bytes hash = 1;
+  bytes hash = 1 [
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
 }
 
 // The request's data for the `List` API.
diff --git a/src/protobuf/types/event.proto b/src/protobuf/types/event.proto
index 81fc5c2..77bf080 100644
--- a/src/protobuf/types/event.proto
+++ b/src/protobuf/types/event.proto
@@ -1,21 +1,36 @@
 syntax = "proto3";
 
 import "google/protobuf/struct.proto";
+import "gogo/protobuf/gogoproto/gogo.proto";
 
 package types;
-option go_package = "github.com/mesg-foundation/engine/protobuf/types";
+option go_package = "github.com/mesg-foundation/engine/event";
+
+option (gogoproto.goproto_getters_all) = false;
 
 // Event represents a single event run in engine.
 message Event {
   // Hash is a unique hash to identify event.
-  bytes hash = 1;
+  bytes hash = 1 [
+    (gogoproto.moretags) = 'hash:"-"',
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
 
   // instanceHash is hash of instance that can proceed an execution.
-  bytes instanceHash = 2;
+  bytes instanceHash = 2 [
+    (gogoproto.moretags) = 'hash:"name:2"',
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
 
   // key is the key of the event.
-  string key = 3;
+  string key = 3 [
+    (gogoproto.moretags) = 'hash:"name:3"'
+  ];
 
   // data is the data for the event.
-  google.protobuf.Struct data = 4;
+  google.protobuf.Struct data = 4 [
+    (gogoproto.moretags) = 'hash:"name:4"'
+  ];
 }
diff --git a/src/protobuf/types/execution.proto b/src/protobuf/types/execution.proto
index f30509f..27a9b05 100644
--- a/src/protobuf/types/execution.proto
+++ b/src/protobuf/types/execution.proto
@@ -1,9 +1,12 @@
 syntax = "proto3";
 
 import "google/protobuf/struct.proto";
+import "gogo/protobuf/gogoproto/gogo.proto";
 
 package types;
-option go_package = "github.com/mesg-foundation/engine/protobuf/types";
+option go_package = "github.com/mesg-foundation/engine/execution";
+
+option (gogoproto.goproto_getters_all) = false;
 
 // Status represents the status of a single execution.
 // Note that a valid execution must have only one status
@@ -28,38 +31,74 @@ enum Status {
 // Execution represents a single execution run in engine.
 message Execution {
   // Hash is a unique hash to identify execution.
-  bytes hash = 1;
-
-  // parentHash is the unique hash of parent execution. if execution is triggered by another one, dependency execution considered as the parent.
-  bytes parentHash = 2;
+  bytes hash = 1 [
+    (gogoproto.moretags) = 'hash:"-"',
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
+
+  // parentHash is the unique hash of parent execution.
+  // if execution is triggered by another one,
+  // dependency execution considered as the parent.
+  bytes parentHash = 2 [
+    (gogoproto.moretags) = 'hash:"name:2"',
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
 
   // eventHash is unique event hash.
-  bytes eventHash = 3;
+  bytes eventHash = 3 [
+    (gogoproto.moretags) = 'hash:"name:3"',
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
 
   // Status is the current status of execution.
-  Status status = 4;
+  Status status = 4 [
+    (gogoproto.moretags) = 'hash:"-"'
+  ];
 
   // instanceHash is hash of the instance that can proceed an execution
-  bytes instanceHash = 5;
+  bytes instanceHash = 5 [
+    (gogoproto.moretags) = 'hash:"name:5"',
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
 
   // taskKey is the key of the task of this execution.
-  string taskKey = 6;
+  string taskKey = 6 [
+    (gogoproto.moretags) = 'hash:"name:6"'
+  ];
 
   // inputs data of the execution.
-  google.protobuf.Struct inputs = 7;
+  google.protobuf.Struct inputs = 7 [
+    (gogoproto.moretags) = 'hash:"name:7"'
+  ];
 
   // outputs are the returned data of successful execution.
-  google.protobuf.Struct outputs = 8;
+  google.protobuf.Struct outputs = 8 [
+    (gogoproto.moretags) = 'hash:"-"'
+  ];
 
   // error message of a failed execution.
-  string error = 9;
+  string error = 9 [
+    (gogoproto.moretags) = 'hash:"-"'
+  ];
 
   // tags are optionally associated with execution by the user.
-  repeated string tags = 10;
+  repeated string tags = 10 [
+    (gogoproto.moretags) = 'hash:"name:10"'
+  ];
 
   // processHash is the unique hash of the process associated to this execution.
-  bytes processHash = 11;
-
-  // step of the process.
-  string stepID = 12;
+  bytes processHash = 11 [
+    (gogoproto.moretags) = 'hash:"name:11"',
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
+
+  // step of the workflow.
+  string stepID = 12 [
+    (gogoproto.moretags) = 'hash:"name:12"'
+  ];
 }
diff --git a/src/protobuf/types/instance.proto b/src/protobuf/types/instance.proto
index 5731fbb..13920dd 100644
--- a/src/protobuf/types/instance.proto
+++ b/src/protobuf/types/instance.proto
@@ -1,10 +1,21 @@
 syntax = "proto3";
 
+import "gogo/protobuf/gogoproto/gogo.proto";
+
 package types;
-option go_package = "github.com/mesg-foundation/engine/protobuf/types";
+option go_package = "github.com/mesg-foundation/engine/instance";
+
+option (gogoproto.goproto_getters_all) = false;
 
 // Instance represents service's instance.
 message Instance {
-  bytes hash = 1;
-  bytes serviceHash = 2;
+  bytes hash = 1 [
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
+
+  bytes serviceHash = 2 [
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
 }
diff --git a/src/protobuf/types/process.proto b/src/protobuf/types/process.proto
index b9d1112..073d80d 100644
--- a/src/protobuf/types/process.proto
+++ b/src/protobuf/types/process.proto
@@ -1,77 +1,195 @@
 syntax = "proto3";
 
+import "gogo/protobuf/gogoproto/gogo.proto";
+
 package types;
-option go_package = "github.com/mesg-foundation/engine/protobuf/types";
+option go_package = "github.com/mesg-foundation/engine/process";
+
+option (gogoproto.goproto_getters_all) = false;
 
 // A process is a configuration to trigger a specific task when certains conditions of a trigger are valid.
 message Process {
   // Node of the process
   message Node {
     message Result {
-      string key = 1;           // Key that identifies the node.
-      bytes instanceHash = 2;  // Hash of the instance that triggers the process.
-      string taskKey = 3;       // Key of the task that triggers the process.
+      // Key that identifies the node.
+      string key = 1 [
+        (gogoproto.moretags) = 'hash:"name:1" validate:"required"'
+      ];
+
+      // Hash of the instance that triggers the process.
+      bytes instanceHash = 2 [
+        (gogoproto.moretags) = 'hash:"name:2" validate:"required"',
+        (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+        (gogoproto.nullable) = false
+      ];
+
+      // Key of the task that triggers the process.
+      string taskKey = 3 [
+        (gogoproto.moretags) = 'hash:"name:3" validate:"printascii,required"'
+      ];
     }
 
     message Event {
-      string key = 1;           // Key that identifies the node.
-      bytes instanceHash = 2;  // Hash of the instance that triggers the process.
-      string eventKey = 3;      // Key of the event that triggers the process.
+      // Key that identifies the node.
+      string key = 1 [
+        (gogoproto.moretags) = 'hash:"name:1" validate:"required"'
+      ];
+
+      // Hash of the instance that triggers the process.
+      bytes instanceHash = 2 [
+        (gogoproto.moretags) = 'hash:"name:2" validate:"required"',
+        (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+        (gogoproto.nullable) = false
+      ];
+
+      // Key of the event that triggers the process.
+      string eventKey = 3 [
+        (gogoproto.moretags) = 'hash:"name:3" validate:"printascii,required"'
+      ];
     }
 
     message Task {
-      string key = 1;           // Key that identifies the node.
-      bytes instanceHash = 2;  // Hash of the instance to execute.
-      string taskKey = 3;       // Task of the instance to execute.
+      // Key that identifies the node.
+      string key = 1 [
+        (gogoproto.moretags) = 'hash:"name:1" validate:"required"'
+      ];
+
+      // Hash of the instance to execute.
+      bytes instanceHash = 2 [
+        (gogoproto.moretags) = 'hash:"name:2" validate:"required"',
+        (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+        (gogoproto.nullable) = false
+      ];
+
+      // Task of the instance to execute.
+      string taskKey = 3 [
+        (gogoproto.moretags) = 'hash:"name:3" validate:"printascii,required"'
+      ];
     }
 
     message Map {
       message Output {
         message Reference {
-          string nodeKey = 1; // Key of the node in the graph. If empty, will be using the src of the edge.
-          string key = 2;     // Key of a specific parameter of the referenced node's output data.
+          // Key of the node in the graph. If empty, will be using the src of the edge.
+          string nodeKey = 1 [
+            (gogoproto.moretags) = 'hash:"name:1" validate:"required"'
+          ];
+
+          // Key of a specific parameter of the referenced node's output data.
+          string key = 2 [
+            (gogoproto.moretags) = 'hash:"name:2" validate:"required"'
+          ];
         }
 
-        string key = 1;       // Key of the output.
+        // Key of the output.
+        string key = 1 [
+          (gogoproto.moretags) = 'hash:"name:1" validate:"required"'
+        ];
+
         oneof value {
-          Reference ref = 2;  // Input defined as reference.
+          // Input defined as reference.
+          Reference ref = 2 [
+            (gogoproto.moretags) = 'hash:"name:2" validate:"required"'
+          ];
         }
       }
-      string key = 1;               // Key of the mapping.
-      repeated Output outputs = 2;  // Outputs of the mapping.
+
+      // Key of the mapping.
+      string key = 1 [
+        (gogoproto.moretags) = 'hash:"name:1" validate:"required"'
+      ];
+
+      // Outputs of the mapping.
+      repeated Output outputs = 2 [
+        (gogoproto.moretags) = 'hash:"name:2" validate:"dive,required"'
+      ];
     }
+
     message Filter {
       message Condition {
         // Type of condition available to compare the values.
         enum Predicate {
-          Unknown = 0;  // Predicate not defined.
-          EQ = 1;       // Equal
+          // Predicate not defined.
+          Unknown = 0;
+
+          // Equal
+          EQ = 1;
         }
 
-        string key = 1;           // Key to check.
-        Predicate predicate = 2;  // Type of condition to apply.
-        string value = 3;         // Value of the filter. 
+        // Key to check.
+        string key = 1 [
+          (gogoproto.moretags) = 'hash:"name:1" validate:"required,printascii"'
+        ];
+
+        // Type of condition to apply.
+        Predicate predicate = 2 [
+          (gogoproto.moretags) = 'hash:"name:2" validate:"required"'
+        ];
+
+        // Value of the filter.
+        string value = 3 [
+          (gogoproto.moretags) = 'hash:"name:3"'
+        ];
       }
-      string key = 1;                     // Key for the filter
-      repeated Condition conditions = 2;  // List of condition to apply for this filter
+
+      // Key for the filter
+      string key = 1 [
+        (gogoproto.moretags) = 'hash:"name:1" validate:"required"'
+      ];
+
+      // List of condition to apply for this filter
+      repeated Condition conditions = 2 [
+        (gogoproto.moretags) = 'hash:"name:2"',
+        (gogoproto.nullable) = false
+      ];
     }
 
     oneof type {
-      Result result = 1;  // Result is a trigger that listens for a specific result.
-      Event event = 2;    // Event is a trigger that listens for a specific event.
-      Task task = 3;      // Task is a command to execute a specific task.
-      Map map = 4;        // Map is a set of instructions to convert data.
-      Filter filter = 5;  // Filter is a list of condition to apply on data.
+      // Result is a trigger that listens for a specific result.
+      Result result = 1;
+      // Event is a trigger that listens for a specific event.
+      Event event = 2;
+      // Task is a command to execute a specific task.
+      Task task = 3;
+      // Map is a set of instructions to convert data.
+      Map map = 4;
+      // Filter is a list of condition to apply on data.
+      Filter filter = 5;
     }
   }
 
   message Edge {
-    string src = 1;   // Source of the edge.
-    string dst = 2;   // Destination of the edge.
+    // Source of the edge.
+    string src = 1 [
+      (gogoproto.moretags) = 'hash:"name:1" validate:"required"'
+    ];
+
+    // Destination of the edge.
+    string dst = 2 [
+      (gogoproto.moretags) = 'hash:"name:2" validate:"required"'
+    ];
   }
 
-  bytes hash = 1;          // Process's hash
-  string key = 2;           // Process's key
-  repeated Node nodes = 4;  // Nodes with information related to the execution to trigger.
-  repeated Edge edges = 5;  // Edges to create the link between the nodes.
+  // Process's hash
+  bytes hash = 1 [
+    (gogoproto.moretags) = 'hash:"-" validate:"required"',
+    (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
+    (gogoproto.nullable) = false
+  ];
+
+  // Process's key
+  string key = 2 [
+    (gogoproto.moretags) = 'hash:"name:2" validate:"required"'
+  ];
+
+  // Nodes with information related to the execution to trigger.
+  repeated Node nodes = 4 [
+    (gogoproto.moretags) = 'hash:"name:4" validate:"dive,required"'
+  ];
+
+  // Edges to create the link between the nodes.
+  repeated Edge edges = 5 [
+    (gogoproto.moretags) = 'hash:"name:5" validate:"dive,required"'
+  ];
 }
diff --git a/src/protobuf/types/service.proto b/src/protobuf/types/service.proto
index 96b95ee..132340f 100644
--- a/src/protobuf/types/service.proto
+++ b/src/protobuf/types/service.proto
@@ -14,22 +14,22 @@ message Service {
   message Event {
     // Event's key.
     string key = 4 [
-      (gogoproto.moretags) = 'hash:"name:1" validate:"printascii"'
+      (gogoproto.moretags) = 'hash:"name:4" validate:"printascii"'
     ];
 
     // Event's name.
     string name = 1 [
-      (gogoproto.moretags) = 'hash:"name:2" validate:"printascii"'
+      (gogoproto.moretags) = 'hash:"name:1" validate:"printascii"'
     ];
 
     // Event's description.
     string description = 2 [
-      (gogoproto.moretags) = 'hash:"name:3" validate:"printascii"'
+      (gogoproto.moretags) = 'hash:"name:2" validate:"printascii"'
     ];
 
     // List of data of this event.
     repeated Parameter data = 3 [
-      (gogoproto.moretags) = 'hash:"name:4" validate:"dive,required"'
+      (gogoproto.moretags) = 'hash:"name:3" validate:"dive,required"'
     ];
   }
 
@@ -37,27 +37,27 @@ message Service {
   message Task {
     // Task's key.
     string key = 8 [
-      (gogoproto.moretags) = 'hash:"name:1" validate:"printascii"'
+      (gogoproto.moretags) = 'hash:"name:8" validate:"printascii"'
     ];
 
     // Task's name.
     string name = 1 [
-      (gogoproto.moretags) = 'hash:"name:2" validate:"printascii"'
+      (gogoproto.moretags) = 'hash:"name:1" validate:"printascii"'
     ];
 
     // Task's description.
     string description = 2 [
-      (gogoproto.moretags) = 'hash:"name:3" validate:"printascii"'
+      (gogoproto.moretags) = 'hash:"name:2" validate:"printascii"'
     ];
 
     // List inputs of this task.
     repeated Parameter inputs = 6 [
-      (gogoproto.moretags) = 'hash:"name:4" validate:"dive,required"'
+      (gogoproto.moretags) = 'hash:"name:6" validate:"dive,required"'
     ];
 
     // List of tasks outputs.
     repeated Parameter outputs = 7 [
-      (gogoproto.moretags) = 'hash:"name:5" validate:"dive,required"'
+      (gogoproto.moretags) = 'hash:"name:7" validate:"dive,required"'
     ];
   }
 
@@ -66,37 +66,37 @@ message Service {
 
     // Parameter's key.
     string key = 8 [
-      (gogoproto.moretags) = 'hash:"name:1" validate:"printascii"'
+      (gogoproto.moretags) = 'hash:"name:8" validate:"printascii"'
     ];
 
     // Parameter's name.
     string name = 1 [
-      (gogoproto.moretags) = 'hash:"name:2" validate:"printascii"'
+      (gogoproto.moretags) = 'hash:"name:1" validate:"printascii"'
     ];
 
     // Parameter's description.
     string description = 2 [
-      (gogoproto.moretags) = 'hash:"name:3" validate:"printascii"'
+      (gogoproto.moretags) = 'hash:"name:2" validate:"printascii"'
     ];
 
     // Parameter's type: `String`, `Number`, `Boolean`, `Object` or `Any`.
     string type = 3 [
-      (gogoproto.moretags) = 'hash:"name:4" validate:"required,printascii,oneof=String Number Boolean Object Any"'
+      (gogoproto.moretags) = 'hash:"name:3" validate:"required,printascii,oneof=String Number Boolean Object Any"'
     ];
 
     // Set the parameter as optional.
     bool optional = 4 [
-      (gogoproto.moretags) = 'hash:"name:5"'
+      (gogoproto.moretags) = 'hash:"name:4"'
     ];
 
     // Mark a parameter as an array of the defined type.
     bool repeated = 9 [
-      (gogoproto.moretags) = 'hash:"name:7"'
+      (gogoproto.moretags) = 'hash:"name:9"'
     ];
 
     // Optional object structure type when type is set to `Object`.
     repeated Parameter object = 10 [
-      (gogoproto.moretags) = 'hash:"name:7" validate:"unique,dive,required"'
+      (gogoproto.moretags) = 'hash:"name:10" validate:"unique,dive,required"'
     ];
   }
 
@@ -137,27 +137,27 @@ message Service {
   message Dependency {
     // Dependency's key.
     string key = 8 [
-      (gogoproto.moretags) = 'hash:"name:1" validate:"printascii"'
+      (gogoproto.moretags) = 'hash:"name:8" validate:"printascii"'
     ];
 
     // Image's name of the container.
     string image = 1 [
-      (gogoproto.moretags) = 'hash:"name:2" validate:"printascii"'
+      (gogoproto.moretags) = 'hash:"name:1" validate:"printascii"'
     ];
 
     // List of volumes.
     repeated string volumes = 2 [
-      (gogoproto.moretags) = 'hash:"name:3" validate:"unique,dive,printascii"'
+      (gogoproto.moretags) = 'hash:"name:2" validate:"unique,dive,printascii"'
     ];
 
     // List of volumes mounted from other dependencies.
     repeated string volumesFrom = 3 [
-      (gogoproto.moretags) = 'hash:"name:4" validate:"unique,dive,printascii"'
+      (gogoproto.moretags) = 'hash:"name:3" validate:"unique,dive,printascii"'
     ];
 
     // List of ports the container exposes.
     repeated string ports = 4 [
-      (gogoproto.moretags) = 'hash:"name:5" validate:"unique,dive,portmap"'
+      (gogoproto.moretags) = 'hash:"name:4" validate:"unique,dive,portmap"'
     ];
 
     // Args to pass to the container.
@@ -167,35 +167,35 @@ message Service {
 
     // Command to run the container.
     string command = 5 [
-      (gogoproto.moretags) = 'hash:"name:7" validate:"printascii"'
+      (gogoproto.moretags) = 'hash:"name:5" validate:"printascii"'
     ];
 
     // Default env vars to apply to service's instance on runtime.
     repeated string env = 9 [
-      (gogoproto.moretags) = 'hash:"name:8" validate:"unique,dive,env"'
+      (gogoproto.moretags) = 'hash:"name:9" validate:"unique,dive,env"'
     ];
   }
 
   // Service's hash.
   bytes hash = 10 [
-    (gogoproto.moretags) = 'validate:"required"',
+    (gogoproto.moretags) = 'hash:"-" validate:"required"',
     (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
     (gogoproto.nullable) = false
   ];
 
   // Service's sid.
   string sid = 12  [
-    (gogoproto.moretags) = 'validate:"required,printascii,max=63,domain"'
+    (gogoproto.moretags) = 'hash:"name:12" validate:"required,printascii,max=63,domain"'
   ];
 
   // Service's name.
   string name = 1 [
-    (gogoproto.moretags) = 'hash:"name:2" validate:"required,printascii"'
+    (gogoproto.moretags) = 'hash:"name:1" validate:"required,printascii"'
   ];
 
   // Service's description.
   string description = 2 [
-    (gogoproto.moretags) = 'hash:"name:3" validate:"printascii"'
+    (gogoproto.moretags) = 'hash:"name:2" validate:"printascii"'
   ];
 
   // Configurations related to the service
@@ -206,26 +206,26 @@ message Service {
 
   // The list of tasks this service can execute.
   repeated Task tasks = 5 [
-    (gogoproto.moretags) = 'hash:"name:4" validate:"dive,required"'
+    (gogoproto.moretags) = 'hash:"name:5" validate:"dive,required"'
   ];
 
   // The list of events this service can emit.
   repeated Event events = 6 [
-    (gogoproto.moretags) = 'hash:"name:5" validate:"dive,required"'
+    (gogoproto.moretags) = 'hash:"name:6" validate:"dive,required"'
   ];
 
   // The container dependencies this service requires.
   repeated Dependency dependencies = 7 [
-    (gogoproto.moretags) = 'hash:"name:6" validate:"dive,required"'
+    (gogoproto.moretags) = 'hash:"name:7" validate:"dive,required"'
   ];
 
   // Service's repository url.
   string repository = 9 [
-    (gogoproto.moretags) = 'hash:"name:7" validate:"omitempty,uri"'
+    (gogoproto.moretags) = 'hash:"name:9" validate:"omitempty,uri"'
   ];
 
   // The hash id of service's source code on IPFS.
   string source = 13 [
-    (gogoproto.moretags) = 'hash:"name:9" validate:"required,printascii"'
+    (gogoproto.moretags) = 'hash:"name:13" validate:"required,printascii"'
   ];
 }