Highly decentralized and censorship-resistant way to store key data

Overview

Beacon coin

Beacon coin is a Chia singelton coin that can store data that needs to be:

  • always available
  • censorship resistant
  • versioned
  • potentially immutable

You might want to use it for coordinating peers in a network, storing DNS information or whatever else you think of. (please share though). I wrote this mainly to learn more about Chialisp and explore smart coins in Chia Network (especially singletons). I used some general principles that could be expanded to implement a smart contract type of coin, with methods and state etc.

This code is still work in progress so please DO NOT USE it on mainnet. Use at your own risk.

Please note that I'm not affiliated with Chia Network. This means that I don't know if this is the right way to write smart coins and that it might contain some serious security issues until more people review it. Any feedback appreciated. Thanks!

How to use

For Unix/Macs

Clone this repo in a directory.

python3 -m venv venv
. ./venv/bin/activate
pip install .
beacon-coin --help

It should work on Windows too, although did't test:

py -m venv venv
./venv/Scripts/activate
pip install .
beacon-coin

You'll need a testnet chia node and wallet with some mojos. Once wallet and node are synced, you can start using beacon coin. Make sure CHIA_ROOT is set and pointing to the correct chia network (testnet!). More on that here: https://github.com/Chia-Network/chia-blockchain/wiki/How-to-connect-to-the-Testnet

Usage

Usage: beacon-coin [OPTIONS] COMMAND [ARGS]...

  Manage beacon coins on Chia network.

  They can be used to store key information in a decentralized and durable
  way.

Options:
  --config-path TEXT  Path to your Chia blockchain config (usually ~/.chia).
                      Defaults to fetching it from CHIA_ROOT env var.

  --fingerprint TEXT  Key fingerprint, will default to first one it finds if
                      not provided.

  -v, --verbose       Show more debugging info.
  --help              Show this message and exit.

Commands:
  add-pair      Add a pair of strings to coin data.
  change-owner  Change the owner, works on mutable and immutable coins.
  freeze        Freezing makes the coin immutable
  get-data      Returns a JSON of coin data and metadata Can be piped into...
  mint          Mint a new beacon coin, returns a LAUNCHER_ID.
  remove-pair   Remove a pair at a specifed index from coin data.

First you'll need to mint a beacon coin:

$ beacon-coin mint --fee=10 
Minted a new beacon coin with id: 3085341ed92faeda6887f5270b7cc049c024bd2bf1c27a9e8f33e1f902fbea12

Track transaction: 070d0ed91de0ce80c884f13ecad4db02d9d63ae028244e1e55dc69aac1b7904f     Fee: 10 mojos

NOTE: Store launcher_id somewhere safe as this wallet doesn't keep it anywhere yet.

Wait until transaction is processed.

You can use cdv mempool -txid 070d0ed91de0ce80c884f13ecad4db02d9d63ae028244e1e55dc69aac1b7904f

Let's check contents first:

$ beacon-coin get-data 0x3085341ed92faeda6887f5270b7cc049c024bd2bf1c27a9e8f33e1f902fbea12
{"version": 1, "data": []}

Ok, now let's add some data:

$ beacon-coin add-pair --fee=10 0x3085341ed92faeda6887f5270b7cc049c024bd2bf1c27a9e8f33e1f902fbea12 "some" "data"
Added pair ('some', 'data') using transaction: 364eeab9433f6bbf382f2659bdf5bc23c51ae862a765b3d3fdfcf56fe9c8bf1e

Wait again for node to process it.

And let's check content again:

$ beacon-coin get-data 0x3085341ed92faeda6887f5270b7cc049c024bd2bf1c27a9e8f33e1f902fbea12                       
{"version": 2, "data": [[0, ["some", "data"]]]}

Ok, we just stored some data on Chia blockchain.

Let's add more and test the removal.

$ beacon-coin add-pair --fee=10 0x3085341ed92faeda6887f5270b7cc049c024bd2bf1c27a9e8f33e1f902fbea12 "more" "data"
Added pair ('more', 'data') using transaction: 4e1ed3b76c474a73d68781d328b130d408bacd6650b4018d63231581655aac33
$ beacon-coin get-data 0x3085341ed92faeda6887f5270b7cc049c024bd2bf1c27a9e8f33e1f902fbea12                       
{"version": 3, "data": [[0, ["more", "data"]], [1, ["some", "data"]]]}
$ beacon-coin remove-pair --fee=15 0x3085341ed92faeda6887f5270b7cc049c024bd2bf1c27a9e8f33e1f902fbea12 0
Removed pair at 0 using transaction: efbbe9fbeadc78c0840f3bffbda57ea1f8d734cbb634992fcd5e4aa28c4a5ab1
$ beacon-coin get-data 0x3085341ed92faeda6887f5270b7cc049c024bd2bf1c27a9e8f33e1f902fbea12
{"version": 4, "data": [[0, ["some", "data"]]]}

Python API

beacon-coin is internally using python API to manage coins.

TODOs

  • refactor wallet and make it more DRY
  • publish tests (right now still in progress)
  • add soft linking between different coins, can enable things like having an immutable beacon coin that points to other mutable coins
Owner
Sebastjan Trepca
Sebastjan Trepca
Mizogg-Bitcoin-Tools - A Python Tools for Bitcoin Information Balance, HASH160, DEC

Mizogg-Bitcoin-Tools Tools for Bitcoin Information Balance, HASH160, DEC, Englis

48 Jan 02, 2023
This is an experimental AES-encrypted RPC API for ESP 8266.

URPC This is an experimental AES-encrypted RPC API for ESP 8266. Usage The server folder contains a sample ESP 8266 project. Simply set the values in

Ian Walton 1 Oct 26, 2021
XMRiGUI is free and open-source crypto miner for Linux. It uses XMRig for mining and GTK3 for GUI.

XMRiGUI is free and open-source crypto miner for Linux. It uses XMRig for mining and GTK3 for GUI.

29 Jul 07, 2022
An encryption format offering better security, performance and ease of use than PGP.

An encryption format offering better security, performance and ease of use than PGP. File a bug if you found anything where we are worse than our competition, and we will fix it.

27 Dec 25, 2022
A Python implementation of CWT/COSE.

Python CWT - A Python implementation of CWT/COSE Python CWT is a CBOR Web Token (CWT) and CBOR Object Signing and Encryption (COSE) implementation com

Ajitomi Daisuke 13 Dec 14, 2022
a BTC mining program based on python3

BTC-Miner a BTC mining program based on python3 Our project refers to the nightminer project by ricmoo, which is written in Python2 (https://github.co

6 Jul 31, 2022
A simple graphical interface for encrypting sentences

A simple graphical interface for encrypting sentences

Marcus Vinรญcius Ribeiro Andrade 1 Oct 09, 2021
SimpleWallet - Simple wallet for Bitcoin

Simple Wallet This is a basic python starter package to be used as a template fo

Mystic 1 Jan 08, 2022
Certifi: Python SSL Certificates

(Python Distribution) A carefully curated collection of Root Certificates for validating the trustworthiness of SSL certificates while verifying the identity of TLS hosts.

Certifi 608 Jan 02, 2023
Django-based Crypto Portfolio Tracker โ€“ keep an eye on Shiba Inu and other Crypto

Crypto Tracker ๐Ÿ ๐Ÿ“ˆ โ€“ Central Portfolio Tracking Easy asset tracking โ€“ at a glance ๐Ÿš€ Dashboard to centrally monitor current crypto portfolio develop

65 Jan 08, 2023
Simple python program to encrypt files with AES-256 encryption

simple-enc Simple python program to encrypt files with AES-256 encryption Setup First install "pyAesCrypt" using pip. Thats it! Optionally you can add

Hashm 2 Jan 19, 2022
Tron Wallet (TRX) Crack Finder With Python Just 64 Line

TRXGEN Tron Wallet Finder and Crack With Python Tron Wallet (TRX) Crack Finder With Python Just 64 Line My tools [pycharm + anaconda3 + python3.8 + vi

MMDRZA 6 Dec 18, 2022
Bot to trade crypto trading ranges

crypto-trading-bot Crypto bot with DCA or GRID trading strategy Sends notifictions to telegram chat Crypto bot with webhook feature which can be used

3 Jun 18, 2021
Amazing CryptoWAF was a CTF challenge for ALLES! CTF 2021

ctf-cryptowaf The AmazingCryptoWAF โ„ข๏ธ is used by the "noter" web app, to offer automagically military encryption for any user data. Even if an attacke

32 Jan 02, 2023
A simple Ethereum mining pool

A simple getWork pool for ethereum mining Payouts are still manual. TODO: write payouts when someone mines 10 blocks. Also, make the submit actually

93 Oct 05, 2022
Pythonic Smart Contract Language for the EVM

Introduction orfipy is a tool written in python/cython to extract ORFs in an extremely and fast and flexible manner. Other popular ORF searching tools

Vyper 4.4k Dec 30, 2022
Tracking (of choice) cryptocurrencies' daily prices and moving average.

Crypto-price-moving_average Tracking (of choice) cryptocurrencies' daily prices and moving average. About Alpha Vantage The Alpha Vantage library (htt

Thong Huynh 2 Jan 22, 2022
A workshop to build an NFT smart contract on the polygon blockchain

Polygon NFT Workshop This is an interactive workshop that guides you through the steps to deploy an NFT smart contract on the Polygon blockchain. By t

Banjo Obayomi 56 Oct 14, 2022
This is a simple Bitcoin non-deterministic wallet address generator coded in Python 3.

This is a simple Bitcoin non-deterministic wallet address generator coded in Python 3. It generates a Private Key in different formats (hex, wif and compressed wif) and corresponding Public Addresses

7 Dec 22, 2022
Tutela: an Ethereum and Tornado Cash Anonymity Tool

Tutela: an Ethereum and Tornado Cash Anonymity Tool The repo contains open-source code for Tutela, an anonymity tool for Ethereum and Tornado Cash use

TutelaLabs 96 Dec 05, 2022