Project

sygna

0.0
No commit activity in last 3 years
No release in over 3 years
This is a Ruby library to help you build servers/services within Sygna Bridge Ecosystem.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.17
~> 12
~> 3.7

Runtime

 Project Readme

Sygna

Gem Version Build Status

This is a Ruby library to help you build servers/servies within Sygna Bridge Ecosystem. For more detail information, please see Sygna Bridge.

Installation instructions

If you are using Mac OS X and Homebrew, run these commands to install required development tools:

$ brew install autoconf automake libtool

Then download and install the library:

$ git clone https://github.com/bitcoin-core/secp256k1.git
$ cd secp256k1
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install

Add this line to your application's Gemfile:

gem 'sygna'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sygna

Usage

You need prepare private key first, like this

# The private key example:
# -----BEGIN EC PRIVATE KEY-----
# ...
# ...
# ...
# -----END EC PRIVATE KEY-----

initialize configure

Sygna.configure do |config|
  config.private_key = "Your private key"
end

Private Info

Encode

data = { name: "Nic" }
public_key_hex = "abcde12345"

Sygna::PrivateInfo.encode(data, public_key_hex)
# => encrypted string

Decode

data = "qazwsxedc1234567890"

Sygna::PrivateInfo.decode(data)
# => decrypted string

Signature

Sign

object = { name: "Nic" }

Sygna::Signature.sign(object)

# => signatured string

Verify

object = { name: "Nic" }
signature = "abcde12345"
public_key_hex = "originator public key"

Sygna::Signature.verify(object, signature, public_key_hex)

# => true or false

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/niclin/sygna.

License

The gem is available as open source under the terms of the MIT License.