GithubHelp home page GithubHelp logo

isabella232 / argent-contracts-starknet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from argentlabs/argent-contracts-starknet

0.0 0.0 0.0 410 KB

License: GNU General Public License v3.0

Python 100.00%

argent-contracts-starknet's Introduction

Argent Account on StarkNet

Warning: StarkNet is still in alpha, so is this project. In particular the ArgentAccount.cairo contract has not been audited yet and should not be used to store significant value.

High-Level Specification

The account is a 2-of-2 custom multisig where the signer key is typically stored on the user's phone and the guardian key is managed by an off-chain service to enable fraud monitoring (e.g. trusted contacts, daily limits, etc) and recovery. More specifically, the guardian acts both as a co-validator for typical operations of the wallet, and as the trusted actor that can recover the wallet in case the signer key is lost or compromised.

The user can always opt-out of the guardian service and manage the guardian key himself. Alternatively he/she can add a second guardian_backup key to the account that has the same role as the guardian and can be used as the ultimate censorship resistance guarantee.

Normal operations of the wallet (execute, change_signer, change_guardian, change_guardian_backup, validate_guardian_signature, cancel_escape) require the approval of both parties to be executed.

Each party alone can trigger the escape mode (a.k.a. recovery) on the wallet if the other party is not cooperating or lost. An escape takes 7 days before being active, after which the non-cooperating party can be replaced. The wallet is asymmetric in favor of the signer who can override an escape triggered by the guardian.

A triggered escape can always be cancelled with the approval of both parties.

We assume that the signer key is backed up such that the probability of the signer key being lost should be close to zero.

Under this model we can build a simple yet highly secure non-custodial wallet.

To enable that model to evolve if needed, the account is implemented as a proxy delegating all calls to a target implementation. Upgrading the wallet to a new implementation requires the approval of both the signer and a guardian.

Action Signer Guardian Comments
Execute X X
Change Signer X X
Change Guardian X X
Change Guardian Backup X X
Trigger Escape Guardian X Can override an escape signer in progress
Trigger Escape Signer X Fail if escape guardian in progress
Escape Guardian X After security period
Escape Signer X After security period
Cancel Escape X X
Upgrade X X

Development

Setup a local virtual env

python -m venv ./venv
source ./venv/bin/activate

Install Cairo dependencies

brew install gmp
pip install -r requirements.txt

See for more details:

Compile the contracts

nile compile

Test the contracts

pytest ./test/argent_account.py

argent-contracts-starknet's People

Contributors

juniset avatar gergold avatar delaaxe avatar pscott avatar janek26 avatar cremafr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.