Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code example for signing content.json #132

Closed
rllola opened this issue Dec 30, 2018 · 1 comment
Closed

Code example for signing content.json #132

rllola opened this issue Dec 30, 2018 · 1 comment

Comments

@rllola
Copy link
Contributor

rllola commented Dec 30, 2018

In the documentation there is a section that explain everything we need to know oncontent.json. It has a subsection call signs.

See (https://github.com/HelloZeroNet/Documentation/blob/master/docs/en/site_development/content_json.md)

A code snippet in python showing how it is working would be nice to help people understand how it works.

@HelloZeroNet
Copy link
Owner

The actual code we use:

del(new_content["signs"])  # Delete old signs
sign_content = json.dumps(new_content, sort_keys=True)
sign = btctools.ecdsa_sign(sign_content, privatekey)
new_content["signs"] = {}
new_content["signs"][privatekey_address] = sign

It does not includes the cryptography part, but I think we don't have to go that deep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants