Giter VIP home page Giter VIP logo

bitcoin-api-microservice's Introduction

Bitcoin API/Microservice

API endpoint that generates new Bitcoin addresses on server, passes public key back to requester and stores the associated private key to a MongoDB database.

Use Cases

  • Cloud Services
  • IoT Edge Devices
  • Background Processes

Technologies used:

  • .Net Core
  • Nbitcoin
  • C#
  • MongoDB
  • Docker

Building project

Run the docker compose file:

 docker-compose build
 docker-compose up

If you are developing outside of docker you may need to run:

dotnet restore

...before running

dotnet build

...to ensure all packages are available. You should also note that your ports may be different than the Compose focused instructions provided below.

Running the demo

Once you have your project running you can access the API endpoint using a GET request in your browser: localhost:8000/api/generate/publickeys/{int:count}

Here is an example resulting in a single public key being generated:

http://localhost:8000/api/generate/publickeys/1

And this will result in 5:

http://localhost:8000/api/generate/publickeys/5

Private key storage

To test that private keys are being stored use a MongoDB client such as Compass, Robo 3T or Navicat and navigate to:

 mongodb://mongodb:27017

As long as you don't shut down your docker instances after generating a few keys you should see the public keys with their associated private keys stored as records in the "keys" collection under the "bitcoin" database.

Security

In a production environment you should encrypt the private key(s) prior to database storage. The application itself should only have a key for encryption. The decryption key should be held in a secure location accessible only to a secondary microservice that is used for signing transactions.

bitcoin-api-microservice's People

Contributors

innvtv avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

ykankaya

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.