diff --git a/.changeset/nasty-elephants-juggle.md b/.changeset/nasty-elephants-juggle.md new file mode 100644 index 000000000..a845151cc --- /dev/null +++ b/.changeset/nasty-elephants-juggle.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.github/ISSUE_TEMPLATE/request_identifier.yaml b/.github/ISSUE_TEMPLATE/request_identifier.yaml index 43dd71d9c..f076219c1 100644 --- a/.github/ISSUE_TEMPLATE/request_identifier.yaml +++ b/.github/ISSUE_TEMPLATE/request_identifier.yaml @@ -19,4 +19,4 @@ body: - type: markdown attributes: value: | - In order to add support for the requested identifier, you can add support for the identifier [here](https://github.com/celo-org/celo-monorepo/blob/3c026a6a5d09e3ee5e2518547deba0fe77b40d53/packages/sdk/base/src/identifier.ts#L31) and open a PR. + In order to add support for the requested identifier, you can add support for the identifier [here](https://github.com/celo-org/social-connect/tree/main/packages/odis-identifiers/src/identifier.ts) and open a PR. diff --git a/README.md b/README.md index 9d4730b76..6a46d616d 100644 --- a/README.md +++ b/README.md @@ -152,9 +152,9 @@ The following steps use the Celo [ContractKit](https://docs.celo.org/developer/c | Type | | :-------------------------------------------------------------------------------------------: | -| [ContractKit](examples/contractKit.ts) | -| [EthersJS (v5)](examples/ethers.ts) | -| [web3.js](examples/web3.ts) | +| [ContractKit](docs/examples/contractKit.ts) | +| [EthersJS (v5)](docs/examples/ethers.ts) | +| [web3.js](docs/examples/web3.ts) | | [NextJS based web app (Phone Number)](https://github.com/celo-org/emisianto) | | [NextJS based templated](https://github.com/celo-org/socialconnect-template) | | [React Native App (Phone Number)](https://github.com/celo-org/SocialConnect-ReactNative-Demo) | @@ -219,7 +219,7 @@ This where `prefix` comes into play, the `plainTextIdentifier alicecodes` can be Moreover, it also helps in composability if dApps follow a standard and use prefix then the corresponding `obsfuscatedIdentifier` will be the same thus making it easier for dApps to lookup identifier verified by other issuers. -You can keep an eye on prefixes suggested by us [here](https://github.com/celo-org/celo-monorepo/blob/8505d060fef3db3b0ce0cadf2bb879512bb20534/packages/sdk/base/src/identifier.ts#L31). +You can keep an eye on prefixes suggested by us [here](https://github.com/celo-org/social-connect/tree/main/packages/odis-identifiers/src/identifier.ts#L25). diff --git a/docs/privacy.md b/docs/privacy.md index 3d7d920d5..d4aea461d 100644 --- a/docs/privacy.md +++ b/docs/privacy.md @@ -45,7 +45,7 @@ Here is a concrete example: Each identifier type has a corresponding prefix that is appended before the blinding and hashing. This prevents identifiers from different sources from having the same pepper (ie. if you have the same handle for twitter and instagram, the obfuscated identifier should be different for each). -These are the prefixes currently defined in the SDK. We are using [DID methods](https://w3c.github.io/did-spec-registries/#did-methods) as prefixes when they exist. We welcome PRs here and [in the SDK](https://github.com/celo-org/celo-monorepo/blob/master/packages/identity/src/odis/identifier.ts#L27-L34) if you'd like to add a new identifier type and prefix! You can also cast an arbitrary string as your prefix if you would like. +These are the prefixes currently defined in the SDK. We are using [DID methods](https://w3c.github.io/did-spec-registries/#did-methods) as prefixes when they exist. We welcome PRs here and [in the SDK](https://github.com/celo-org/social-connect/tree/main/packages/odis-identifiers/src/identifier.ts) if you'd like to add a new identifier type and prefix! You can also cast an arbitrary string as your prefix if you would like. | Type | Prefix | |---------|--------| @@ -169,13 +169,13 @@ await OdisUtils.Identifier.getObfuscatedIdentifier( // unblindedSignature: '9as8duf98as...df80u' // } ``` -*Source code for `getObfuscatedIdentifier` and other relevant functions [here](https://github.com/celo-org/celo-monorepo/blob/master/packages/identity/src/odis/identifier.ts)* +*Source code for `getObfuscatedIdentifier` and other relevant functions [here](https://github.com/celo-org/social-connect/tree/main/packages/identity/src/odis/identifier.ts)* ------------- ### Rate Limit -ODIS implements rate limiting on queries to prevent brute force attackers. Every account interacting with ODIS has a quota for the number of queries it can make. +ODIS implements rate limiting on queries to prevent brute force attackers. Every account interacting with ODIS has a quota for the number of queries it can make and each query decreases the quota by 1. You can check how much quota is left on your account: @@ -187,7 +187,7 @@ const { remainingQuota } = await OdisUtils.Quota.getPnpQuotaStatus( ); ``` -You can increase the quota on your account by making a payment to the [`OdisPayments` contract](https://github.com/celo-org/celo-monorepo/blob/master/packages/protocol/contracts/identity/OdisPayments.sol). The cost per quota is 0.001 cUSD. +You can increase the quota on your account by making a payment to the [`OdisPayments` contract](https://github.com/celo-org/celo-monorepo/blob/master/packages/protocol/contracts/identity/OdisPayments.sol). The cost per query is 0.001 cUSD. ```ts if (remainingQuota < 1) { @@ -224,7 +224,7 @@ There are two authentication methods for your `AuthSigner` when interacting with accountsContract.setAccountDataEncryptionKey(DEK_PUBLIC_KEY).send({from: issuerAddress}) ``` - Any key pair can be used as a DEK, but [this](https://github.com/celo-org/celo-monorepo/blob/0aea63826f8c7e7d2f3fe0c32eb314471e2c2f33/packages/sdk/cryptographic-utils/src/dataEncryptionKey.ts#L36-L54) or [this](https://github.com/celo-org/celo-monorepo/blob/0aea63826f8c7e7d2f3fe0c32eb314471e2c2f33/packages/sdk/cryptographic-utils/src/account.ts#L440-L459) function in [`@celo/cryptographic-utils`](https://www.npmjs.com/package/@celo/cryptographic-utils) can be used to generate the DEK. Or, using a private key, you can get the compressed public key using [ethers Signing Key](https://docs.ethers.org/v5/api/utils/signing-key/). + Any key pair can be used as a DEK, but [this](https://github.com/celo-org/developer-tooling/tree/master/packages/sdk/cryptographic-utils/src/dataEncryptionKey.ts#L36-L54) or [this](https://github.com/celo-org/developer-tooling/tree/master/packages/sdk/cryptographic-utils/src/account.ts#L444-L463) function in [`@celo/cryptographic-utils`](https://www.npmjs.com/package/@celo/cryptographic-utils) can be used to generate the DEK. Or, using a private key, you can get the compressed public key using [ethers Signing Key](https://docs.ethers.org/v5/api/utils/signing-key/). The `EncryptionKeySigner` authentication method is preferred, since it doesn't require the user to access the wallet key that manages their funds. Also, when using the DEK for authentication, ODIS will also use the DEK as the blinding factor, so that ODIS identifies repeat queries and doesn’t charge additional quota. The tradeoff is that the extra computation when using the DEK can add a tiny bit of latency. diff --git a/packages/odis-identifiers/src/identifier.ts b/packages/odis-identifiers/src/identifier.ts index cd31bacb9..cb486414f 100644 --- a/packages/odis-identifiers/src/identifier.ts +++ b/packages/odis-identifiers/src/identifier.ts @@ -9,12 +9,12 @@ export const PEPPER_SEPARATOR = '__' * these prefixes prevent the ODIS identifers from being the same. * * If you would like to use a prefix that isn't included, please put up a PR - * adding it to @celo/base (in celo-monorepo/packages/sdk/base/src/identifier.ts) + * adding it to @celo/odis-identifiers (https://github.com/celo-org/social-connect/tree/main/packages/odis-identifiers/src/identifier.ts) * to ensure interoperability with other projects. When adding new prefixes, * please use either the full platform name in all lowercase (e.g. 'facebook') * or DID methods https://w3c.github.io/did-spec-registries/#did-methods. * Make sure to add the expected value for the unit test case in - * `celo-monorepo/packages/sdk/base/src/identifier.test.ts`, + * `https://github.com/celo-org/social-connect/tree/main/packages/odis-identifiers/src/identifier.test.ts`, * otherwise the test will fail. * * The NULL prefix is included to allow projects to use the sdk without selecting