Skip to content

Commit

Permalink
checkpoint before merge
Browse files Browse the repository at this point in the history
  • Loading branch information
sanity committed Aug 11, 2024
1 parent 6d48bf9 commit 4649825
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 72 deletions.
49 changes: 43 additions & 6 deletions hugo-site/content/ghostkey/_index.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
---
title: "Ghost Keys"
title: "Freenet Ghost Key"
date: 2024-07-10
draft: false
layout: "single"
---

{{< bulma-button href="/ghostkey/create/" color="#339966" >}}Get Your Ghost Key{{< /bulma-button >}}
{{< bulma-button href="https://crates.io/crates/ghostkey" color="#3366cc" >}}Command Line Tool{{< /bulma-button >}}
{{< bulma-button href="https://crates.io/crates/ghostkey_lib" color="#6633cc" >}}Ghost Key Library{{< /bulma-button >}}
{{< bulma-button href="/ghostkey/create/" color="#339966" >}}Donate Here to Get Your Ghost Key{{< /bulma-button >}}

### Learn More

- [What is a Ghost Key?](#what-is-a-ghost-key)
- [How do Ghost Keys work?](#how-do-ghost-keys-work)
- [How much should I donate?](#how-much-should-i-donate)
- [What can I do with my Ghost Key?](#what-can-i-do-with-my-ghost-key)
- [How do I store my Ghost Key?](#how-do-i-store-my-ghost-key)
- [How do I use my Ghost Key?](#how-do-i-use-my-ghost-key)

# What is a Ghost Key? {#what-is-a-ghost-key}

Expand Down Expand Up @@ -51,7 +50,45 @@ be securely recorded in your Ghost Key certificate, and in the future it's possi
perks on the network will be reserved for those who donate more or who donated earlier. Think of it
like a "founding member" club.

# What can I do with my Ghost Key? {#what-can-i-do-with-my-ghost-key}
# How do I store my Ghost Key? {#how-do-i-store-my-ghost-key}

When you first receive your Ghost Key it's very important that you store it securely, perhaps as
a secure note in a password manager you trust.

# How do I use my Ghost Key? {#how-do-i-use-my-ghost-key}

You can use our [command line tool](https://crates.io/crates/ghostkey) to verify your Ghost Key
and use it to sign and verify messages. Here is how to install and use it:

```bash
# If necessary install Rust
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Install the Ghost Key command line tool
$ cargo install ghostkey

# Verify it's working
$ ghostkey -h
Utility for generating and verifying Freenet ghost keys. Use 'ghostkey <subcommand> -h'
for help on specific subcommands.

Usage: ghostkey [COMMAND]

Commands:
verify-ghost-key Verifies a ghost certificate
generate-master-key Generate a new master keypair
generate-delegate Generates a new delegate signing key and certificate
verify-delegate Verifies a delegate key certificate using the master verifying key
generate-ghost-key Generates a ghost key from a delegate signing key
sign-message Signs a message using a ghost key
verify-signed-message Verifies a signed message
help Print this message or the help of the given subcommand(s)

Options:
-h, --help Print help
-V, --version Print version

$ ghostkey verify-ghost-key --ghost-certificate ~/Downloads/ghost-key-cert.pem
Ghost certificate verified
Info: {"action":"freenet-donation","amount":20,"delegate-key-created":"2024-07-30 15:39:26"}
```
15 changes: 4 additions & 11 deletions hugo-site/content/ghostkey/success/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,10 @@ without revealing your identity. Please wait a moment while we process your info

{{< donation-success >}}

## What is a Ghost Key?

{{< include "../ghost-key-explanation.md" >}}

## What's Next?

Once your Ghost Key certificate is generated, you'll be able to download it. This certificate can be
used to prove your donation status within the Freenet network, potentially unlocking certain
features or privileges, all while keeping your identity concealed.

Remember to save your Ghost Key certificate in a secure location. It's your private proof of
donation and cannot be replaced if lost.
Copy or download your Ghost certificate and key and put it somewhere safe, such as a secure note
in a password manager you trust. You can use your Ghost Key to prove your donation to Freenet
without revealing your identity.

Thank you again for supporting Freenet and embracing privacy-preserving technology.
{{< bulma-button href="/ghostkey/" color="#339966" >}}Ghost Key FAQ{{< /bulma-button >}}
2 changes: 1 addition & 1 deletion hugo-site/themes/freenet/layouts/partials/api-url.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script>
window.ghostkeyApiUrl = {{ if hugo.IsServer }}"http://localhost:8000"{{ else }}"https://gkapi.freenet.org"{{ end }};
window.stripePublishableKey = {{ if hugo.IsServer }}{{ .Site.Params.stripePublishableKeyTest }}{{ else }}{{ .Site.Params.stripePublishableKeyLive }}{{ end }};
</script>
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h4 class="subtitle is-5">Ghost Key (contains both certificate and private key)<
</button>
</div>
</div>
<p class="warning"><strong>Warning:</strong> Keep your Ghost Key secret. It contains both your certificate and private key.</p>
<p class="warning"><strong>Warning:</strong> Keep this secret, it contains both your ghost certificate and signing key.</p>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion rust/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ghostkey"
version = "0.1.5"
version = "0.1.6"
edition = "2021"
description = "A command-line tool for Freenet Ghost Key operations"
license = "MIT OR Apache-2.0"
Expand Down
52 changes: 0 additions & 52 deletions rust/gklib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,55 +55,3 @@ assert_eq!(verified_info, info);

`ghostkey_lib` is released under the
[GNU Lesser General Public License v3.0](https://www.gnu.org/licenses/lgpl-3.0.html).
# Ghostkey Library (ghostkey_lib)

A Rust library for creating and managing [ghost keys and certificates](https://freenet.org/ghostkey/) in the [Freenet](https://freenet.org/) ecosystem.

## Features

- Creation and verification of delegate certificates
- Creation and verification of ghost key certificates
- RSA and Ed25519 cryptographic operations
- Serialization and deserialization of certificates

## Usage

Add this to your `Cargo.toml`:

```toml
[dependencies]
ghostkey_lib = "0.1.2" # Replace with the latest version
```

Example usage:

```rust
use ghostkey_lib::{DelegateCertificateV1, GhostkeyCertificateV1, util::create_keypair};
use rand_core::OsRng;

// Create a master key pair
let (master_signing_key, master_verifying_key) = create_keypair(&mut OsRng).unwrap();

// Create a delegate certificate
let info = "Test Delegate".to_string();
let (delegate_certificate, delegate_signing_key) =
DelegateCertificateV1::new(&master_signing_key, &info).unwrap();

// Create a ghost key certificate
let (ghost_key_certificate, ghost_key_signing_key) =
GhostkeyCertificateV1::new(&delegate_certificate, &delegate_signing_key);

// Verify the ghost key certificate
let verified_info = ghost_key_certificate
.verify(&Some(master_verifying_key))
.unwrap();
assert_eq!(verified_info, info);
```

## More Information

For more information about ghost keys and their use in Freenet, please visit the [Freenet Ghost Key documentation](https://freenet.org/ghostkey/).

## License

This project is licensed under the GNU Lesser General Public License v3.0 (LGPL-3.0).

0 comments on commit 4649825

Please sign in to comment.