pub struct ResponseItem {
pub identifier: String,
pub issuer_schema_id: u64,
pub proof: ZeroKnowledgeProof,
pub nullifier: Option<FieldElement>,
pub session_nullifier: Option<SessionNullifier>,
pub expires_at_min: u64,
}Expand description
Per-credential response item returned by the Authenticator.
Each entry corresponds to one requested credential with its proof material.
If any credential cannot be satisfied, the entire proof response will have
an error at the ProofResponse level with an empty responses array.
§Nullifier Types
-
Uniqueness proofs: Use
nullifierfield (a singleFieldElement). The contract’sverify()function takes this as a separateuint256 nullifierparam. -
Session proofs: Use
session_nullifierfield (contains both nullifier and action). The contract’sverifySession()function expectsuint256[2] sessionNullifier.
Exactly one of nullifier or session_nullifier should be present.
Fields§
§identifier: StringAn RP-defined identifier for this request item used to match against constraints and responses.
Example: orb, document.
issuer_schema_id: u64Unique identifier for the credential schema and issuer pair.
proof: ZeroKnowledgeProofEncoded World ID Proof. See ZeroKnowledgeProof for more details.
nullifier: Option<FieldElement>Nullifier for Uniqueness proofs.
A unique, one-time identifier derived from (user, rpId, action) that lets RPs detect
duplicate actions without learning who the user is. Used with the contract’s verify() function.
Present for Uniqueness proofs, absent for Session proofs.
session_nullifier: Option<SessionNullifier>Session nullifier for Session proofs.
Contains both the nullifier and action values that are cryptographically bound together.
Used with the contract’s verifySession() function which expects uint256[2] sessionNullifier.
Present for Session proofs, absent for Uniqueness proofs.
expires_at_min: u64The minimum expiration required for the Credential used in the proof.
This precise value must be used when verifying the proof on-chain.
Implementations§
Source§impl ResponseItem
impl ResponseItem
Sourcepub const fn new_uniqueness(
identifier: String,
issuer_schema_id: u64,
proof: ZeroKnowledgeProof,
nullifier: FieldElement,
expires_at_min: u64,
) -> Self
pub const fn new_uniqueness( identifier: String, issuer_schema_id: u64, proof: ZeroKnowledgeProof, nullifier: FieldElement, expires_at_min: u64, ) -> Self
Create a new response item for a Uniqueness proof.
Sourcepub const fn new_session(
identifier: String,
issuer_schema_id: u64,
proof: ZeroKnowledgeProof,
session_nullifier: SessionNullifier,
expires_at_min: u64,
) -> Self
pub const fn new_session( identifier: String, issuer_schema_id: u64, proof: ZeroKnowledgeProof, session_nullifier: SessionNullifier, expires_at_min: u64, ) -> Self
Create a new response item for a Session proof.
Sourcepub const fn is_session(&self) -> bool
pub const fn is_session(&self) -> bool
Returns true if this is a Session proof response.
Sourcepub const fn is_uniqueness(&self) -> bool
pub const fn is_uniqueness(&self) -> bool
Returns true if this is a Uniqueness proof response.
Trait Implementations§
Source§impl Clone for ResponseItem
impl Clone for ResponseItem
Source§fn clone(&self) -> ResponseItem
fn clone(&self) -> ResponseItem
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResponseItem
impl Debug for ResponseItem
Source§impl<'de> Deserialize<'de> for ResponseItem
impl<'de> Deserialize<'de> for ResponseItem
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ResponseItem
impl RefUnwindSafe for ResponseItem
impl Send for ResponseItem
impl Sync for ResponseItem
impl Unpin for ResponseItem
impl UnsafeUnpin for ResponseItem
impl UnwindSafe for ResponseItem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more