Git Product home page Git Product logo

message-signing's Introduction

Message Signing

This is a library that implements the CIP-0008 message signing spec for the Cardano blockchain.

The library is composed of structs for (de)serializing the CBOR defined in CIP-0008/COSE which lays at the core of the protocol, mostly defined in lib.rs, as well as many helper utilities for more specific cases useful to CIP-0008. These are mostly in builders.rs for building the CBOR structures specific to certain algorithms.

NPM packages

Building

It can be used from both rust or compiled to wasm as all public code works with wasm-bindgen via wasm-pack.

There are no rust crates/npm packages uploaded yet, but these will come in the future.

In the meantime to build a wasm package we can run one of

  • npm run rust:build-nodejs for nodejs targeted wasm
  • npm run rust:build-browser for browser targeted wasm
  • npm run asm:build for conversion for asm.js

and for use from rust simply use the lib that resides in /rust/.

Example Usage

It is important to read the CIP-0008 spec to properly understand how to use this library. As per CIP-0008/COSE, signing is done via constructing a SigStructure and then signing this with the proper keys. This can be simplified via the use of the COSESignBuilder (for multiparty signing) / COSESign1Builder (for single signer) builders. Encryption is not yet supported by this library but will be in the future. An example node.js (wasm option) project that signs a message with a Cardano address exists in the /example/ directory which has detailed comments describing each step.

message-signing's People

Contributors

rooooooooob avatar vsubhuman avatar sebastiengllmt avatar alessandrokonrad avatar mark-stopka avatar

Watchers

James Cloos 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.