Permissions Contract: SACD

Handle permissions between your app and the users

DIMO Check-in

We recommend using the SACD contract via Login with DIMO, which provides you with the most convenient path to building your application and having vehicle owners share permissions with your app.

Service Access Contract Definition (SACD), is a permission management solution for any ERC-721 token (NFT) on the DIMO Network. Designed to manage permissions for the Vehicle NFT, the contract is versatile to support other NFT assets. Permissions set will be attached to the asset, and will override any existing permissions for the same grantee.

Key Features

Set Permissions

The setPermissions function creates a new set of permissions for a specific asset.

Check Permissions

The hasPermissions function checks if a grantee has permissions for a specific asset.

SACD Terminologies

ParametersTypeDescription

asset

address

The 0x address of the asset. In the DIMO-connected vehicle case, the vehicle would be the asset.

tokenId

uint256

The tokenId of the targeted asset. In the DIMO-connected vehicle case, this would be the vehicle tokenId.

grantee

address

The 0x address of the grantee, a grantee is the party receiving the granted permissions to the asset.

permissions

uint256

The bit array that represents the permissions.

expiration

uint256

Unix timestamp of the expiration to the assigned permissions.

source

string

The URI source associated with the permissions.

SACD Examples

Example JSON on IPFS
{
    "specVersion": "1.0",
    "id": "f2b5a9ae-b4ba-474c-bd8b-18477b154185",
    "type": "org.dimo.permission.grant.v1",
    "datacontentype": "application/json",
    "time": "2024-11-15T22:42:03.335Z",
    "data": {
        "templateId": "f2b5a9ae-b4ba-474c-bd8b-18477b154185",
        "version": "1.0",
        "grantor": "0x0EF5d70312e535d2d23494b6b5D3f57d7024A896",
        "grantee": "0x20267f71121f1827680B7796746da135bFcf612D",
        "scope": {
            "permissions": [
                "ALLTIME_LOCATION: access to the vehicle full location history.",
                "NONLOCATION_TELEMETRY: non-location vehicle data such as fuel levels and odometer.",
                "COMMANDS: ability to send commands to the vehicle such as lock and unlock.",
                "CURRENT_LOCATION: access to the vehicle current location.",
                "CREDENTIALS: access to any stored credentials and attestations such as insurance and service records."
            ]
        },
        "effectiveAt": "2024-11-15T22:42:03.335Z",
        "expiresAt": "2062-12-12T05:00:00.000Z",
        "attachments": [],
        "description": "By proceeding, you will grant data access and control functions to dimo-driver effective as of 1731710523335 until Tue Feb 03 1970 22:45:25 GMT+0000 (Coordinated Universal Time). Permissions being granted: ALLTIME_LOCATION: access to the vehicle full location history.; NONLOCATION_TELEMETRY: non-location vehicle data such as fuel levels and odometer.; COMMANDS: ability to send commands to the vehicle such as lock and unlock.; CURRENT_LOCATION: access to the vehicle current location.; CREDENTIALS: access to any stored credentials and attestations such as insurance and service records.Driver ID: 0x0EF5d70312e535d2d23494b6b5D3f57d7024A896 App ID: 0x20267f71121f1827680B7796746da135bFcf612DDIMO Platform, version 1.0."
    },
    "com.dimo.grantor.signature": "0x01845ADb2C711129d4f3966735eD98a9F09fC4cE57b7c15fd40641dd0d5f7a5a406c138c3da9e749c8f03ae9be8d449ef0895a8f8960cae22a8f2b0af05aa4e3b419f4a0e50bdb1ecd58669384930340a22da38d541c"
}

Usage

To utilize SACD and get permissions to DIMO-connected vehicles from end users, you can take one of the following approaches:

  1. (Preferred) Use Login with DIMO

    1. Uses Transactions SDK under the hood, offers developers a plug-and-play experience

    2. Provides a user-interface to handle permission sharing for end-users

    3. Configurations are being managed by login.dimo.org

  2. (Optional) Use the Transactions SDK

    1. Self-managed configurations giving developers a lot more flexibilities

    2. No user-interface

Last updated