LogoLogo
DocsHomeSupportContact
  • Getting Started
    • Introduction
    • Build on DIMO
  • DEVELOPER GUIDE
    • Developer Overview
    • Developer Console
    • Authentication
    • DIMO Developer SDKs
      • Data SDK
      • Login with DIMO SDK
        • React Component
        • Login with DIMO Redirect
        • Core Functionalities
      • TypeScript: Transactions SDK
      • SDK Release Notes
    • Low Code Tools
      • n8n: Getting Started
    • Permissions Contract: SACD
    • DIMO Credits
    • Response Types
    • Rate Limits
    • Developer FAQ
    • Developer Changelogs
    • Troubleshooting Common Issues
  • API References
    • Overview of DIMO API
    • Attestation API
    • Device Definitions API
    • Identity API
      • Schema & Types
      • Scalars
      • Nodes & Objects
        • AftermarketDevice
        • AftermarketDeviceConnection
        • DCN
        • DCNConnection
        • DeveloperLicense
        • DeviceDefinition
        • Earning
        • EarningsConnection
        • Manufacturer
        • Sacd
        • SyntheticDevice
        • Vehicle
        • VehicleConnection
        • VehicleEarnings
        • UserRewards
      • Common Queries
    • Telemetry API
      • Schema & Types
      • Scalars
      • Nodes & Objects
        • Signals
        • SignalsLatest
      • Common Queries
    • Token Exchange API
    • Trips API
    • Valuations API
  • DIMO Hardware
    • Introduction
    • DIMO Hardware Application
    • DIMO Manufacturing License
    • Development & Certification
    • Audits & Assessments
      • Hardware & Security Audit
      • Customer Experience Assessment
      • Integration Testing & Quality Control
      • Final Approval
    • DIMO Device License
      • Device Minting Certificates
    • Essential Documents
      • Hardware & Security Audit Checklist
      • Approved Hardware Auditors
      • DIMO Memorandum of Understanding (MOU)
  • Additional References
    • Developer License
    • DIMO GraphQL Basics
  • Deprecated Resources
    • Guides
      • Developer Journey
      • Quick Start Guide
      • Hello World
      • Code Exchange Flow
    • Data Availability
Powered by GitBook
On this page
  • Key Features
  • Set Permissions
  • Check Permissions
  • SACD Terminologies
  • Permissions Table
  • SACD Examples
  • Usage

Was this helpful?

  1. DEVELOPER GUIDE

Permissions Contract: SACD

Handle permissions between your app and the users

Previousn8n: Getting StartedNextDIMO Credits

Last updated 2 months ago

Was this helpful?

DIMO Check-in

We recommend using the SACD contract via , 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 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

Parameters
Type
Description

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.

Permissions Table

Permissions are hex-encoded and when decoded to binary, you will have to read from right to left. Here's a table of common permissions:

Hex
Binary
Privileges Shared

0x3ffc

0011111111111100

1,2,3,4,5,6

0xffc

0000111111111100

1,2,3,4,5

0x3fcc

0011111111001100

1,3,4,5,6

SACD Examples

Usage

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

    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

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

    2. No user-interface

Related: View the privilege definitions .

Example JSON on
{
    "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"
}

(Preferred) Use

(Optional) Use the

Login with DIMO
ERC-721 token (NFT)
https://polygonscan.com/address/0x3c152B5d96769661008Ff404224d6530FCAC766d
https://amoy.polygonscan.com/address/0x4E5F9320b1c7cB3DE5ebDD760aD67375B66cF8a3
here
IPFS
Login with DIMO
Transactions SDK