Skip to content

Commit

Permalink
Merge pull request #103 from identity-com/develop
Browse files Browse the repository at this point in the history
0.1.1 RC1
  • Loading branch information
dankelleher authored Nov 16, 2021
2 parents b78f116 + c0fe93b commit be97afc
Show file tree
Hide file tree
Showing 68 changed files with 1,658 additions and 628 deletions.
6 changes: 4 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Try it out at [cryptid.identity.com](https://cryptid.identity.com/) or install t
* [Getting started](#getting-started)
* [Technical Details](#technical-details)

## Demo
## Screengrabs

### Balances

Expand Down Expand Up @@ -84,7 +84,7 @@ particular artists. We can add a verifiable credential to that identity, have it
A Cryptid account is an _identity_ in the form of an individual, company, pet, "inanimate object" or any real world
_thing_ you can think of.

Cryptid account can have zero or me keys associated with it. Accounts with zero keys can be controlled by a seperate
Cryptid account can have zero or more keys associated with it. Accounts with zero keys can be controlled by a separate
entity. Accounts with multiple keys will allow a Cryptid account to preform actions like:

* Multiple devices accessing the account
Expand All @@ -107,6 +107,32 @@ Advanced usage of Cryptid requires additional information to be registered on-ch
Solana. The details of these costs are explained in detail in the
[Solana documentation](https://docs.solana.com/developing/programming-model/accounts#calculation-of-rent)

### Do dApps need a special integration to use Crytpid?
No! We are planning to include Cryptid as a supported wallet within
[Solana's Wallet Adapter](https://github.com/solana-labs/wallet-adapter) which would make the utilization of Cryptid
completely transparent towards the dApp. It's just one more option for the user to chose from.

### Who really owns the funds in my Cryptid address?
On-chain your Cryptid address is owned by the System Program however the
[Cryptid Signer program](./programs/cryptid_signer) is the authority for it which makes sure that only keys and/or
controllers in your Cryptid account are able to sign for it. Therefore, if the program is secure, your funds are too.

Before launching Cryptid on Mainnet we will go through an extensive audit process, so that you don't only need to take
our word for it!

Lastly, since Solana generally allows programs to be updated, there would be a potential attack vector there. We will make
sure that the Cryptid program is either (1) not upgradable or (2) in the complete control of a multi-sig DAO structure.
The latter would even be able to support account recoveries via the DAO.

### Why does the world need Cryptid?
We understand that direct private key ownership is the ultimate level of control for any address or program on a blockchain.
However, we envision the future world of web3 much more nuanced than this! Private Key ownership is absolute, either you
have it or you don't. With this restriction, all higher level access mechanism are pushed off-chain into a world of
centralized services like custodial wallets or exchanges.

In contrast, we would like to see all these [current](#features) and [future](#on-our-roadmap) features realized on-chain
where everyone can transparently see and verify them.

## Getting Started

To contribute to Cryptid, please check out the [code of conduct](./CODE_OF_CONDUCT.md).
Expand Down
53 changes: 35 additions & 18 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $ npm install -g @identity.com/cryptid-cli
$ cryptid COMMAND
running command...
$ cryptid (-v|--version|version)
@identity.com/cryptid-cli/0.0.0 darwin-x64 node-v16.10.0
@identity.com/cryptid-cli/0.1.5 darwin-x64 node-v16.0.0
$ cryptid --help [COMMAND]
USAGE
$ cryptid COMMAND
Expand All @@ -28,6 +28,7 @@ USAGE
<!-- usagestop -->
# Commands
<!-- commands -->
* [`cryptid address`](#cryptid-address)
* [`cryptid airdrop [AMOUNT]`](#cryptid-airdrop-amount)
* [`cryptid alias [NAME] [DID]`](#cryptid-alias-name-did)
* [`cryptid balance`](#cryptid-balance)
Expand All @@ -47,6 +48,22 @@ USAGE
* [`cryptid token:transfer TO AMOUNT`](#cryptid-tokentransfer-to-amount)
* [`cryptid transfer TO AMOUNT`](#cryptid-transfer-to-amount)

## `cryptid address`

Show the cryptid account's address

```
USAGE
$ cryptid address
OPTIONS
-c, --config=config Path to config file
-h, --help show CLI help
-s, --as=as Execute transactions as a controlled identity (alias or did)
```

_See code: [src/commands/address.ts](https://github.com/identity-com/cryptid/blob/v0.1.5/src/commands/address.ts)_

## `cryptid airdrop [AMOUNT]`

Airdrop funds into the cryptid account and owner key
Expand All @@ -61,7 +78,7 @@ OPTIONS
-s, --as=as Execute transactions as a controlled identity (alias or did)
```

_See code: [src/commands/airdrop.ts](https://github.com/identity-com/cryptid/blob/v0.0.0/src/commands/airdrop.ts)_
_See code: [src/commands/airdrop.ts](https://github.com/identity-com/cryptid/blob/v0.1.5/src/commands/airdrop.ts)_

## `cryptid alias [NAME] [DID]`

Expand All @@ -78,7 +95,7 @@ OPTIONS
-u, --unset unset an alias
```

_See code: [src/commands/alias.ts](https://github.com/identity-com/cryptid/blob/v0.0.0/src/commands/alias.ts)_
_See code: [src/commands/alias.ts](https://github.com/identity-com/cryptid/blob/v0.1.5/src/commands/alias.ts)_

## `cryptid balance`

Expand All @@ -94,7 +111,7 @@ OPTIONS
-s, --as=as Execute transactions as a controlled identity (alias or did)
```

_See code: [src/commands/balance.ts](https://github.com/identity-com/cryptid/blob/v0.0.0/src/commands/balance.ts)_
_See code: [src/commands/balance.ts](https://github.com/identity-com/cryptid/blob/v0.1.5/src/commands/balance.ts)_

## `cryptid base`

Expand All @@ -108,7 +125,7 @@ OPTIONS
-s, --as=as Execute transactions as a controlled identity (alias or did)
```

_See code: [src/commands/base.ts](https://github.com/identity-com/cryptid/blob/v0.0.0/src/commands/base.ts)_
_See code: [src/commands/base.ts](https://github.com/identity-com/cryptid/blob/v0.1.5/src/commands/base.ts)_

## `cryptid config [SUBCOMMAND] [KEY] [VALUE]`

Expand All @@ -124,7 +141,7 @@ OPTIONS
-s, --as=as Execute transactions as a controlled identity (alias or did)
```

_See code: [src/commands/config.ts](https://github.com/identity-com/cryptid/blob/v0.0.0/src/commands/config.ts)_
_See code: [src/commands/config.ts](https://github.com/identity-com/cryptid/blob/v0.1.5/src/commands/config.ts)_

## `cryptid controller:add [DID]`

Expand All @@ -140,7 +157,7 @@ OPTIONS
-s, --as=as Execute transactions as a controlled identity (alias or did)
```

_See code: [src/commands/controller/add.ts](https://github.com/identity-com/cryptid/blob/v0.0.0/src/commands/controller/add.ts)_
_See code: [src/commands/controller/add.ts](https://github.com/identity-com/cryptid/blob/v0.1.5/src/commands/controller/add.ts)_

## `cryptid controller:remove [DID]`

Expand All @@ -156,7 +173,7 @@ OPTIONS
-s, --as=as Execute transactions as a controlled identity (alias or did)
```

_See code: [src/commands/controller/remove.ts](https://github.com/identity-com/cryptid/blob/v0.0.0/src/commands/controller/remove.ts)_
_See code: [src/commands/controller/remove.ts](https://github.com/identity-com/cryptid/blob/v0.1.5/src/commands/controller/remove.ts)_

## `cryptid controller:show [DID]`

Expand All @@ -172,7 +189,7 @@ OPTIONS
-s, --as=as Execute transactions as a controlled identity (alias or did)
```

_See code: [src/commands/controller/show.ts](https://github.com/identity-com/cryptid/blob/v0.0.0/src/commands/controller/show.ts)_
_See code: [src/commands/controller/show.ts](https://github.com/identity-com/cryptid/blob/v0.1.5/src/commands/controller/show.ts)_

## `cryptid document`

Expand All @@ -188,7 +205,7 @@ OPTIONS
-s, --as=as Execute transactions as a controlled identity (alias or did)
```

_See code: [src/commands/document.ts](https://github.com/identity-com/cryptid/blob/v0.0.0/src/commands/document.ts)_
_See code: [src/commands/document.ts](https://github.com/identity-com/cryptid/blob/v0.1.5/src/commands/document.ts)_

## `cryptid help [COMMAND]`

Expand Down Expand Up @@ -223,7 +240,7 @@ OPTIONS
-z, --cluster=cluster Cluster
```

_See code: [src/commands/init.ts](https://github.com/identity-com/cryptid/blob/v0.0.0/src/commands/init.ts)_
_See code: [src/commands/init.ts](https://github.com/identity-com/cryptid/blob/v0.1.5/src/commands/init.ts)_

## `cryptid key:add [KEY] [ALIAS]`

Expand All @@ -239,7 +256,7 @@ OPTIONS
-s, --as=as Execute transactions as a controlled identity (alias or did)
```

_See code: [src/commands/key/add.ts](https://github.com/identity-com/cryptid/blob/v0.0.0/src/commands/key/add.ts)_
_See code: [src/commands/key/add.ts](https://github.com/identity-com/cryptid/blob/v0.1.5/src/commands/key/add.ts)_

## `cryptid key:remove [ALIAS]`

Expand All @@ -255,7 +272,7 @@ OPTIONS
-s, --as=as Execute transactions as a controlled identity (alias or did)
```

_See code: [src/commands/key/remove.ts](https://github.com/identity-com/cryptid/blob/v0.0.0/src/commands/key/remove.ts)_
_See code: [src/commands/key/remove.ts](https://github.com/identity-com/cryptid/blob/v0.1.5/src/commands/key/remove.ts)_

## `cryptid key:show`

Expand All @@ -274,7 +291,7 @@ ALIASES
$ cryptid
```

_See code: [src/commands/key/show.ts](https://github.com/identity-com/cryptid/blob/v0.0.0/src/commands/key/show.ts)_
_See code: [src/commands/key/show.ts](https://github.com/identity-com/cryptid/blob/v0.1.5/src/commands/key/show.ts)_

## `cryptid token:balance MINT`

Expand All @@ -293,7 +310,7 @@ OPTIONS
-s, --as=as Execute transactions as a controlled identity (alias or did)
```

_See code: [src/commands/token/balance.ts](https://github.com/identity-com/cryptid/blob/v0.0.0/src/commands/token/balance.ts)_
_See code: [src/commands/token/balance.ts](https://github.com/identity-com/cryptid/blob/v0.1.5/src/commands/token/balance.ts)_

## `cryptid token:show`

Expand All @@ -309,7 +326,7 @@ OPTIONS
-s, --as=as Execute transactions as a controlled identity (alias or did)
```

_See code: [src/commands/token/show.ts](https://github.com/identity-com/cryptid/blob/v0.0.0/src/commands/token/show.ts)_
_See code: [src/commands/token/show.ts](https://github.com/identity-com/cryptid/blob/v0.1.5/src/commands/token/show.ts)_

## `cryptid token:transfer TO AMOUNT`

Expand All @@ -331,7 +348,7 @@ OPTIONS
-s, --as=as Execute transactions as a controlled identity (alias or did)
```

_See code: [src/commands/token/transfer.ts](https://github.com/identity-com/cryptid/blob/v0.0.0/src/commands/token/transfer.ts)_
_See code: [src/commands/token/transfer.ts](https://github.com/identity-com/cryptid/blob/v0.1.5/src/commands/token/transfer.ts)_

## `cryptid transfer TO AMOUNT`

Expand All @@ -351,5 +368,5 @@ OPTIONS
-s, --as=as Execute transactions as a controlled identity (alias or did)
```

_See code: [src/commands/transfer.ts](https://github.com/identity-com/cryptid/blob/v0.0.0/src/commands/transfer.ts)_
_See code: [src/commands/transfer.ts](https://github.com/identity-com/cryptid/blob/v0.1.5/src/commands/transfer.ts)_
<!-- commandsstop -->
8 changes: 4 additions & 4 deletions cli/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@identity.com/cryptid-cli",
"description": "Sign transactions and configure Cryptid DID Wallets",
"version": "0.0.0",
"version": "0.1.5",
"author": "identity.com",
"bin": {
"cryptid": "./bin/run"
},
"bugs": "https://github.com/identity-com/cryptid/issues",
"dependencies": {
"@identity.com/cryptid": "0.1.0",
"@identity.com/cryptid": "^0.1.1",
"@identity.com/sol-did-client": "1.0.0-beta",
"@oclif/command": "^1",
"@oclif/config": "^1",
Expand Down Expand Up @@ -96,9 +96,9 @@
"skip-full": true,
"check-coverage": true,
"branches": 11,
"lines": 60,
"lines": 58,
"functions": 21,
"statements": 59
"statements": 57
},
"types": "lib/index.d.ts"
}
13 changes: 13 additions & 0 deletions cli/src/commands/address.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Base from "./base";

export default class Address extends Base {
static description = "Show the cryptid account's address";

static flags = Base.flags;

async run(): Promise<void> {
const address = await this.cryptid.address();

this.log(address.toBase58());
}
}
4 changes: 2 additions & 2 deletions cli/src/commands/airdrop.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { airdrop } from "../service/cryptid";
import Base from "./base";

const DEFAULT_AIRDROP_LAMPORTS = 50_000_000;
const DEFAULT_AIRDROP_LAMPORTS = 1_000_000_000;

export default class Airdrop extends Base {
static description = "Airdrop funds into the cryptid account and owner key";
Expand All @@ -19,6 +19,6 @@ export default class Airdrop extends Base {
async run(): Promise<void> {
const { args } = this.parse(Airdrop);

await airdrop(this.cryptid, this.cryptidConfig, args.amount);
await airdrop(this.cryptid, this.cryptidConfig, args.amount, this.log);
}
}
9 changes: 6 additions & 3 deletions cli/src/commands/base.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Command } from "@oclif/command";
import * as Flags from "../lib/flags";
import { Config } from "../service/config";
import { build } from "../service/cryptid";
import { build, resolveDIDOrAlias } from "../service/cryptid";
import { Cryptid } from "@identity.com/cryptid";
import { Connection } from "@solana/web3.js";

Expand All @@ -28,12 +28,15 @@ export default abstract class Base extends Command {
}

async init(): Promise<void> {
// workaround for usinng static flags and args in base oclif command classes
// workaround for using static flags and args in base oclif command classes
// note, each subclass must define its own args and flags to avoid inconsistencies
// https://github.com/oclif/oclif/issues/225#issuecomment-806318444
const { flags } = this.parse(this.ctor as typeof Base);

this._config = new Config(flags.config);
this._cryptid = build(this._config, flags.as);
this._cryptid = build(
this._config,
resolveDIDOrAlias(flags.as, this._config)
);
}
}
Loading

0 comments on commit be97afc

Please sign in to comment.