Assign & Query Attributes
Manage verifiable labels and attestations tied to addresses for policy enforcement and access control.
Query Attributes
Get Specific Attribute
Check for a specific attribute on an address:
curl -H "Authorization: Bearer $PROV_API_TOKEN" \
"https://api.provlabs.com/provenance/attribute/v1/attribute/pb1ADDRESS.../pio.kyc.verified"
List All Attributes
Get all attributes for an address:
curl -H "Authorization: Bearer $PROV_API_TOKEN" \
"https://api.provlabs.com/provenance/attribute/v1/attribute/pb1ADDRESS..."
Find Accounts by Attribute
Get all accounts that have a specific attribute:
curl -H "Authorization: Bearer $PROV_API_TOKEN" \
"https://api.provlabs.com/provenance/attribute/v1/accounts/pio.kyc.verified"
Scan by Suffix
Find attributes matching a suffix pattern:
curl -H "Authorization: Bearer $PROV_API_TOKEN" \
"https://api.provlabs.com/provenance/attribute/v1/attribute/pb1ADDRESS.../scan/kyc"
Assign Attributes
Add Attribute (Transaction)
Build and broadcast an attribute addition transaction:
- Build Tx in Vault: Use MsgAddAttribute
- Sign locally with your key
- Broadcast via Node RPC
- Verify with read endpoints
Example transaction structure:
{
"messages": [
{
"@type": "/provenance.attribute.v1.MsgAddAttribute",
"name": "pio.kyc.verified",
"value": "true",
"attribute_type": "ATTRIBUTE_TYPE_STRING",
"account": "pb1ADDRESS...",
"owner": "pb1ADDRESS..."
}
]
}
Remove Attribute (Transaction)
Build and broadcast an attribute removal transaction:
- Build Tx in Vault: Use MsgDeleteAttribute
- Sign locally with your key
- Broadcast via Node RPC
- Verify with read endpoints
Example transaction structure:
{
"messages": [
{
"@type": "/provenance.attribute.v1.MsgDeleteAttribute",
"name": "pio.kyc.verified",
"account": "pb1ADDRESS...",
"owner": "pb1ADDRESS..."
}
]
}
Verify Changes
After adding or removing attributes, verify the changes:
Check Specific Attribute
curl -H "Authorization: Bearer $PROV_API_TOKEN" \
"$PROV_REST_BASE/provenance/attribute/v1/attribute/pb1ADDRESS.../pio.kyc.verified"
List All Attributes
curl -H "Authorization: Bearer $PROV_API_TOKEN" \
"$PROV_REST_BASE/provenance/attribute/v1/attribute/pb1ADDRESS..."
Check Allow-list
curl -H "Authorization: Bearer $PROV_API_TOKEN" \
"$PROV_REST_BASE/provenance/attribute/v1/accounts/pio.kyc.verified"
Common Use Cases
KYC Verification
# Check if user has KYC
curl -H "Authorization: Bearer $PROV_API_TOKEN" \
"https://api.provlabs.com/provenance/attribute/v1/attribute/pb1ADDRESS.../pio.kyc.verified"
# Add KYC attribute
# (Build transaction in Vault, sign, broadcast)
Compliance Tracking
# Check compliance status
curl -H "Authorization: Bearer $PROV_API_TOKEN" \
"https://api.provlabs.com/provenance/attribute/v1/attribute/pb1ADDRESS.../scan/compliance"
# Find all compliant users
curl -H "Authorization: Bearer $PROV_API_TOKEN" \
"https://api.provlabs.com/provenance/attribute/v1/accounts/pio.compliance.verified"
Access Control
# Check if user has admin privileges
curl -H "Authorization: Bearer $PROV_API_TOKEN" \
"https://api.provlabs.com/provenance/attribute/v1/attribute/pb1ADDRESS.../pio.admin.verified"
# Find all admin users
curl -H "Authorization: Bearer $PROV_API_TOKEN" \
"https://api.provlabs.com/provenance/attribute/v1/accounts/pio.admin.verified"
Error Handling
Attribute Not Found
Error: not_found - Attribute not found
Response:
{
"code": "not_found",
"message": "Attribute not found."
}
Fix: Verify attribute name is correct and exists on the address
Invalid Suffix
Error: invalid_argument - Invalid suffix
Response:
{
"code": "invalid_argument",
"message": "Invalid suffix format."
}
Fix: Use valid suffix pattern (e.g., "kyc", "admin")
No Attributes Found
Error: not_found - No attributes found matching suffix
Response:
{
"code": "not_found",
"message": "No attributes found matching the specified suffix."
}
Fix: Check if address has any attributes with the specified suffix
Best Practices
Attribute Naming
- Use consistent naming conventions (e.g.,
pio.kyc.verified) - Include organization prefix to avoid conflicts
- Use descriptive suffixes for different attribute types
Verification Patterns
- Always verify attribute changes after transactions
- Use specific attribute checks for access control
- Use suffix scans for discovery and audit purposes
Error Handling
- Validate attribute names before making requests
- Handle
not_foundresponses gracefully - Provide clear error messages to users