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

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

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



package org.plasmalabs.sdk.models.box;

import 'validate/validate.proto';

import 'quivr/models/shared.proto';
import 'consensus/models/staking.proto';
import 'sdk/models/identifier.proto';
import 'sdk/models/box/asset.proto';

import 'google/protobuf/duration.proto';
import 'google/protobuf/wrappers.proto';
import "google/protobuf/struct.proto";

// The value contained in a box
message Value {
  oneof value {
    LVL lvl = 1;
    TOPL topl = 2;
    Asset asset = 3;
    Group group = 4;
    Series series = 5;
    UpdateProposal updateProposal = 6;
    ConfigProposal configProposal = 7;
  }
  // A payment token
  message LVL {
    quivr.models.Int128 quantity = 1 [(validate.rules).message.required = true];
  }
  // A staking token
  message TOPL {
    quivr.models.Int128 quantity = 1 [(validate.rules).message.required = true];
    // Optional.  If provided, the registration will take effect at the start of 2 epochs from now. If not provided, this token will not be used for staking purposes.
    org.plasmalabs.consensus.models.StakingRegistration registration = 3;

  }
  // A user-defined token
  message Asset {
    // The group identifier of the group token that was used to mint this asset. When there is a groupAlloy this field is not used.
    GroupId groupId = 1;
    // The series identifier of the series token that was used to mint this asset. When there is a seriesAlloy this field is not used.
    SeriesId seriesId = 2;
    // A quantity
    quivr.models.Int128 quantity = 3 [(validate.rules).message.required = true];
    // This field is optional and represents a Merkle root of the alloy of groups in this asset. This is only valid for tokens that are series fungible.
    // length = 32
    google.protobuf.BytesValue groupAlloy = 4 [(validate.rules).bytes.len = 32];
    // This field is optional and represents a Merkle root of the alloy of series in this asset. This is only valid for tokens that are group fungible.
    // length = 32
    google.protobuf.BytesValue seriesAlloy = 5 [(validate.rules).bytes.len = 32];
    // Describes the fungibility of the asset..
    sdk.models.box.FungibilityType fungibility = 6;
    // Describes the quantity behavior of this asset.
    sdk.models.box.QuantityDescriptorType quantityDescriptor = 7;
    // This is the ephemeral metadata of an asset. It follows the schema defined in the ephemeral metadata schema of the series policy corresponding to the token being minted.
    // The conformance of this field to the schema is not checked by the node. This field is managed by the user.
    google.protobuf.Struct ephemeralMetadata = 8;
    // This field is optional and meant to store a commitment in the form of a hash. This field is managed by the user.
    // Metadata concerning this field can be added to the metadata.
    google.protobuf.BytesValue commitment = 9 [(validate.rules).bytes.len = 32];
  }

  // A group constructor token
  message Group {
    // The ID of _this_ Group. It is the digest of the Group Policy.
    GroupId groupId = 1 [(validate.rules).message.required = true];
    // The quantity of group constructor tokens stored in a given UTXO.
    quivr.models.Int128 quantity = 2 [(validate.rules).message.required = true];
    // An optional series identifier. When this series identifier is defined, this groups that implement this policy can only be used to mint assets with the aforementioned series identifier
    SeriesId fixedSeries = 3;
  }

  // A series constructor token
  message Series {
    // The ID of _this_ Series. It is the digest of the Series Policy.
    SeriesId seriesId = 1 [(validate.rules).message.required = true];
    // The quantity of series constructor tokens stored in a given UTXO.
    quivr.models.Int128 quantity = 2 [(validate.rules).message.required = true];
    // This is an optional field. When provided it fixes the quantity of tokens that will be minted when this series is consumed,
    // and the series constructor is burned by the minting transaction.
    // When not provided, the series constructor is not burned, thus making the token supply unlimited.
    google.protobuf.UInt32Value tokenSupply = 3;
    // Describes the behavior of the quantity field of the assets minted using the series constructor derived from this policy.
    QuantityDescriptorType quantityDescriptor = 4;
    //Describes the fungibility of the assets minted using the series constructor token derived from this policy.
    FungibilityType fungibility = 5;
  }

  message UpdateProposal {
    // Update proposal label for humans (do not confuse with the actual update proposal identifier)
    string label = 1;
    // fEffective
    quivr.models.Ratio fEffective = 2;
    // vrfLddCutoff
    // Verifiable Random Function: mechanism for leader election in Ouroboros proof-of-stake
    // Local dynamic difficulty, Short timescale variation of the block production eligibility threshold.
    google.protobuf.UInt32Value vrfLddCutoff = 3;
    // vrfPrecision
    google.protobuf.UInt32Value vrfPrecision = 4;
    // vrfBaselineDifficulty
    quivr.models.Ratio vrfBaselineDifficulty = 5;
    // vrfAmplitude
    quivr.models.Ratio vrfAmplitude = 6;
    // chainSelectionKLookback
    google.protobuf.UInt64Value chainSelectionKLookback = 7;
    // slotDuration, Slot: Atomic time unit in Ouroboros, smallest piece of time (~1 second for Topl, 2 for Cardano)
    google.protobuf.Duration slotDuration = 8;
    // forwardBiasedSlotWindow
    google.protobuf.UInt64Value forwardBiasedSlotWindow = 9;
    // operationalPeriodsPerEpoch, Epoch: Long time scale in Ouroboros, epochs are composed of many slots
    google.protobuf.UInt64Value operationalPeriodsPerEpoch = 10;
    // kesKeyHours Key-Evolving Signature: mechanism for securing chain selection process in Ouroboros proof-of-stake
    google.protobuf.UInt32Value kesKeyHours = 11;
    // kesKeyMinutes Key-Evolving Signature: mechanism for securing chain selection process in Ouroboros proof-of-stake
    google.protobuf.UInt32Value kesKeyMinutes = 12;
    // gap of non-eligibility after a block is minted
    google.protobuf.UInt64Value slotGapLeaderElection = 13;
  }
  
  message ConfigProposal {
     map value = 1;
  }
}

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