Overview
Everyone deserves a little data to play with. Here at The 1024 Club we give you a full 1024 bytes to play with as your very own. That's 1k, or about 1/11,796th the size of a floppy disk from 1986! What sort of magic can you dream up with yours?
Features List
- No user accounts or registration
- API endpoint allocates a block of space for you based on the hash of your public key
- Your private key signs data transactions to the API for CRUD of your 1k block
- Ability to set MIME-type of your block (e.g., text, image, HTML)
Download Utilities
You can download the utility scripts needed to interact with the API:
wget https://the1024.club/utils.zip
Instructions to Unzip
After downloading the utils, unzip it using the following command:
unzip utils.zip
This will extract the necessary utility scripts for interacting with the 1024 Club API.
Getting Started with the API
Follow these steps to start using your 1KB block via the API:
- **Install Required Dependencies**:
You need to install the required dependencies via Composer before running the utilities. Run the following commands:
# If you don't have Composer installed, first install it php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php composer-setup.php php -r "unlink('composer-setup.php');" # Install sodium and cURL dependencies php composer.phar require paragonie/sodium_compat php composer.phar require guzzlehttp/guzzle
- **Generate a Key Pair**:
Use the provided `generate_keys.php` script to generate an Ed25519 public/private key pair:
# The script will output the Base64-encoded public and private keys, store them in files for use php generate_keys.php > keys.txt # You can now copy the public and private keys into separate files: cat keys.txt | grep 'Public Key' | cut -d ' ' -f3 > public_key.pem cat keys.txt | grep 'Private Key' | cut -d ' ' -f3 > private_key.pem
- **Create Your Block**: Use the `1kb_client.php` script to create your block on the site:
# Create a new block using your public key php 1kb_client.php create public_key.pem
- **Update Your Block**: Sign your data with the private key, then use the `1kb_client.php` script to update your block:
# Sign your data and update the block with plain text php 1kb_client.php update public_key.pem private_key.pem "Your data here" "text/plain" -or- # Sign your data and update the block with html php 1kb_client.php update public_key.pem private_key.pem "<h1>Hello, World!</h1>" "text/html" -or- # Sign your data and update the block with an image: php 1kb_client.php update public_key.pem private_key.pem "$(base64 /path/to/image.png)" "image/png"
- **Retrieve Your Block**: Retrieve the data from your block using the `/retrieve` endpoint:
# Retrieve data using the public key php 1kb_client.php retrieve public_key.pem
For more details on key generation and signing, see our Technical Specifications section below.
Technical Specifications
This API uses Ed25519 key pairs for signing and verifying data. The API supports both URL-safe Base64 and non-URL-safe Base64-encoded public keys for all operations. Ensure you generate your keys with a supported tool such as OpenSSL or the `generate_keys.php` script.
To sign your data, use your private key to generate a signature over the data, and then Base64-encode the signature for the API. Both the public key and signature must be Base64-encoded.
The API supports various MIME types, including:
- text/plain for plain text
- text/html for HTML data
- image/png for PNG images