Not maintained anymore. Check @NaturalSelectionLabs for further updates.
A go lib for RSS3
This package includes main types of RSS3, including:
- RSS3Base
- RSS3
- RSS3List
- RSS3Item
Also, with useful methods like *.SetSign
, and *.CheckSign
.
Using like this can create signature for your RSS3 Persona demo
.
var key *ecdsa.PrivateKey
...
var demo types.RSS3
demo.SetSign(key)
And this can check if the signer and embedded signature matches.
demo.CheckSign()
For other demos, you can check those *_test.go
files for more help.
Contains some useful tools:
- FixSign
- SignMsg
This function can delete the starting "0x" of signature (if it has), and fix the ending (eth-crypto library would somewhat add 0x1b to the last byte, causing it change from 00/01 to 1b/1c, which will crash the requested functions)
utils.FixSign(signatureReceived)
This function can be used to create signatures for []byte
. Here's a demo with a string.
var key *ecdsa.PrivateKey
...
msgBytes := []byte("DemoMsg")
sign := utils.SignMsg(key, msgBytes)
signHex := hex.EncodeToString(sign)
(Recommend not to use outside this package)
-
types/for_sign.go: types derived of useless fields for creating signature.
Those types often ends with
4S
which means "For(4) Sign" -
types/for_file.go: full types with all fields (as described in definition) for storage use.
Those types often ends with
4F
which means "For(4) File"