Source project for the Internet Computer software

Last update: May 19, 2022

The Internet Computer Protocol (ICP)

The Internet Computer is the world’s first blockchain that runs at web speed and can increase its capacity without bound. Like the Internet (which is composed of many machines adhering to TCP/IP protocol) and blockchain protocols (such as Bitcoin and Ethereum).

Resources on the Internet Computer

Network Dashboards from the community

You can observe the state of the Internet Computer’s infrastructure (Nodes, data centers, subnets) and traditional blockchain metrics (blocks/second, Token Supply, etc)

To interact with the community, check out the developer forum: https://forum.dfinity.org/

Rust implementation of the ICP

This repo contains many different pieces (including testing and other infrastructure components), but the most important one is the source code for the Rust implementation of the "replica" (read: "client" in some blockchains) that is compiled and run by the machines that together make up the Internet Computer.

DFINITY Foundation

The DFINITY Foundation is a Swiss not-for-profit organization based in Zurich, Switzerland, which oversees research centers in Palo Alto, San Francisco, and Zurich. Its goal is to further the design, development, and adoption of the Internet Computer Protocol.

Getting Started

Who should be using this code

  • If you are an app developer, and your intent is to build apps so you want a local Internet Computer replica in your machine to deploy to, you are better off using the Canister SDK written by the DFINITY Foundation. It is optimized for this and much more lightweight (less than 2 minutes to get started). It will build and run a local replica and you do not need to get into systems code to run it.

  • If you are a blockchain enthusiast, and your intent is to understand the protocol (not an implementation), you may be better off going to the IC Interface Specification. This content (by the DFINITY research team) is tailor made for understanding the protocol and design.

  • If you are a blockchain miner, you should know that the Internet Computer Protocol (while it is a blockchain) does not have the traditional mining or validating you may come to expect from blockchain projects. The Interet Computer Protocol is designed using new and novel cryptography that does not require "mining"…​ but it does require independent node providers, which may include yourself. You can of course check out the source code in this repo, but a better resource may be this: Being a node provider on the Internet Computer

  • If you are an engineer looking to build a new SDK, oracle, wallet or any part that enables and improves the Internet Computer ecosystem, you should take a look at the Interface Specification which is for low-level interaction with the Internet Computer.

  • If you are a systems engineer, security engineer or cryptographer, and your intent is to see what is going on under the hood by digging through source and building this locally, then you are in the right place.

Prerequisites

For all environments

Please note: The default memory assigned to the docker image may be less (2GB by default on MacOS). We recommend this should be increased to 10 GB avoid build failures within the Docker container.

MacOS

  • Homebrew

  • Xcode command line tools

  • coreutils (tip: once you have homebrew, you can run $ brew install coreutils if you do not have them)

Note: You do not need to install the Rust package manager Cargo or a lot of the toolchain used to build the repo. That all comes for you with the Docker image.

Building the code

Note: we have observed that to build all the pieces it takes around 30-50 minutes, depending on your machine.

1. Build a Docker image

Run the bash script in the repo to build a docker image that includes:

  • The repo you have cloned

  • Third-party binary dependencies (e.g. rustup, ubuntu, etc). For the purpose of transparency and security, you can look at the dockerfile file to see what these binaries are

$ gitlab-ci/docker/docker-build-local-image.sh

2. Enter Docker shell

Execute this command to run the docker image you just built:

$ gitlab-ci/tools/docker-run

Your shell may look something like this

3. Build the three main components within Docker shell

This will put you in a shell inside the Docker container. Within the Docker container, you will need to navigate to the Rust directory (/rs):

[email protected]:/builds/dfinity/ic$ cd rs
[email protected]:/builds/dfinity/ic/rs$

4. Use regular Cargo commands to build the three main pieces (replica, nodemanager, NNS Canisters):

a. Build the replica. The replica is a collection of protocol components that are necessary for a node to participate in a subnet.

[email protected]:/builds/dfinity/ic/rs$ cargo build -p ic-replica

b. Build the nodemanager: The nodemanager is a component of the Internet Computer that manages the replica. Among other things, it continuously determines the correct replica binary to run for this node at any point in time, runs this binary, and monitors this process (e.g. restarting it if it exits unexpectedly). This may take an hour if it is being built inside an VM.

[email protected]:/builds/dfinity/ic/rs$ cargo build -p nodemanager

Note: You can build both a. replica and b. nodemanager together:

[email protected]:/builds/dfinity/ic/rs$ cargo build -p ic-replica -p nodemanager

c. Build the NNS (Network Nervous System) canisters Once you have replica and nodemanager built, you need to install NNS Canisters. NNS canisters have a special Cargo command because they are written in Rust but compiled to Wasm, so you need to tell Cargo to target Wasm.

$ gitlab-ci/tools/docker-run gitlab-ci/tools/cargo-build-canisters

Contributing

The Network Nervous System

Thank you for taking the time to learn more about the Internet Computer Protocol. You can contribute to either, but it is important to note that the Internet Computer is governed by a decentralized system called the Network Nervous System (NNS). You can learn more here:

Open Source Policy

The DFINITY Foundation makes the code of the Internet Computer available to the public.

This is important so that the community can review the code that defines the behaviour of the Internet Computer. Furthermore, the community will be able to build the code and verify that it derives from the same binary image that is referenced in upgrade proposals published via the Network Nervous System (NNS).

Now that the Internet Computer is launched, the source code of the three primary components of the Internet Computer are published: the replica, nodemanager, and the NNS canisters. The build systems, testing infrastructure and the code that defines the Internet Computer Operating System (IC-OS) will be published at a later time.

All code of the Internet Computer is be licensed under the Apache 2.0 license, except for a few components licensed under the Internet Computer Community Source License and Internet Computer Shared Community Source License which are more restrictive than the Apache 2.0 license to protect the Intellectual Property (IP) of the DFINITY Foundation.

While we adapt our development processes and security reviews for a world of developing with our code in the open, we are not accepting any pull requests at this time. For now, please join our developer community at https://forum.dfinity.org. If you discover any bugs and vulnerabilities, alert us by email at [email protected]. Please do not submit any third party code - only textual descriptions. Any comments, suggestions and recommendations you submit to us will be assigned to the DFINITY Foundation.

GitHub

https://github.com/dfinity/ic
Comments
  • 1. Create CONTRIBUTING.md

    Propose contribution guidelines to inform potential contributors that external PRs won’t be accepted at present.

    This information will be surfaced as described in: https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/setting-guidelines-for-repository-contributors

    Motivated in part by: https://forum.dfinity.org/t/btcflower-xyz-seems-to-be-hosted-on-ic-but-why-this-domain-name-does-not-need-redirection/10787/10?u=paulyoung

    Reviewed by paulyoung at 2022-02-16 07:49
  • 2. feat: service-worker. Add support for chunk certification

    That is a part of proposal about chunks certification (with backward compatibility).

    These improvements are a proposal to improve the certification infrastructure around IC and might be considered as a recommendation for dfinity-team.

    Goal

    Make it possible to certify asset chunks. Validate chunk certificates on the service-worker and icx-proxy.

    Why

    At the moment, the service-worker and icx-proxy does not support the certification of chunkified files. Moreover, right now it is not possible to correctly stream chunkified and large audio and video files to the front-end. This problems could be solved independently if it would be possible to install an additional service-worker in the certified zone of the domain ic0.app (for 206 partial http-request handling). But is is impossible because there is unable to place custom worker on ic0.app domain. Making your own custom player for audio and video is extremely difficult due to the large number of formats and non-native implementation.

    Details

    To make this possible, support for HTTP-range requests for http_request query method has been added. This is done to support native html audio/video element (which uses 206 partial http-request) and to determine the index of the chunk throught 206 partial http-request. Using 206 partial http-requests allows you to focus only on certification in the worker and icx-proxy.

    Steps

    1. It all starts with PR for certified-assets-canister in cdk-rs
    2. Did file was updated in PR for certified-assets-canister
    3. (Here) Service-worker started supporting chunk_tree certificate verification
    4. icx-proxy started supporting chunk_tree certificate verification in PR for icx-proxy
    5. Added support for new certified-assets-canister did in PR for agent-rs
    Reviewed by 3cL1p5e7 at 2022-02-28 08:39
  • 3. feature: Service-worker. Add certified streaming for chunkified assets

    Problem:

    for assets over 2mb size, verification did not pass. This is because the worker only loads and checks the sha256-hashes of the first chunk. Obviously, the hash of the chunk and the hash of the entire file (in sha256 field) do not match.

    Solution:

    Make service-worker to load and concat all chunks before hash-check.

    Important

    This PR is related, but not blocked by 2 others https://github.com/dfinity/agent-js/pull/527 https://github.com/dfinity/certified-assets/pull/22

    Comments:

    • Now service-worker can check certificates for any assets over 2mb size.
    • It was necessary to update the Jest because I caught an error Wrong magic number when I did IDL.encode -> IDL.decode. Current Jest setup corresponds to dfinity/agent-js/agent setup.
    • fetch: self.fetch.bind(self) is passed to HttpAgent intentionally. See https://github.com/dfinity/agent-js/pull/527

    Waiting for comments on implementation

    Reviewed by 3cL1p5e7 at 2022-02-09 13:54
  • 4. Bump psutil from 5.5.1 to 5.6.6 in /policy-monitoring

    Bumps psutil from 5.5.1 to 5.6.6.

    Changelog

    Sourced from psutil's changelog.

    5.6.6

    2019-11-25

    Bug fixes

    • 1179_, [Linux]: Process.cmdline()_ now takes into account misbehaving processes renaming the command line and using inappropriate chars to separate args.
    • 1616_, [critical]: use of Py_DECREF instead of Py_CLEAR will result in double free() and segfault (CVE-2019-18874 <https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-18874>__). (patch by Riccardo Schirone)
    • 1619_, [OpenBSD], [critical]: compilation fails due to C syntax error. (patch by Nathan Houghton)

    5.6.5

    2019-11-06

    Bug fixes

    • 1615_: remove pyproject.toml as it was causing installation issues.

    5.6.4

    2019-11-04

    Enhancements

    • 1527_, [Linux]: added Process.cpu_times()_ iowait counter, which is the time spent waiting for blocking I/O to complete.
    • 1565_: add PEP 517/8 build backend and requirements specification for better pip integration. (patch by Bernát Gábor)

    Bug fixes

    • 875_, [Windows], [critical]: Process.cmdline(), Process.environ() or Process.cwd()_ may occasionally fail with ERROR_PARTIAL_COPY which now gets translated to AccessDenied_.
    • 1126_, [Linux], [critical]: Process.cpu_affinity()_ segfaults on CentOS 5 / manylinux. Process.cpu_affinity()_ support for CentOS 5 was removed.
    • 1528_, [AIX], [critical]: compilation error on AIX 7.2 due to 32 vs 64 bit differences. (patch by Arnon Yaari)
    • 1535_: type and family fields returned by net_connections()_ are not always turned into enums.
    • 1536_, [NetBSD]: Process.cmdline()_ erroneously raise ZombieProcess_ error if cmdline has non encodable chars.

    ... (truncated)

    Commits
    • c6cd256 pre release
    • b2414b8 revert #1595
    • c63369e updat HISTORY
    • edb20f6 linux, cmdline(), fix for #1179, comment 552984549: sometimes string ends wit...
    • d739cbb use PROCESS_QUERY_LIMITED_INFORMATION
    • f7e898b #1595: use psutil_pid_is_running() instead of GetExitCodeProcess
    • 72c84cb #fix #1595 / windows: kill() may not raise AccessDenied
    • 1f8d432 Merge branch 'master' of github.com:giampaolo/psutil
    • e6faebc release gil around users()/BSD (#1425)
    • 5cb1b0b Merge branch 'master' of github.com:giampaolo/psutil
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    Reviewed by dependabot[bot] at 2022-05-12 15:11
  • 5. fix: "Illegal invocation" in service-worker

    This is fix of error message Failed to fetch response: TypeError: Failed to execute ‘fetch’ on ‘WorkerGlobalScope’: Illegal invocation while using service-worker in browser.

    Found, solved and tested in this forum topic

    To solve the problem you can accept current PR or accept another PR for agent-js and update dependencies here

    Reviewed by 3cL1p5e7 at 2022-02-12 18:42
  • 6. Bump shelljs from 0.8.4 to 0.8.5 in /typescript/service-worker

    Bumps shelljs from 0.8.4 to 0.8.5.

    Release notes

    Sourced from shelljs's releases.

    v0.8.5

    This was a small security fix for #1058.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    Reviewed by dependabot[bot] at 2022-02-23 12:22
  • 7. Bump follow-redirects from 1.14.4 to 1.14.8 in /typescript/service-worker

    Bumps follow-redirects from 1.14.4 to 1.14.8.

    Commits
    • 3d81dc3 Release version 1.14.8 of the npm package.
    • 62e546a Drop confidential headers across schemes.
    • 2ede36d Release version 1.14.7 of the npm package.
    • 8b347cb Drop Cookie header across domains.
    • 6f5029a Release version 1.14.6 of the npm package.
    • af706be Ignore null headers.
    • d01ab7a Release version 1.14.5 of the npm package.
    • 40052ea Make compatible with Node 17.
    • 86f7572 Fix: clear internal timer on request abort to avoid leakage
    • 2e1eaf0 Keep Authorization header on subdomain redirects.
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    Reviewed by dependabot[bot] at 2022-02-14 23:40
Related tags
Terabethia - A Bridge and Messaging Protocol between Ethereum and the Internet Computer.
Terabethia - A Bridge and Messaging Protocol between Ethereum and the Internet Computer.

Terabethia - A Bridge Between Ethereum & the Internet Computer Terabethia is a bridge between Ethereum & the Internet Computer that contracts in both

Apr 30, 2022
DIP721 - An Internet Computer Non-fungible Token Standard
DIP721 - An Internet Computer Non-fungible Token Standard

DIP721 - Introduction DIP721 is an ERC-721 style non-fungible token standard built mirroring its Ethereum counterpart and adapting it to the Internet

May 15, 2022
A preview of the integration between Bitcoin and the Internet Computer.

Bitcoin Integration Developer Preview Overview The integration between the Internet Computer and Bitcoin will enable developers to build canisters tha

May 28, 2022
Rust library for build smart contracts on Internet Computer, by the Spinner.Cash team.

Spinner Rust library for building smart contracts on the Internet Computer. More specifically it is used by Spinner.Cash, a decentralized layer-2 prot

May 6, 2022
Zcash - Internet Money
Zcash - Internet Money

Zcash 4.3.0 What is Zcash? Zcash is an implementation of the "Zerocash" protocol. Based on Bitcoin's code, Zcash intends to offer a far higher standar

May 22, 2022
All the data an IC app needs to make seamless experiences, accessible directly on the IC. DAB is an open internet service for NFT, Token, Canister, and Dapp registries.
All the data an IC app needs to make seamless experiences, accessible directly on the IC. DAB is an open internet service for NFT, Token, Canister, and Dapp registries.

DAB ?? Overview An Internet Computer open internet service for data. All the data an IC app needs to make a seamless experience, accessible directly o

May 17, 2022
HyperCube is a free and open source blockchain project for everyone to use.

XPZ Public Chain HyperCube is a free and open source blockchain project for everyone to use. 日本語 简体中文 正體中文 HyperCube Wiki Wha is HyperCube HyperCube i

May 12, 2022
A Software Development Kit (SDK) for Zero-Knowledge Transactions

Aleo SDK The Aleo SDK is a developer framework to make it simple to create a new account, craft a transaction, and broadcast it to the network. Table

May 13, 2022
secret folders generator to hide hentais in your computer
secret folders generator to hide hentais in your computer

hentai dream 95 secret folders generator to hide hentais in your computer, but its really old way as **** used techniquee one injection technique from

Jul 8, 2021
Turnstile encrypts data so that it can only be decrypted on another computer

Turnstile - One Way Encryption Turnstile encrypts data so that it can only be decrypted on another computer (and can't be decrypted on the encrypting

May 6, 2022
An extensible open-source framework for creating private/permissioned blockchain applications

Exonum Status: Project info: Community: Exonum is an extensible open-source framework for creating blockchain applications. Exonum can be used to crea

May 24, 2022
The public source and documentation for Xenon iOS tweak.

THE GUIDE HAS BEEN MOVED TO THE WIKI This is the public source for the Xenon iOS tweak. The full version is available for $1.99 on Chariz. Differences

May 2, 2022
Crates - A collection of open source Rust crates from iqlusion

iqlusion crates ?? This repository contains a set of Apache 2.0-licensed packages (a.k.a. "crates") for the Rust programming language, contributed to

May 17, 2022
CKB's vm, based on open source RISC-V ISA

Nervos CKB VM About CKB VM CKB VM is a pure software implementation of the RISC-V instruction set used as scripting VM in CKB. Right now it implements

May 7, 2022
Open source Rust implementation of the Witnet decentralized oracle protocol, including full node and wallet backend 👁️🦀
Open source Rust implementation of the Witnet decentralized oracle protocol, including full node and wallet backend  👁️🦀

witnet-rust is an open source implementation of the Witnet Decentralized Oracle Network protocol written in Rust. Components witnet-rust implements ma

Apr 27, 2022
Outp0st is an open-source UI tool to enable next-level team collaboration on dApp development over Terra blockchain
Outp0st is an open-source UI tool to enable next-level team collaboration on dApp development over Terra blockchain

Outp0st is an open-source UI tool to enable next-level team collaboration on dApp development over Terra blockchain

May 4, 2022
An open source desktop wallet for nano and banano with end-to-end encrypted, on chain messaging using the dagchat protocol.
An open source desktop wallet for nano and banano with end-to-end encrypted, on chain messaging using the dagchat protocol.

An open source wallet with end-to-end encrypted, on chain messaging for nano and banano using the dagchat protocol.

May 3, 2022
A Rust port of the password primitives used in Django Project.

Rust DjangoHashers A Rust port of the password primitives used in Django Project. Django's django.contrib.auth.models.User class has a few methods to

Mar 10, 2022
Temporary edit external crates that your project depends on

rhack You want to quickly put a sneaky macro kind of like dbg! into external crates to find out how some internal data structure works? If so rhack is

May 18, 2022