{"id":19967590,"url":"https://github.com/ceramicstudio/safe-did-resolver","last_synced_at":"2025-06-26T09:09:03.490Z","repository":{"id":38662079,"uuid":"414192964","full_name":"ceramicstudio/safe-did-resolver","owner":"ceramicstudio","description":"Resolver for Gnosis Safe as DID","archived":false,"fork":false,"pushed_at":"2023-03-13T21:54:28.000Z","size":6050,"stargazers_count":3,"open_issues_count":6,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-25T20:18:49.056Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ceramicstudio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-06T11:57:51.000Z","updated_at":"2022-08-23T19:25:32.000Z","dependencies_parsed_at":"2024-06-19T01:37:29.780Z","dependency_job_id":"399d409e-c596-4ace-94ea-0549d0e97c80","html_url":"https://github.com/ceramicstudio/safe-did-resolver","commit_stats":{"total_commits":64,"total_committers":8,"mean_commits":8.0,"dds":0.46875,"last_synced_commit":"4e13027333b271f0895b902830a15704ec8436c2"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/ceramicstudio/safe-did-resolver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceramicstudio%2Fsafe-did-resolver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceramicstudio%2Fsafe-did-resolver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceramicstudio%2Fsafe-did-resolver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceramicstudio%2Fsafe-did-resolver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ceramicstudio","download_url":"https://codeload.github.com/ceramicstudio/safe-did-resolver/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceramicstudio%2Fsafe-did-resolver/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262027103,"owners_count":23246966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T02:42:47.558Z","updated_at":"2025-06-26T09:09:03.444Z","avatar_url":"https://github.com/ceramicstudio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gnosis Safe DID Resolver\n\n\u003e Safe is a DID method that uses the Ceramic network to resolve DID documents for Gnosis Safe\n\u003e See [CIP-101](https://github.com/ceramicnetwork/CIP/blob/main/CIPs/CIP-101/CIP-101.md)\n\n## Getting started\n\nThis implementation is still a prototype. Contributions are welcome!\n\n### Installation\n\n```bash\n$ npm install safe-did-resolver\n```\n\n### Usage\n\n```typescript\nimport SafeResolver from 'safe-did-resolver'\nimport { Resolver } from 'did-resolver'\nimport Ceramic from '@ceramicnetwork/http-client'\n\nconst ceramic = new Ceramic() // connects to localhost:7007 by default\n\nconst config: NftResolverConfig = {\n  ceramic,\n  chains: {\n    // Ethereum Mainnet\n    'eip155:1': {\n      blocks: 'https://api.thegraph.com/subgraphs/name/blocklytics/ethereum-blocks',\n      skew: 15000,\n      gnosisSafe: 'https://api.thegraph.com/subgraphs/name/gjeanmart/gnosis-safe-mainnet',\n    },\n    // Ethereum Ropsten\n    'eip155:3': {\n      blocks: 'https://api.thegraph.com/subgraphs/name/yyong1010/ethereumblocks',\n      skew: 15000,\n      gnosisSafe: 'https://api.thegraph.com/subgraphs/name/gjeanmart/gnosis-safe-ropsten',\n    },\n    // Ethereum Rinkeby\n    'eip155:4': {\n      blocks: 'https://api.thegraph.com/subgraphs/name/billjhlee/rinkeby-blocks',\n      skew: 15000,\n      gnosisSafe: 'https://api.thegraph.com/subgraphs/name/radicle-dev/gnosis-safe-rinkeby',\n    },\n  },\n}\n\n// getResolver will return an object with a key/value pair of { 'safe': resolver }\n// where resolver is a function used by the generic did resolver.\nconst safeResolver = SafeResolver.getResolver(config)\nconst didResolver = Resolver(safeResolver)\n\nconst safeResult = await didSafeResolver.resolve(\n  'did:safe:eip155:1:0x00044c87ddc54536ee05047c6f4f6f831aba988b'\n)\nconsole.log(safeResult)\n```\n\nThe resolver supports the following networks by default:\n\n- Ethereum mainnet (`eip155:1`),\n- Ethereum Rinkeby (`eip155:4`),\n\n## Testing\n\n```bash\n$ npm test\n```\n\n## DID Specs\n\nThe token DIDs are prefixed with `did:safe:`, followed by method specific identifier, which is simply\na [CAIP-10 Account ID](https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-10.md).\n\nDID: `did:safe:{chainId}:{safeAddress}`\n\nCAIP-10: `{chainId}:{safeAddress}`\n\n### Conversions\n\n**DID-\u003eCAIP**\n\n```typescript\nconst caip = did.substr(8).replace(/_/g, '/')\n```\n\n**CAIP-\u003eDID**\n\n```typescript\nconst did = `did:safe:${caip.replace(/\\//g, '_')\n```\n\nThere are helpers that help you with the conversion:\n\n```typescript\nimport { caipToDid, didToCaip, createSafeDidUrl } from 'safe-did-resolver'\nimport { AccountId } from 'caip'\n\n// CAIP -\u003e DID URL\nconst didUrl = createSafeDidUrl({\n  chainId: 'eip155:1',\n  address: '0x1234567891234567891234567891234596351156',\n})\n// If you use `caip` library in your app, consider using sister `caipToDid` function to\n// convert `AccountId` to Safe DID URL.\n\n// DID URL -\u003e CAIP\nconst accountId = didToCaip(didUrl) // eip155:1/erc721:0x1234567891234567891234567891234596351156/1\n```\n\n## License\n\nApache-2.0 OR MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceramicstudio%2Fsafe-did-resolver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fceramicstudio%2Fsafe-did-resolver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceramicstudio%2Fsafe-did-resolver/lists"}