Git Product home page Git Product logo

co-sign's Introduction

Welcome to Co Sign ๐Ÿ‘‹

Version

A service that provides collaborative and secure custody of bitcoin. A M of N multi-sig wallet where the user holds M of the keys and the service holds one, that way the service is unable to sign transactions since they only have one key. Users can make use of their M keys or allow service to provide the other key necessary for transaction (User has to give service permission to sign with their key)

Backend

Requirements

python
pip
virtualenv
postgres

Running The Backend

  1. clone the repository git clone https://github.com/toshmanuel/co-sign.git
  2. cd Backend
  3. virtualenv venv
  4. for MACOS/LINUX source venv/bin/activate
  5. for WINDOWS venv\Scripts\activate
  6. pip install -r requirements.txt
  7. create a .env file in the Backend directory
  8. check the .env.sample file and copy to variable to the .env file
  9. replace the 'somevalues' with the neccesary value
  10. python manage.py runserver

API Examples

  1. POST /api/v1/register

Request Body

{
 "email": "[email protected]",
 "password": "somepassword",
 "password2": "somepassword"
}

On a successful request, this endpoint would return a 201 status code and

Response Body

{
   "email": "[email protected]"
}

On a failed request e.g, email is not provided or the password does not match, or the password is too common, or the user already exists. this endpoint would return a 400 bad request status code

Possible Error Response, may return one or more of the following error

{
   "email": [
      "This field must be unique.", 
      "Enter a valid email address."
   ],
   "password": [
       "This password is too common.",
       "Password fields didn't match.",
   ]
}
  1. POST /api/v1/login

Request Body

{
 "username": "[email protected]",
 "password": "somepassword",
}

On a successful request, this endpoint would return a 200 status code and

Response Body

{
   "expiry": "2022-05-10T06:01:06.930521+01:00",
   "token": "3ee47e529230b68e12685924f1da2aa0cf67e228ea486626b6e2bbbeda117936"
}

On a failed request e.g, username is not provided, or the username is wrong or does not exist, or the password is incorrect, this endpoint would return a 400 bad request status code

Possible Error Response, may return one or more of the following error

{
   "non_field_errors": [
       "Unable to log in with provided credentials."
   ],
   "username": [
       "This field may not be blank."
   ],
   "password": [
       "This field may not be blank."
   ]
}
  1. POST /api/v1/logout/

Request Header should contain Authorzation: Token token_generated_from_login

On a successful request, this endpoint would return a 204 status code

On a failed request e.g, if the key "Authorization" is not provided in the header, this endpoint would return a 400 bad request status code

Possible Error Response, may return one or more of the following error

{
   "detail": "Invalid token."
}

{
   "detail": "Authentication credentials were not provided."
}

Authors

๐Ÿ‘ค toshmanuel ๐Ÿ‘ค Muneerah1612 ๐Ÿ‘ค j-kon

Show your support

Give a โญ๏ธ if this project helped you!

co-sign's People

Contributors

j-kon avatar toshmanuel avatar muneerah1612 avatar stickies-v avatar

Watchers

 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.