All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sdk.models.box.lock.proto Maven / Gradle / Ivy

The newest version!
syntax = "proto3";
import "scalapb/scalapb.proto";
import "scalapb/validate.proto";
import "validate/validate.proto";


package xyz.stratalab.sdk.models.box;


import 'sdk/models/identifier.proto';
import 'sdk/models/box/challenge.proto';

// used to lock a box value and needs to be satisfied in order for the value of the box to be spent
// should be able to calculate or retrieve the root of the Lock
// - from Predicate -> Image -> Commitment -> Signable -> Evidence
message Lock {
    oneof value {
        Predicate predicate = 1;
        Image image = 2;
        Commitment commitment = 3;
    }

    // Private information
    // a Predicate is a type of lock that will be satisfied if at least the threshold number of the contained proposition are satisfied
    message Predicate {
        // this should probably be a non-empty chain
        repeated Challenge challenges = 1;
        uint32 threshold = 2;
    }
    
    // Semi-public information
    // The most commonly shared construction between parties
    message Image {
        repeated xyz.stratalab.sdk.models.LockId leaves = 1;
        uint32 threshold = 2;
    }

    // todo: jaa - should disable ot figure out how to provide the needed witness in the attestation
    // Public information
    // Predicate Commitments are used to encumber boxes
    // use a Root here so we can provide a membership proof of the conditions
    message Commitment {
        xyz.stratalab.sdk.models.AccumulatorRootId root = 1;
        uint32 threshold = 2;
    }
}

option (scalapb.options) = {
  [scalapb.validate.file] {
    validate_at_construction: true
  }
  field_transformations: [
    {
      when: {options: {[validate.rules] {message: {required: true}}}}
      set: {
        [scalapb.field] {
          required: true
        }
      }
    }
  ]
};




© 2015 - 2024 Weber Informatics LLC | Privacy Policy