Metadata Messages
In this section we describe the processing of the metadata messages and the corresponding updates to the state. All created/modified state objects specified by each message are defined within the state section.
These endpoints, requests, and responses are defined in tx.proto.
Entries
Msg/WriteScope
A scope is created or updated using the WriteScope service method.
Scopes are identified using their scope_id.
Request
The scope_uuid field is optional.
It should be a uuid formated as a string using the standard UUID format.
If supplied, it will be used to generate the appropriate scope id for use in the scope.scope_id field.
The spec_uuid field is optional.
It should be a uuid formated as a string using the standard UUID format.
If supplied, it will be used to generate the appropriate scope specification id for use in the scope.specification_id field.
Response
Expected failures
This service message is expected to fail if:
- The
scope_idis missing or invalid. - The
specification_idis missing or invalid. - The
ownerslist is empty. - Any of the owner
addressvalues aren't bech32 address strings. - Any of the
data_accessvalues aren't bech32 address strings. - A
value_owner_addressis provided that isn't a bech32 address string. - The
signersdo not have permission to write the scope.
Msg/DeleteScope
A scope is deleted using the DeleteScope service method.
Request
Response
Expected failures
This service message is expected to fail if:
- No scope exists with the given
scope_id. - The
signersdo not have permission to delete the scope.
Msg/AddScopeDataAccess
Addresses can be added to a scope's data access list using the AddScopeDataAccess service method.
Request
Response
Expected failures
This service message is expected to fail if:
- Any provided address is invalid.
- Any provided address is already in the scope's data access list.
- The
signersdo not have permission to update the scope.
Msg/DeleteScopeDataAccess
Addresses can be deleted from a scope's data access list using the DeleteScopeDataAccess service method.
Request
Response
Expected failures
This service message is expected to fail if:
- Any provided address is not already in the scope's data access list.
- The
signersdo not have permission to update the scope.
Msg/AddScopeOwner
Scope owners can be added to a scope using the AddScopeOwner service method.
Request
Response
Expected failures
This service message is expected to fail if:
- Any new party is invalid.
- An
optional = trueparty is being added to arequire_party_rollup = falsescope. - The
signersdo not have permission to update the scope.
Msg/DeleteScopeOwner
Scope owners can be deleted from a scope using the DeleteScopeOwner service method.
All owner parties with any of the provided addresses will be removed from the scope.
Request
Response
Expected failures
This service message is expected to fail if:
- Any provided
owners(addresses) are not an address in a party in the scope. - The resulting scope owners do not meet scope specification requirements.
- The
signersdo not have permission to update the scope.
Msg/UpdateValueOwners
The value owner address of one or more scopes can be updated using the UpdateValueOwners service method.
Request
Response
Expected failures
This service message is expected to fail if:
- The new value owner address is invalid.
- Any of the provided scope ids are not metadata scope identifiers or do not exist.
- The signers are not allowed to update the value owner address of a provided scope.
Msg/MigrateValueOwner
All scopes with a given existing value owner address can be updated to have a new proposed value owner address using the MigrateValueOwner endpoint.
Request
Response
Expected failures
This service message is expected to fail if:
- Either the existing or proposed values are not valid bech32 addresses.
- The existing address is not a value owner on any scopes.
- The signers are not allowed to update the value owner address of a scope being updated.
Msg/WriteSession
A session is created or updated using the WriteSession service method.
Sessions are identified using their session_id.
Request
The session_id_components field is optional.
If supplied, it will be used to generate the appropriate session id for use in the session.session_id field.
The spec_uuid field is optional.
It should be a uuid formated as a string using the standard UUID format.
If supplied, it will be used to generate the appropriate contract specification id for use in the session.specification_id field.
Response
Expected failures
This service message is expected to fail if:
- The
session_idis missing or invalid. - The
specification_idis missing or invalid. - The
partieslist is empty. - Any of the
partieshave anaddressthat isn't a bech32 address string. - Any of the
partieshave aroleofunspecified. - The
audit.messagestring is longer than 200 characters. - The
specification_idis being changed. - The session is being updated, but no
nameis provided. - The session's scope cannot be found.
- The session's contract specification does not exist.
- The
signersdo not have permission to write the session. - The
auditfields are changed.
Msg/WriteRecord
A record is created or updated using the WriteRecord service method.
Records are identified using their name and session_id.
Request
The session_id_components field is optional.
If supplied, it will be used to generate the appropriate session id for use in the record.session_id field.
The contract_spec_uuid field is optional.
It should be a uuid formated as a string using the standard UUID format.
If supplied, it will be used with record.name to generate the appropriate record specification id for use in the record.specification_id field.
Response
Expected failures
This service message is expected to fail if:
- The
session_idis missing or invalid. - The
specification_idis provided but invalid. - An entry in
inputsdoes not have aname. - An entry in
inputsdoes not have asource. - An entry in
inputshas asourcetype that doesn't match the input'sstatus. - An entry in
inputshas arecord_idsourcebut therecord_idis missing or invalid. - An entry in
inputsdoes not have atype_name. - An entry in
outputshas astatusofunspecified. - An entry in
outputshas astatusofpassorfail, and doesn't have ahash. - The
nameis missing. - The
process.methodis missing. - The
process.nameis missing. - The
process.process_idis missing. - A record is being updated and the
namevalues are different. - A record is being updated and the
sessionvalues are different. - A record is being updated and the
specification_idvalues are different. - The record's scope cannot be found.
- The record's session cannot be found.
- The record's contract specification cannot be found.
- The record's record specification cannot be found.
- There are duplicate
inputsbyname. - An entry in
inputsexists that is not part of the record specification. - The
inputslist does not contain one or more inputs defined in the record specification. - An entry in
inputshas atype_namedifferent from its input specification. - An entry in
inputshas asourcetype that doesn't match the input specification. - An entry in
inputshas asourcevalue that doesn't match the intput specification. - The record specification has a result type of
recordbut there isn't exactly one entry inoutputs. - The record specification has a result type of
record_listbut theoutputslist is empty. - The
signersdo not have permission to write the record.
Msg/DeleteRecord
A record is deleted using the DeleteRecord service method.
Request
Response
Expected failures
This service message is expected to fail if:
- No record exists with the given
record_id. - The
signersdo not have permission to delete the record.
Specifications
Msg/WriteScopeSpecification
A scope specification is created or updated using the WriteScopeSpecification service method.
Scope specifications are identified using their specification_id.
Request
The spec_uuid field is optional.
It should be a uuid formated as a string using the standard UUID format.
If supplied, it will be used to generate the appropriate scope specification id for use in the specification.specification_id field.
Response
Expected failures
This service message is expected to fail if:
- The
specificatio_idis missing or invalid. - The
descriptionhas an emptynameor thenameis longer than 200 characters. - The
descriptionhas adescriptionlonger than 5000 characters. - The
descriptionhas awebsite_urloricon_urlthat is empty or longer than 2048 characters. - The
descriptionhas awebsite_urloricon_urlthat has a protocol other thanhttp,https, ordata. - The
ownerslist is empty. - One of the entries in
ownersis not a valid bech32 address. - The
parties_involvedlist is empty. - One of the entries in
contract_spec_idsis invalid. - One of the entries in
contract_spec_idsdoes not exist. - One or more
ownersof the existing scope specification are notsigners.
Msg/DeleteScopeSpecification
A scope specification is deleted using the DeleteScopeSpecification service method.
Request
Response
Expected failures
This service message is expected to fail if:
- No scope specification exists with the given
specification_id - One or more
ownersare notsigners.
Msg/WriteContractSpecification
A contract specification is created or updated using the WriteContractSpecification service method.
Contract specifications are identified using their specification_id.
Request
The spec_uuid field is optional.
It should be a uuid formated as a string using the standard UUID format.
If supplied, it will be used to generate the appropriate contract specification id for use in the specification.specification_id field.
Response
Expected failures
This service message is expected to fail if:
- The
specification_idis missing or invalid. - The
descriptionhas an emptynameor thenameis longer than 200 characters. - The
descriptionhas adescriptionlonger than 5000 characters. - The
descriptionhas awebsite_urloricon_urlthat is empty or longer than 2048 characters. - The
descriptionhas awebsite_urloricon_urlthat has a protocol other thanhttp,https, ordata. - The
ownerslist is empty. - One of the entries in
ownersis not a valid bech32 address. - The
parties_involvedlist is empty. - The
sourceis empty. - The
sourceis a resource id, that is invalid. - The
sourceis a hash that is empty. - The
class_nameis empty or longer than 1000 characters. - One or more
ownersof the existing contract specification are notsigners.
Msg/DeleteContractSpecification
A contract specification is deleted using the DeleteContractSpecification service method.
This will also delete all record specifications associated with this contract specification.
Request
Response
Expected failures
This service message is expected to fail if:
- No contract specification exists with the given
specification_id - One or more
ownersare notsigners. - One of the record specifications associated with this contract specification cannot be deleted.
Msg/AddContractSpecToScopeSpec
A contract specification can be added to a scope specification using the AddContractSpecToScopeSpec service method.
Request
Response
Expected failures
This service message is expected to fail if:
- The
contract_specification_idis missing or invalid. - The
scope_specification_idis missing or invalid. - The contract specification does not exist.
- The scope specification does not exist.
-
- The contract specification is already allowed in the provided scope specification.
- One or more of the scope specification
ownersare notsigners.
Msg/DeleteContractSpecFromScopeSpec
A contract specification can be removed from a scope specification using the AddContractSpecToScopeSpec service method.
Request
Response
Expected failures
This service message is expected to fail if:
- The
contract_specification_idis missing or invalid. - The
scope_specification_idis missing or invalid. - The scope specification does not exist.
- The contract specification is not already allowed in the provided scope specification.
- One or more of the scope specification
ownersare notsigners.
Msg/WriteRecordSpecification
A record specification is created or updated using the WriteRecordSpecification service method.
Record specifications are identified using their specification_id.
Request
The contract_spec_uuid field is optional.
It should be a uuid formated as a string using the standard UUID format.
If supplied, it will be used with the specification.name to generate the appropriate record specification id for use in the specification.specification_id field.
Response
Expected failures
This service message is expected to fail if:
- The
specification_idis missing or invalid. - No contract specification exists with the given contract specification id portion of the
specification_id. - One or more contract specification
ownersare notsigners. - The
nameis longer than 200 characters. - One of the
input_specificationsis missing anameor itsnameis longer than 200 characters. - One of the
input_specificationsis missing atype_nameor itstype_nameis longer than 1000 characters. - One of the
input_specificationsis missing asource. - One of the
input_specificationshas asourcethat is a record id that is missing or invalid. - One of the
input_specificationshas asourcethat is a hash that is missing. - The
type_nameis longer than 1000 characters. - The
responsible_partieslist is empty. - The
result_typeis unspecified. - A record specification is being updated and the
namevalues are different. - A record specification is being updated and the
specification_idvalues are different.
Msg/DeleteRecordSpecification
A record specification is deleted using the DeleteRecordSpecification service method.
Request
Response
Expected failures
This service message is expected to fail if:
- No record specification exists with the given
specification_id. - No contract specification exists with the given contract specification id portion of the
specification_id. - One or more
ownersof the contracts specification are notsigners.
Object Store Locators
Msg/BindOSLocator
An Object Store Locator entry is created using the BindOSLocator service method.
Request
Response
Expected failures
This service message is expected to fail if:
- The
owneris missing. - The
owneris not a valid bech32 address. - The
uriis empty. - The
uriis not a valid URI. - The
ownerdoes not match an existing account. - An object store locator already exists for the given
owner.
Msg/DeleteOSLocator
An Object Store Locator entry is deleted using the DeleteOSLocator service method.
Request
Response
Expected failures
This service message is expected to fail if:
- The
owneris missing. - The
owneris not a valid bech32 address. - The
uriis empty. - The
uriis not a valid URI. - The
ownerdoes not match an existing account. - An object store locator does not exist for the given
owner.
Msg/ModifyOSLocator
An Object Store Locator entry is updated using the DeleteOSLocator service method.
Object Store Locators are identified by their owner.
Request
Response
Expected failures
This service message is expected to fail if:
- The
owneris missing. - The
owneris not a valid bech32 address. - The
uriis empty. - The
uriis not a valid URI. - The
ownerdoes not match an existing account. - An object store locator does not exist for the given
owner.
Account Data
Msg/SetAccountData
Simple data (a string) can be associated with scopes using the SetAccountData service method.
This service message is expected to fail if:
- The provided address is not a scope id.
- The provided scope id does not exist.
- The signers do not have authority to update the entry.
- The provided value is too long (as defined by the attribute module params).
Authz Grants
Authz requires the use of fully qualified message type URLs when applying grants to an address. See 04_authz.md for more details.
Fully qualified metadata message type URLs:
/provenance.metadata.v1.MsgWriteScopeRequest/provenance.metadata.v1.MsgDeleteScopeRequest/provenance.metadata.v1.MsgAddScopeDataAccessRequest/provenance.metadata.v1.MsgDeleteScopeDataAccessRequest/provenance.metadata.v1.MsgAddScopeOwnerRequest/provenance.metadata.v1.MsgDeleteScopeOwnerRequest/provenance.metadata.v1.MsgUpdateValueOwnersRequest/provenance.metadata.v1.MsgMigrateValueOwnerRequest/provenance.metadata.v1.MsgWriteSessionRequest/provenance.metadata.v1.MsgWriteRecordRequest/provenance.metadata.v1.MsgDeleteRecordRequest/provenance.metadata.v1.MsgWriteScopeSpecificationRequest/provenance.metadata.v1.MsgDeleteScopeSpecificationRequest/provenance.metadata.v1.MsgWriteContractSpecificationRequest/provenance.metadata.v1.MsgDeleteContractSpecificationRequest/provenance.metadata.v1.MsgAddContractSpecToScopeSpecRequest/provenance.metadata.v1.MsgDeleteContractSpecFromScopeSpecRequest/provenance.metadata.v1.MsgWriteRecordSpecificationRequest/provenance.metadata.v1.MsgDeleteRecordSpecificationRequest/provenance.metadata.v1.MsgBindOSLocatorRequest/provenance.metadata.v1.MsgDeleteOSLocatorRequest/provenance.metadata.v1.MsgModifyOSLocatorRequest/provenance.metadata.v1.MsgSetAccountDataRequest