Shard Detail

cardano_cip08 v0.2.0

A Crystal implementation of CIP08 for wallet signature verification on Cardano.
cardano cbor cip cip08 cose crystal crystal-lang ed25519

Install & Use

Add the following code to your project's shard.yml under:

dependencies to use in production
- OR -
development_dependencies to use in development


cardano_cip08:
  github: wout/cardano-cip08

Readme

cardano-cip08

A Crystal implementation of CIP08 for wallet signature verification on Cardano.

Most common use cases:

  1. Proving ownership of a set address.
  2. Proving ownership of addresses used in a transaction.
  3. Proving ownership of an identity or other off-chain data with a public key attached to it.

GitHub GitHub tag (latest SemVer) GitHub Workflow Status

Installation

  1. Add the dependency to your shard.yml:
dependencies:
  cardano_cip08:
    github: wout/cardano-cip08
  1. Run shards install

Usage

require "cardano_cip08"

cip08 = Cardano::CIP08.new(key, signature)

# validate the signature
if cip08.signature_valid?
  # get the message
  puts cip08.message

  # get the raw address bytes
  puts cip09.address_bytes
else
  puts "Invalid signature!"
end

Note: In its current state, this library won't look in the headers of the signature, so the COSE key should be provided separately.

To-do

  • Add the address_bech32 method (needs a Bech32 implementation for Crystal first)
  • Add an initialize overload accepting only a signature with the COSE key in the header (4)

Contributing

  1. Fork it (https://github.com/wout/cardano-cip08/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • Wout - creator and maintainer