• Stars
    star
    403
  • Rank 107,140 (Top 3 %)
  • Language
    Rust
  • License
    Other
  • Created over 3 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Internet Identity, a blockchain authentication system for the Internet Computer

Internet Identity

Canister Tests Rust Frontend checks and lints GitHub all releases

πŸ”— https://identity.ic0.app β€’ πŸ“œ Specification
―
πŸ“š Forum β€’ πŸš‘ Report an Issue β€’ πŸ“ž Discord


Internet Identity is an authentication service for the Internet Computer. It is the authentication system that allows hundreds of thousands of users to log in to Dapps like Distrikt, DSCVR and more.

Internet Identity is:

  • Simple: It uses some of the WebAuthn API to allow users to register and authenticate without passwords, using TouchID, FaceID, Windows Hello, and more.
  • Flexible: Integrating Internet Identity in a Dapp (or even Web 2 app) is as simple as opening the Internet Identity's HTTP interface, https://identity.ic0.app, in a new tab. No need to interact with the canister smart contract directly.
  • Secure: Different identities are issued for each app a user authenticates to and cannot be linked back to the user.

For more information, see What is Internet Identity? on internetcomputer.org.

Table of Contents

Getting Started

This section gives an overview of Internet Identity's architecture, instructions on how to build the Wasm module (canister), and finally pointers for integrating Internet Identity in your own applications.

Architecture overview

Internet Identity is an authentication service for the Internet Computer. All programs on the Internet Computer are Wasm modules, or canisters (canister smart contracts).

Architecture

Internet Identity runs as a single canister which both serves the frontend application code, and handles the requests sent by the frontend application code.

πŸ’‘ The canister (backend) interface is specified by the internet_identity.did candid interface. The (backend) canister code is located in src/internet_identity, and the frontend application code (served by the canister through the http_request method) is located in src/frontend.

The Internet Identity authentication service works indirectly by issuing "delegations" on the user's behalf; basically attestations signed with some private cryptographic material owned by the user. The private cryptographic material never leaves the user's device. The Internet Identity frontend application uses the WebAuthn API to first create the private cryptographic material, and then the WebAuthn API is used again to sign delegations.

For information on how Internet Identity works in more detail, please refer to the following:

Building with Docker

To get the canister (Wasm module) for Internet Identity, you can either download a release from the releases page, or build the code yourself. The simplest way to build the code yourself is to use Docker and the docker-build script:

$ ./scripts/docker-build

The Dockerfile specifies build instructions for Internet Identity. Building the Dockerfile will result in a scratch container that contains the Wasm module at /internet_identity.wasm.gz.

πŸ’‘ The build can be customized with build features.

We recommend using the docker-build script. It simplifies the usage of build features and extracts the Wasm module from the final scratch container.

πŸ’‘ You can find instructions for building the code without Docker in the HACKING document.

Integration with Internet Identity

The using-dev-build demo shows a documented example project that integrates Internet Identity. For more, please refer to the Client Authentication Protocol section of the Internet Identity Specification to integration Internet Identity in your app from scratch. For a just-add-water approach using the agent-js library (also used by using-dev-build), check out Kyle Peacock's blogpost.

If you're interested in the infrastructure of how to get the Internet Identity canister and how to test it within your app, check out using-dev-build, which uses the Internet Identity development canister.

Build Features and Flavors

The Internet Identity build can be customized to include features that are useful when developing and testing. We provide pre-built flavors of Internet Identity that include different sets of features.

Features

These options can be used both when building with docker and without docker. The features are enabled by setting the corresponding environment variable to 1. Any other string, as well as not setting the environment variable, will disable the feature.

For instance:

$ II_FETCH_ROOT_KEY=1 dfx build
$ II_DUMMY_CAPTCHA=1 II_DUMMY_AUTH=1 ./scripts/docker-build

⚠️ These options should only ever be used during development as they effectively poke security holes in Internet Identity

The features are described below:

Environment variable Description
II_FETCH_ROOT_KEY When enabled, this instructs the frontend code to fetch the "root key" from the replica.
The Internet Computer (https://ic0.app) uses a private key to sign responses. This private key not being available locally, the (local) replica generates its own. This option effectively tells the Internet Identity frontend to fetch the public key from the replica it connects to. When this option is not enabled, the Internet Identity frontend code will use the (hard coded) public key of the Internet Computer.
II_DUMMY_CAPTCHA When enabled, the CAPTCHA challenge (sent by the canister code to the frontend code) is always the known string "a". This is useful for automated testing.
II_DUMMY_AUTH When enabled, the frontend code will use a known, stable private key for registering anchors and authenticating. This means that all anchors will have the same public key(s). In particular this bypasses the WebAuthn flows (TouchID, Windows Hello, etc), which simplifies automated testing.
II_INSECURE_REQUESTS When enabled, the 'upgrade-insecure-requests' directive is removed from the content security policy in order to allow local development with Safari.

Flavors

We offer some pre-built Wasm modules that contain flavors, i.e. sets of features targetting a particular use case. Flavors can be downloaded from the table below for the latest release or from the release page for a particular release.

Flavor Description
Production This is the production build deployed to https://identity.ic0.app. Includes none of the build features. πŸ’Ύ
Test This flavor is used by Internet Identity's test suite. It fully supports authentication but uses a known CAPTCHA value for test automation. Includes the following features:
  • II_FETCH_ROOT_KEY
  • II_DUMMY_CAPTCHA
πŸ’Ύ
Development This flavor contains a version of Internet Identity that effectively performs no checks. It can be useful for external developers who want to integrate Internet Identity in their project and care about the general Internet Identity authentication flow, without wanting to deal with authentication and, in particular, WebAuthentication. Includes the following features:
  • II_FETCH_ROOT_KEY
  • II_DUMMY_CAPTCHA
  • II_DUMMY_AUTH
  • II_INSECURE_REQUESTS

See the using-dev-build project for an example on how to use this flavor.
πŸ’Ύ

Stable Memory Compatibility

Internet Identity requires data in stable memory to have a specific layout in order to be upgradeable. The layout has been changed multiple times in the past. This is why II stable memory is versioned and each version of II is only compatible to some stable memory versions.

If on upgrade II traps with the message stable memory layout version ... is no longer supported then the stable memory layout has changed and is no longer compatible.

The easiest way to address this is to reinstall the canister (thus wiping stable memory). A canister can be reinstalled by executing dfx deploy <canister> --mode reinstall.

Getting Help

We're here to help! Here are some ways you can reach out for help if you get stuck:

  • Internet Identity Bug Tracker: Create a new ticket if you encounter a bug using Internet Identity, or if an issue arises when you try to build the code.
  • DFINITY Forum: The forum is a great place to look for information and to ask for help.
  • Support: Create a support request if you'd like to keep things private.

Links

More Repositories

1

ic

Internet Computer blockchain source: the client/replica software run by nodes
Rust
1,555
star
2

awesome-internet-computer

A curated list of awesome projects and resources relating to the Internet Computer Protocol
742
star
3

examples

Example applications, microservices, and code samples for the Internet Computer
JavaScript
521
star
4

motoko

Simple high-level language for writing Internet Computer canisters
OCaml
496
star
5

motoko-base

The Motoko base library
Motoko
480
star
6

cancan

A scalable video sharing service.
TypeScript
335
star
7

candid

Candid Library for the Internet Computer
Rust
276
star
8

cdk-rs

Rust canister development kit for the Internet Computer.
Rust
198
star
9

sdk

IC SDK: a Software Development Kit for creating and managing canister smart contracts on the ICP blockchain.
Rust
167
star
10

linkedup

An open professional network.
JavaScript
155
star
11

agent-js

A collection of libraries and tools for building software around the Internet Computer, in JavaScript.
TypeScript
147
star
12

docs

Documentation for writing code for the Internet Computer
Motoko
144
star
13

agent-rs

A collection of libraries and tools for building software around the Internet Computer, in Rust.
Rust
120
star
14

vessel

The original package manager for Motoko
Rust
113
star
15

nns-dapp

The Dapp of the Internet Computer's Network Nervous System.
TypeScript
113
star
16

oisy-wallet

A browser-based, multi-chain wallet hosted on the Internet Computer
TypeScript
93
star
17

stable-structures

A collection of data structures for fearless canister upgrades.
Rust
90
star
18

portal

Internet Computer Developer Portal
TypeScript
83
star
19

ICRC-1

A fungible token standard developed by the Ledger & Tokenization working group for the IC.
Rust
81
star
20

quill

Governance & ledger toolkit for cold wallets
Rust
80
star
21

ic-js

Libraries for interfacing with the Internet Computer.
JavaScript
70
star
22

ic-repl

Rust
70
star
23

motoko-playground

Motoko playground
TypeScript
65
star
24

grant-rfps

Grant RFPs and Bounties
62
star
25

cycles-wallet

DFINITY Cycles Wallet
TypeScript
57
star
26

keysmith

Hierarchical Deterministic Key Derivation for the Internet Computer
Shell
45
star
27

rosetta-client

JavaScript
44
star
28

invoice-canister

Providing an example and simplified experience for accepting payments in smart contracts
Motoko
44
star
29

vscode-motoko

Motoko language support for VS Code.
JavaScript
42
star
30

icp-eth-starter

An advanced starter project for interacting with Ethereum on the Internet Computer (Beta)
TypeScript
40
star
31

certified-assets

A certified assets canister written in Rust.
39
star
32

bitcoin-developer-preview

A preview of the integration between Bitcoin and the Internet Computer.
Rust
38
star
33

interface-spec

IC Interface Specification
JavaScript
37
star
34

exchange-rate-canister

The exchange rate canister (XRC) makes use of the HTTP requests feature to provide exchange rates as a service to the IC.
Rust
37
star
35

bitcoin-canister

Rust
36
star
36

ic-hs

A haskell toolbox for the Internet Computer
Haskell
35
star
37

gix-components

A UI kit developed by the GIX team
Svelte
34
star
38

ic-wasm

A collection of libraries and tools for transforming Wasm canisters running on the Internet Computer
Rust
34
star
39

wg-identity-authentication

Repository of the Identity and Wallet Standards Working Group
TypeScript
32
star
40

ic-websocket-poc

Rust
31
star
41

ICRC

Repository to ICRC proposals
29
star
42

icx-proxy

A rust-based command line tool to serve as a gateway for a Internet Computer replica.
Rust
28
star
43

prettier-plugin-motoko

A code formatter for the Motoko smart contract language.
TypeScript
28
star
44

icfront

TypeScript
27
star
45

bigmap-poc

Proof of concept of an infinitely scalable data storage for the Internet Computer application, written in Rust
Rust
26
star
46

http-proxy

Proof of concept implementation of the IC HTTP Gateway Protocol that enables end-to-end secure connections with dApps being served from the internet computer.
TypeScript
23
star
47

motoko-dev-server

A live reload development server for Motoko smart contracts.
TypeScript
22
star
48

pocketic

A canister smart contract testing solution for the Internet Computer.
22
star
49

ic-docutrack

DocuTrack is a proof-of-concept dapp built on the Internet Computer for sharing and managing documents.
Svelte
22
star
50

canister-profiling

Collection of canister performance benchmarks
Rust
21
star
51

node-ic0

An easy-to-use JavaScript API for the Internet Computer.
TypeScript
19
star
52

response-verification

Client side response verification for the Internet Computer
Rust
17
star
53

vessel-package-set

The official community package-set for vessel
Dhall
17
star
54

orbit

A trustless multi-custody digital assets management platform on the Internet Computer.
Rust
17
star
55

snsdemo

Developer focused SNS deployment demo
Shell
15
star
56

node-motoko

Compile and run Motoko smart contracts in Node.js or the browser.
TypeScript
15
star
57

canbench

A benchmarking framework for canisters on the Internet Computer.
Rust
15
star
58

erc20-icp

Contracts and canisters enabling ERC20 ICP on Ethereum
Rust
13
star
59

hardware-wallet-cli

A CLI to interact with the Internet Computer App on Ledger Nano S/X devices.
JavaScript
12
star
60

pocketic-py

PocketIC Python: A Canister Testing Library for the Internet Computer
Python
11
star
61

dre

Decentralized Reliability Engineering
Rust
10
star
62

wg-governance

Repository of the governance working group
10
star
63

embed-motoko

Embed a custom Motoko code snippet in a Medium article, blog post, or webapp.
TypeScript
10
star
64

experimental-minting-tool

CLI tool for minting NFT's
Rust
10
star
65

sns-testing

Testing SNS in local testing environment
Shell
9
star
66

threshold

Threshold voting and execution for the IC
Motoko
9
star
67

sns-quill

SNS governance & ledger toolkit for cold wallets
Rust
9
star
68

motoko.rs

Motoko concrete syntax parser in Rust.
Rust
9
star
69

antora-sdk

Repo for website collaboration - antora project file and ui project files
CSS
9
star
70

getting-started

A repository for getting started on the Internet Computer
9
star
71

canpack

Package multiple libraries into one ICP canister.
TypeScript
9
star
72

miracl_core_bls12381

Rust code of https://github.com/miracl/core (miracl_core) for curve BLS 12-381.
Rust
9
star
73

icx-nns

Rust
8
star
74

rosetta-node

A passive node of the IC that can be interacted with using the Rosetta protocol
Rust
8
star
75

cycles-ledger

The cycles ledger is a global ledger canister that enables principal IDs to hold cycles.
Rust
8
star
76

dfx-extensions

Source repo for DFX extensions binaries and metadata
Rust
8
star
77

test-state-machine-client

Rust library to interact with the ic-test-state-machine
Rust
8
star
78

papi

Paid APIs
Rust
7
star
79

dfxvm

dfx version manager
Rust
7
star
80

icp-dev-env

A Docker image for a canister smart contract developer environment for ICP.
Dockerfile
7
star
81

setup-dfx

GitHub Action to set up dfx
7
star
82

ic-gamekit

C#
7
star
83

chain-fusion-signer

A canister that does nothing but sign transactions for use on other blockchains.
Rust
6
star
84

idl2json

Rust
6
star
85

cns

Chain Name System, a trustless and decentralized discoverability layer hosted directly on the Internet Computer.
Rust
6
star
86

feedback

An ICP community feedback dapp powered by Motoko.
TypeScript
6
star
87

ic-burp-extension

Java
6
star
88

ic-staking-documentation

HTML
5
star
89

icp-hello-world-motoko

A quick and easy way to develop for the Internet Computer in Motoko on macOS, Windows or Linux.
JavaScript
5
star
90

ledger-ref

The reference implementation of ICP ledger canister.
Motoko
5
star
91

formal-models

TLA+ models of various IC components and canisters
TLA
5
star
92

wasmtime-hs

Haskell bindings to the wasmtime WASM engine
Haskell
5
star
93

internet-identity-playwright

A Playwright library to simplify the integration of Internet Identity authentication in E2E tests.
TypeScript
5
star
94

nginx-modules

C
4
star
95

dfn-components

TypeScript
4
star
96

verifiable-credentials-sdk

Repository containing a set of libraries to manage the verifiable credentials in Internet Computer
Rust
4
star
97

ic-types

DEPRECATED (A rust library containing typings and utility functions dealing with the Public specification of the Internet Computer.)
Rust
4
star
98

ic-quickjs-demo

Demo of embedding QuickJS in IC
Rust
4
star
99

ic-gateway

HTTP to IC gateway service
Rust
3
star
100

icp-calculator

A calculator of fees and costs for smart contracts on the Internet Computer Protocol (ICP)
TypeScript
3
star