Giter Site home page Giter Site logo

starfish-server's Introduction

starfish-server

A Peer to Peer Identity System, powered by Bitcoin.

poster

Introduction

  • starfish-server is an implementation of the Starfish identity scheme, which takes the form of a node.js web server.
  • starfish-desktop, a cross platform desktop app implementation (Mac, Windows, Linux) is powered by starfish-server. The desktop app wraps the starfish-server in an app format.

How starfish-server works

workflow

starfish-server is an implementation of the Starfish scheme that takes the form of a node.js module that runs as a web server at port 21000.

The web server receives POST requests at its /sign endpoint and signs the request message with its embedded wallet and returns the HTTP response.

As of v0.1.0, the response format looks like this:

{
  "address": <The Signer Bitcoin Address>,
  "sig": <The Signature>,
  "message": <The message that was requested and signed>,
  "ts": <The unix timestamp at which the signature was made>
}

Using the node module

Install the module in your project:

npm install --save starfish-server

And then start the server:

const starfish = require('starfish-server')
starfishd({
  db: <The Key Path for Starfish>
})

It will start a /sign endpoint at port 21000.

If you make a POST request with a "message" attribute, it will sign the message and return the response.

<html>
<script>
fetch("http://localhost:21000/sign", {
  method: 'post',
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    message: "Sign this message!"
  })
}).then((res) => {
  return res.json()
}).then((res) => {
  console.log("Respons", res)
})
</script>
</html>

Running as standalone

If you want to run starfish-server as a standalone app instead of a node module, you should first checkout the Starfish app, which wraps the starfish-server module in a cross platform app format that supports Mac, Windows, and Linux.

But if you must directly run starfish-server without running it as an app format, you can also do that. Just do:

npm install -g starfish-server

to install globally, and then run

starfish 

starfish-server's People

Contributors

sobachef avatar

Stargazers

 avatar Rohan Sharan avatar Alan Kash avatar  avatar Marcel Gruber avatar Cornel Cristian Filip avatar Ryan Wold avatar Maxime avatar  avatar klar avatar John Merrells avatar  avatar  avatar Dorian Tudorache avatar Brenton Gunning avatar Dave Foderick avatar Time avatar LI Long avatar Mathias Wulff avatar Mr. Z avatar Brad Jasper avatar Alex avatar Montana Flynn avatar holdenbach avatar  avatar

Watchers

 avatar Marcel Gruber avatar  avatar holdenbach 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.