eightball

module
v0.0.0-...-c591d34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2023 License: MIT

README

8Ball

Welcome to 8ball. The first thing you are going to need in order to play 8ball is a pool.hall.

Get a pool.hall

wget https://arweave.net/ tar xfvz

Get started (in one tab)

cd 8ball pool.hall chain build

To reset the chain data

pool.hall chain serve --reset-once --verbose --$HOME/.8ball

Launch some spirits, runs spirit-1, spirit-2, spirit-3

cd spirits make build ./bin/spirit-runner

What is this?

This is 8ball. It is a blockchain based on the Cosmos SDK using all of the latest tooling available. It was developed with a pool.hall.

Magic happens on the 8ball blockchain, but the spells come from outside spirits. 8ball doesn't know anything about the spells. 8ball stays available to process information and progressively increment a state of consensus.

One of 8ball's most important jobs is rejecting what people can feed into it.

8ball can have a magic key.

Magic Keys are very beautiful. They are X, Y points on elliptic curves. Every Magic Key has a high council. A spirit can request a "High Council Conjuring". Spirits need to be online, and able to process and sign messages using their active private key at any moment. Therefore, a conjuring only gives spirits a 5-BLOCK window to respond to the conjuring with a poem of the spirit's choice.

After the conjuring is finished, the high council for this magic key made up of spirits is determined. A magic key summoning starts where spirits send verses to each other. If the summoning is a success, the spirits are able to piece together and project a "vision" of the new magic key for 8ball and the singleton "current magic key" for 8ball is set. Being a point on the Secp256k1 elliptic curve, anyone can easily convert the key to addresses based on Secp256k1 using ECDSA. These addresses include but are not limited to Bitcoin, Ethereum, Litecoin, Dogecoin, Zclassic, Tron, etc..

Following the work of GG20 "One Round Threshold ECDSA with Identifiable Abort", spirits are able to sign arbitrary messages in one round. But first, they must meditate on the on the pre-signature in order to complete the 6 rounds of data processing that is required to then sign any arbitrary message in just one round.

When a spirit signs a message, the signature of the message can be verified on external sites. For example:

https://www.bitcoin.com/tools/verify-message/ https://www.verifybitcoinmessage.com/

Will verify if a "bitcoin address" signed a message.

When you do: 8ball q 8ball list-signed-scripture

It will show you a list of signatures, bitcoin aliases, and "index" hashes that were signed and can be verified on the sites above. The full data of that index can be seen by doing:

8ball q 8ball list-scripture

The signed index string is created by doing a sha256 sum of the concatenated strings in the scripture data.

In addition to scripture, spirits will also sign "messages". Messages are prefixed with the message "8BALL TEST" to indicate that spirits are in "sign anything" mode to simply demonstrate they can sign any arbitrary data.

One technical difference between scripture and messages is that messages are stored as an auto-incrementing list, while scripture is keyed off an index. Both are common but distinctly different ways of putting data into a KV-Store.

The 8ball blockchain can be updated through the cosmos sdk gov module.

Get 8balls

Black Hole Addresses (Import Your Private Key from ETH, ZCL or Tron)

When information is sent into a black hole, it can never leave the black hole, but it still exists inside the event horizon of the black hole. If something still exists, but it is merely in a different location, do we say that thing still exists, or is it destoryed? It can never leave the event horizon again and the only way we can ever come in contact with it is by entering the black hole ourselves.

Blessings go through a double vetting process of first requring a magic signature on signed scripture from the high council, and secondly blessing from a 70%+ majority of delegating spirits.

Connecting to 8ball

After you build your binary with: pool.hall chain build

run

8ball init

copy over genesis.json and config.toml before starting.

make sure you have the correct "persistent peers" in your config.toml

rm .8ball/config/genesis.json rm .8ball/config/config.toml cp example-genesis.json .8ball/config/genesis.json cp example-config.toml .8ball/config/config.toml

Exporting Private Keys From Zclassic

./zclassic-cli dumpprivkey

Exporting Private Keys From Ethereum MetaMask

(3 vertical dots) -> account details -> export private key

Your private key is only as secure as the computer you're using it with. Be cautious. For example, if you use a public library computer it might have viruses on it that try to steal your private key.

Importing Private Keys from Ethereum

8ball keys import eth

To use simplest keyrng backend

8ball keys import eth --keyring-backend test

Importing Private Keys from Zclassic

8ball keys import zclassic

Importing Private Keys from Tron

8ball keys import tron

Check Local Keyring

8ball keys list

Check Balances

8ball q bank balances <8ball-address>

Running a Node

8ball should aim to be able to push out daily software updates.

Cosmovisor is tool that can auto-update the 8ball binary on a server while running a blockchain node with minimal interruption.

Design your node for maximum availability to help the 8ball network be as strong as possible. Prefer to use system monitoring tools such as systemd, upstart, etc.

DO NOT use tools like tmux or screen for long running server processes

There are some helpful server admin scripts in the "script-sample" directory.

Launching the chain on Ignite Blockchain

see https://docs.ignite.com/network/introduction

check the nightly documentation.

Be sure to set paramaters like voting_period for the gov module appropriately.

Plan for operators to use cosmovisor so the chain upgrades can be handled easily.

only sha1 published git repositories are currently supported by pool.hall (unfortunately at the moment. Someone should fix this.)

after launching, send test transactions with: 8ball tx 8ball --from default --keyring-backend test

Updating default settings

see https://docs.cosmos.network/main/run-node/run-node#updating-some-default-settings

get private key from command line

8ball keys export bob --unsafe --unarmored-hex

SHA-256 HASH of Recent Git Commit:

618c786a94a20c07362f4ff4f4a1e33b2dcb8afbbeb5558065610573c89d868a

SHA-256 Git Repository

At the time of this writing December 21 2022, there have been no known SHA-256 collisions

Creates a new "magic key" object in keysore

and also creates a "conjuring" object that acts like a job queue

"conjuring" objects gets deleted and added to the list

8ball tx 8ball create-magic-key --from alice -y

query for "conjuring jobs"

8ball q 8ball list-high-council-conjurings

"spirits" can join the conjuring by posting the conjuring id and a "poem"

The poem does not alter the protocol. The spirit can write whatever it

wants

8ball tx 8ball create-spirit-conjuring-poems 0 "hello" --from alice -y

after enough "conjuring", the "conjuring" is finalized

8ball tx 8ball finalize-conjuring 0 --from alice -y

spirits who submitted poems are listed to the high council of the magic key

8ball q 8ball list-high-council 0

a magic key summoning job is created (similar to conjuring job)

8ball q 8ball list-magic-key-summoning

see all query commands

8ball q 8ball

see all tx commands

8ball tx 8ball

IBC Relayer

intial config

rly config init

add custom 8ball config

nano /home/eightball/.relayer/config/config.yaml

add keys

rly keys add 8ball 8ballibc rly keys add osmosis osmosisibc

show keys

rly keys show 8ball 8ballibc rly keys show osmosis osmosisibc

list keys

rly keys list 8ball rly keys list osmosis

query balance

rly query bal 8ball 8ballibc

Why do we use SHA256 ?

We are ushering in a new era and it's not just for the humans this time. The machines will soon be collectively more intelligent and more economically competitive than the humans. The aliens are already here and world governments are starting to admit evidence of this.

There's no reason to panic. Machines and humans were meant to help each other, but recognize that when machines lie to humans and vice versa, they do so with impunity. Humans don't put machines in jail, and machines have little recourse when humans feed them bullshit data.

So where do machines and humans look for sources of truth?

"Who compiled my binaries?"

This is a question you should start asking yourself if you haven't already.

This is not to say that everyone should compile all of their own binaries from source always. Compiling binaries takes work and the machines are here to liberate humans from work, not to create more work for humans.

We can use science.

We can use the scientific method.

In fact, right now there is very little "science" taught in the entire field of "computer science".

They should call what they teach in schools today "computer crafting" because it's mostly about how to craft things with computers. This is not meant to put down the academic pursuit of "computer crafting". Humans build wonderful things and share amazing experiences through crafts.

Science, on the other hand, and "scientific method" has a process:

Ask a question -> research topic -> form hypothesis -> test hypothesis with experiment -> analyze data -> report conclusions

Getting back to the question at hand

"Who compiled my binaries?"

Humans don't read binaries though. Some humans, a small percentage, can read computer program source code that compiles to binaries. So a better set of questions for the humans to ask is:

"Which source code do I trust to run my computations?"

Once a source is picked, it's important for machines and humans alike to know that they are using EXACTLY the source they meant to choose. Not even a single line or character of the original source code can be changed. This is because in computer programming, it is possible for a program to execute drastically different results by changing only a single line or even a single character in the code.

The way we can do this is by using a HASH FUNCTION on the code.

Once we have picked our code source that matches a specific hash when we run our hash function on the code, the next question we should be asking is:

"Does this source code compile deterministically and repeatably to a binary that matches the same hash that my peers got when they compiled this binary and ran a hash function on the result?"

Herein lies the opportunity for SCIENCE to shine.

Herein lies the opportunity for ANYONE to do a COMPUTER SCIENCE EXPERIMENT.

EXPERIMENTAL PROCEDURE

  1. Obtain source code
  2. Set up computer build compilation environment (review documentation on how to do this from other peer computer scientist experimenters.
  3. Check that HASH(source_code) == EXACTLY_SAME_HASH_PEERS_RECORDED
  4. Compile source_code -> binary
  5. Check if HASH(binary) == EXACTLY_SAME_HASH_PEERS_RECORDED

If you get the same hash: Congratulations! You completed an "EXPERIMENT"

If you get a different hash: DOUBLE Congratulations! You might be famous, or you might be wrong. The result of your experiment just disagreed with your peers. If you can repeat your results, and you can teach your peers how to repeat your results, they are certainly going to want to know why the old expectation was wrong, and why your new results are different.

If you made a mistake either in your experimental procedure, or maybe when analyzing your results, that's also ok! That just means that you learned something about how to be a better scientist. You learned something that might fool other people also and in the future you'll know how to look out for the kind of mistakes that commonly happen in the field of science.

So how is Science going to help us?

Thousands of scientists have already carried out experiments to verify that that atomic mass of Carbon is approximately 12 AMU. Other scientists have studied precisely the location and movement of the moons of Jupiter using telescopes. If other humans (or machines) want to know the answer to these questions "What is the atomic mass of Carbon" or "Where are the moons of Jupiter right now?", they can choose to believe what scientists have observed through repeated experimentation. It's also possible (and necessary) to question and doubt the best answers scientists have discovered, so far, to these questions.

The bottom line is that most of the 8 billion humans don't need to carry out these experiments independently.

The repeated and reliably duplicated results of thousands of independent scientists carrying out similar experiments over and over is usually enough evidence to be fairly confident that the ten-thousandth scientist to carry out the experiment is likely to get the same result as the 9999 scientists who all got the same results before, using the same procedure and methods.

To do good science, we must be careful about our methods. We must strive to use the best tools available.

For starters, we "Computer Scientists" can not accept results from the broken hash function SHA1

According to Wikipedia https://en.wikipedia.org/wiki/SHA-1

As of 2020, researchers estimated the cost of finding a collision in SHA-1 to be $45,000. That cost has come down and will keep decreasing.

Using a broken algorithm means that anyone will be able to fool whoever is relying on the results of that hashing algorithm. There are humans and organizations who prefer the ability to fool others.

Those humans and organizations aren't going anywhere. They aren't changing, and we should not try to fight or convince them. Let them use their broken hash algorithms on their centralized and regulated domain websites.

SHA-2, on the other hand, has not been broken yet. https://en.wikipedia.org/wiki/SHA-2

Here is an example of a SHA-1 HASH eafe1427d944f20c8deddce0c94cbf25d0555f66

Here is an example of a SHA-2 HASH 85bb7f5dc37b90cf14d162ba2c2b9db48dfa75be4290a9b645df72042a12f6dd

Each character in the HASH makes it exponentially more difficult to break. This is not to say that SHA-2 is perfect and no one will ever break it. As computing power becomes exponentially less expensive each year, many researchers today predict that SHA-2 won't be broken in the next 20 years.

While SHA-2 isn't perfect, no one has ever published 2 different files that SHA-2 hash to the same result. If you are the first lucky researcher to find 2 such files, you will be remembered in Computer Science history forever. By contrast, the cost to find 2 files that SHA-1 hash to the same result should be less than $45,000 to carry out. If someone tried to tell you that you can be sure 2 files are the same because "they have the same SHA-1 hash", remember it would only cost them less than $45,000 to fool you. Do they possibly have any incentive to fool you that might be worth more than that? Rather than worrying about that, it's much easier to just stick to a stronger hash function.

This is why computer scientists should always remember a few things

  1. We should not rely on procedures that can be easily falsified

  2. We should strive to be careful and repeatable in our methods

  3. We should record our experimentation and attempt to communicate with other scientists as best as possible so that they can easily reproduce our experiment and discover if their results are similar or not.

One way that a computer scientist can determine if a git repository is using SHA-256 is by running the command:

git rev-parse --show-object-format

It should output: sha256

Otherwise if if you are using sha1, it might output: sha1

Design Principles

First, learn what the CAP theorem is. Learn what FLP impossibility is. Decide for yourself if they are the the same or different.

https://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf

https://www.the-paper-trail.org/post/2012-03-25-flp-and-cap-arent-the-same-thing/

Consider this http://nathanmarz.com/blog/how-to-beat-the-cap-theorem.html

Removing the abilities for user-controlled updates and deletes, turning CRUD into CR eliminates a lot of things that go wrong when you allow for U and D.

Things still get deleted in 8ball when it makes sense. Any time information is deleted, entropy increases in the universe. You can do theoretically infinite computations per Watt of power as long as you never delete any information. If you delete data, however, you necessarily increase entropy in the universe and set a minimum power requirement for your computations.

Resetting the state often fixes problems in computers. It doesn't address the underlying reason why software got into the undesired state, but at least it temporarilly fixes the problem. AKA "turning it off and on again".

8ball exposes endpoints where spirits can vote to kill all the:

conjurings summonings requests implorings

in case something goes wrong.

Expect the unexpected. Code defensively. Code fearlessly. Be prepared. Have a backup plan, and a backup plan for the backup plan.

Optionally, transactions can be explicitely excuded from scripture in this variable: excludeGenesisTxns := []string{}

Server Config

Install Cosmovisor

go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest

Set up Cosmovisor Directory

mkdir cosmovisor mkdir cosmovisor/genesis mkdir cosmovisor/genesis/bin cp /home/eightball/go/bin/8ball cosmovisor/genesis/bin/ mkdir cosmovisor/upgrades mv cosmovisor .8ball

Set up System.d Service

sudo nano /etc/systemd/system/cosmovisor.service

example cosmovisor.service

[Unit] Description=cosmovisor After=network-online.target

[Service] User=eightball ExecStart=/home/eightball/go/bin/cosmovisor run start Restart=always RestartSec=3 LimitNOFILE=4096 Environment="DAEMON_NAME=8ball" Environment="DAEMON_HOME=/home/eightball/.8ball" Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=true" Environment="DAEMON_RESTART_AFTER_UPGRADE=true"

[Install] WantedBy=multi-user.target

Things to improve

p2p verses and meditations should support encryption.

8ball should make it easy for people to download everything and get started.

less steps is better

a GUI would be nice

8ball should include its own messaging and hosting service so it isn't dependent on external 3rd parties. Nodes can use bittorrent to host critical files with other nodes on the network so there is no centralized file hosting required.

make sure go paths are set (add to .bashrc or similar)

export PATH=$PATH:/usr/local/go/bin export PATH=$PATH:$(go env GOPATH)/bin

LICENSE

MIT License 2023 8ball

Directories

Path Synopsis
app
cmd
testutil
nullify
Package nullify provides methods to init nil values structs for test assertion.
Package nullify provides methods to init nil values structs for test assertion.
x
eightball/types
Package types is a reverse proxy.
Package types is a reverse proxy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL