> For the complete documentation index, see [llms.txt](https://docs.talus.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.talus.network/reference/move/nexus_primitives/proof_of_uid.md).

# proof\_of\_uid

* [Struct `ProofOfUID`](#struct-proofofuid)
* [Struct `UIDRequirements`](#struct-uidrequirements)
* [Constants](#constants)
* [Function `new`](#function-new)
* [Function `new_with_type`](#function-new_with_type)
* [Function `consume`](#function-consume)
* [Function `stamp_with_data`](#function-stamp_with_data)
* [Function `stamp`](#function-stamp)
* [Function `unstamp`](#function-unstamp)
* [Function `stamps`](#function-stamps)
* [Function `stamps_len`](#function-stamps_len)
* [Function `has_stamp`](#function-has_stamp)
* [Function `has_stamp_with_data`](#function-has_stamp_with_data)
* [Function `read_stamp_data_of_id`](#function-read_stamp_data_of_id)
* [Function `created_from`](#function-created_from)
* [Function `type_name`](#function-type_name)
* [Function `into_requirements`](#function-into_requirements)
* [Function `satisfy`](#function-satisfy)
* [Function `proof`](#function-proof)
* [Function `complete`](#function-complete)

### Struct `ProofOfUID`

Hot potato that can collect stamps.

If \[ProofOfUID] contains an \[ID] stamp it means that the corresponding \[UID] has been referenced in \[stamp] method.

```move
public struct ProofOfUID
```

<details>

<summary>Fields</summary>

`from_uid: sui::object::ID`Only the \[UID] that created this proof in \[new] can consume it or convert it through \[into\_requirements].`from_type: std::option::Option<std::type_name::TypeName>`Optionally, the creator of the proof can also prove the type of the \[UID]. Some nexus components may require this information to be present.[`stamps`](#nexus_primitives_proof_of_uid_stamps)`: sui::vec_map::VecMap<sui::object::ID, vector<u8>>`Stampers can attach arbitrary data to their stamp.

</details>

#### Struct `UIDRequirements`

A \[ProofOfUID] that can be completed after every required \[UID] participates.

Requirements are removed only by presenting the matching \[UID]. Once no requirements remain, any caller can \[complete] the value. The wrapped proof stays available for read only authorization checks during this process.

```move
public struct UIDRequirements
```

<details>

<summary>Fields</summary>

[`proof`](#nexus_primitives_proof_of_uid_proof)`:` [`nexus_primitives::proof_of_uid::ProofOfUID`](#nexus_primitives_proof_of_uid_ProofOfUID)`remaining: sui::vec_set::VecSet<sui::object::ID>`

</details>

#### Constants

```move
#[error]
const EProofCreatorMismatch: vector<u8> = b"Proof creator does not match the provided UID";
```

```move
#[error]
const ERequirementsRemaining: vector<u8> = b"UID requirements remain unsatisfied";
```

#### Function `new`

Creates an empty proof bound to the given UID.

```move
public fun new(uid: &sui::object::UID): nexus_primitives::proof_of_uid::ProofOfUID
```

#### Function `new_with_type`

Creates an empty proof bound to the given UID and recording the object's type. Aborts if the UID does not match the object's ID.

```move
public fun new_with_type<T: key>(uid: &sui::object::UID, o: &T): nexus_primitives::proof_of_uid::ProofOfUID
```

#### Function `consume`

Consumes the proof and returns its stamps. Aborts unless the given UID is the one that created the proof.

```move
public fun consume(self: nexus_primitives::proof_of_uid::ProofOfUID, uid: &sui::object::UID): sui::vec_map::VecMap<sui::object::ID, vector<u8>>
```

#### Function `stamp_with_data`

Add a stamp to the proof with some data.

```move
public fun stamp_with_data(self: &mut nexus_primitives::proof_of_uid::ProofOfUID, uid: &sui::object::UID, data: vector<u8>)
```

#### Function `stamp`

Add a stamp to the proof.

```move
public fun stamp(self: &mut nexus_primitives::proof_of_uid::ProofOfUID, uid: &sui::object::UID)
```

#### Function `unstamp`

Removes the stamp for the given UID. Aborts if no such stamp exists.

```move
public fun unstamp(self: &mut nexus_primitives::proof_of_uid::ProofOfUID, uid: &sui::object::UID)
```

#### Function `stamps`

Borrows the map of stamps keyed by stamper ID.

```move
public fun stamps(self: &nexus_primitives::proof_of_uid::ProofOfUID): &sui::vec_map::VecMap<sui::object::ID, vector<u8>>
```

#### Function `stamps_len`

The number of stamps on the proof.

```move
public fun stamps_len(self: &nexus_primitives::proof_of_uid::ProofOfUID): u64
```

#### Function `has_stamp`

Whether the proof carries a stamp for the given ID.

```move
public fun has_stamp(self: &nexus_primitives::proof_of_uid::ProofOfUID, of_uid: sui::object::ID): bool
```

#### Function `has_stamp_with_data`

Whether the proof carries a stamp for the given ID with exactly the given data.

```move
public fun has_stamp_with_data(self: &nexus_primitives::proof_of_uid::ProofOfUID, of_uid: sui::object::ID, data: &vector<u8>): bool
```

#### Function `read_stamp_data_of_id`

Returns the data attached to the given ID's stamp, or none if absent.

```move
public fun read_stamp_data_of_id(self: &nexus_primitives::proof_of_uid::ProofOfUID, of_uid: sui::object::ID): std::option::Option<vector<u8>>
```

#### Function `created_from`

The ID of the UID that created the proof.

```move
public fun created_from(self: &nexus_primitives::proof_of_uid::ProofOfUID): sui::object::ID
```

#### Function `type_name`

The recorded type of the creating object, if it was provided at construction.

```move
public fun type_name(self: &nexus_primitives::proof_of_uid::ProofOfUID): std::option::Option<std::type_name::TypeName>
```

#### Function `into_requirements`

Converts this proof into requirements authorized by its creating \[UID].

Each ID in `remaining` must later be removed through \[satisfy]. The conversion is one way and the proof can only be recovered through \[complete].

```move
public fun into_requirements(self: nexus_primitives::proof_of_uid::ProofOfUID, uid: &sui::object::UID, remaining: sui::vec_set::VecSet<sui::object::ID>): nexus_primitives::proof_of_uid::UIDRequirements
```

#### Function `satisfy`

Removes the requirement for the given \[UID].

Records an empty stamp when the UID is required. Does nothing if the UID is not required or has already participated.

```move
public fun satisfy(self: &mut nexus_primitives::proof_of_uid::UIDRequirements, uid: &sui::object::UID)
```

#### Function `proof`

Borrows the wrapped \[ProofOfUID] for authorization checks.

```move
public fun proof(self: &nexus_primitives::proof_of_uid::UIDRequirements): &nexus_primitives::proof_of_uid::ProofOfUID
```

#### Function `complete`

Completes the requirements and returns the stamps collected before conversion.

Aborts while any required \[UID] has not participated.

```move
public fun complete(self: nexus_primitives::proof_of_uid::UIDRequirements): sui::vec_map::VecMap<sui::object::ID, vector<u8>>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.talus.network/reference/move/nexus_primitives/proof_of_uid.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
