Giter VIP home page Giter VIP logo

braavos-account-cairo's Introduction

Braavos Account Contract

MAINNET ALPHA DISCLAIMER

The Braavos Account is in alpha stage, as well as the StarkNet network itself.

Things can break and in extreme cases can lead to loss of funds. The contract code have not yet been audited, the wallet code as well as the contracts themselves can be upgraded without a timelock.

Design

The Braavos account contract is comprised of 3 main modules:

  1. Basic account functionality - validation and execution of Multicall based on OpenZeppelin's implementation. Can be found under src/account.
  2. Signer management - adding / removing of additional signers, namely the secp256r1-based Hardware Signer. Can be found under src/signers
  3. Multisig - implementation of M of N signers for transaction execution. Currently supports 2 of 2. Can be found under src/multisig

This account contract is intended to be used as an implementation of a Proxy contract. We've used OpenZeppelin's Proxy implementation for this purpose.

Signer Management

When adding an additional signer, a Hardware Signer or Protected Signer, the basic seed-based signer cannot sign transactions anymore besides a request to remove the additional signer and revert back to seed-based signer. The request is time-delayed (currently for 4 days).

Multisig

The account can be moved into Multisig mode (currently supports 2 of 2) and it will not execute any transaction before the 2 signers defined in the account sign the transaction. The seed can request to disable multisig with a time-delay (currently 4 days).

Building

Account Contract

nile compile --directory src/account

Proxy Contract

nile compile --directory lib/openzeppelin/upgrades/

Testing

Running End-to-End tests

pytest -n auto tests/

Credits

  1. Thanks to the OpenZeppelin team for providing reference implementations for both the basic account functionality and the Proxy pattern at https://github.com/OpenZeppelin/cairo-contracts
  2. Thanks to EulerSmile for providing the reference secp256k1 implementation - https://github.com/EulerSmile/common-ec-cairo

braavos-account-cairo's People

Contributors

semantic-release-bot avatar yoga-braavos 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.