Skip to main content

Validate Properties

Validate Properties

This guide demonstrates how to validate Properties against accreditations in a hierarchy using the offchain API.

Prerequisites

  • An existing hierarchy on the IOTA network
  • A funded client with write access
  • Accreditations to validate against

Overview

Property validation verifies that a receiver has the necessary accreditations within a Federation to make specific attestation.

1. Set Up Client

Initialize a funded client to interact with the hierarchy:

hierarchies-rs/examples/validation/02_validate_properties.rs
loading...

2. Create Federation

Create a new Federation to contain your Properties:

hierarchies-rs/examples/validation/02_validate_properties.rs
loading...

3. Add Property to Federation

Add a Property with allowed values to the Federation:

hierarchies-rs/examples/validation/02_validate_properties.rs
loading...

4. Create Accreditation to Attest

Issue accreditation for a receiver to attest to the property:

hierarchies-rs/examples/validation/02_validate_properties.rs
loading...

5. Validate Properties

Validate that the receiver has the necessary accreditations for the properties:

hierarchies-rs/examples/validation/02_validate_properties.rs
loading...

Key Points

  • Validation Process: The validation checks if a receiver has the necessary accreditations to make specific properties
  • Properties Matching: The properties name and value must match exactly with the accreditation
  • Error Handling: Validation will fail if the receiver lacks the necessary accreditations

Full Example Code

hierarchies-rs/examples/validation/02_validate_properties.rs
loading...