quivr.models.proof.proto Maven / Gradle / Ivy
The newest version!
syntax = "proto3";
import "scalapb/scalapb.proto";
import "scalapb/validate.proto";
package quivr.models;
import 'quivr/models/shared.proto';
import "validate/validate.proto";
// Proofs that are used to satisfy propositions
message Proof {
oneof value {
Locked locked = 1;
Digest digest = 2;
DigitalSignature digitalSignature = 3;
HeightRange heightRange = 4;
TickRange tickRange = 5;
ExactMatch exactMatch = 6;
LessThan lessThan = 7;
GreaterThan greaterThan = 8;
EqualTo equalTo = 9;
Threshold threshold = 10;
Not not = 11;
And and = 12;
Or or = 13;
}
// token = "locked"
message Locked {
// txBind = [0]
}
// token = "digest"
message Digest {
TxBind transactionBind = 1 [(validate.rules).message.required = true];
Preimage preimage = 2 [(validate.rules).message.required = true];
}
// token = "digital_signature"
message DigitalSignature {
TxBind transactionBind = 1 [(validate.rules).message.required = true];
Witness witness = 2 [(validate.rules).message.required = true];
}
// token = "height_range"
message HeightRange {
TxBind transactionBind = 1 [(validate.rules).message.required = true];
}
// token = "tick_range"
message TickRange {
TxBind transactionBind = 1 [(validate.rules).message.required = true];
}
// token = "exact_match"
message ExactMatch {
TxBind transactionBind = 1 [(validate.rules).message.required = true];
}
// token = "less_than"
message LessThan {
TxBind transactionBind = 1 [(validate.rules).message.required = true];
}
// token = "greater_than"
message GreaterThan {
TxBind transactionBind = 1 [(validate.rules).message.required = true];
}
// token = "equal_to"
message EqualTo {
TxBind transactionBind = 1 [(validate.rules).message.required = true];
}
// token = "threshold"
message Threshold {
TxBind transactionBind = 1 [(validate.rules).message.required = true];
// set of optional values
repeated Proof responses = 2;
}
// token = "not"
message Not {
TxBind transactionBind = 1 [(validate.rules).message.required = true];
Proof proof = 2 [(validate.rules).message.required = true];
}
// token = "and"
message And {
TxBind transactionBind = 1 [(validate.rules).message.required = true];
Proof left = 2 [(validate.rules).message.required = true];
Proof right = 3 [(validate.rules).message.required = true];
}
// token = "or"
message Or {
TxBind transactionBind = 1 [(validate.rules).message.required = true];
Proof left = 2 [(validate.rules).message.required = true];
Proof right = 3 [(validate.rules).message.required = true];
}
}
option (scalapb.options) = {
[scalapb.validate.file] {
validate_at_construction: true
}
field_transformations: [
{
when: {options: {[validate.rules] {message: {required: true}}}}
set: {
[scalapb.field] {
required: true
}
}
}
]
};