Open deployment ceremony for Circles v2

Circles v2: Open Community Deployment Ceremony

Hey Circles!

We’re about to launch Circles v2, and we want everyone to be part of it. So, we’re turning the deployment into an open ceremony where anyone can join in.

How to Join the Ceremony (overview)

  1. Check out the deployment instructions in the README. More details below too.
  2. Deploy the rc-v1.0.0-beta (commit bb1ed9a) contracts to Gnosis Chain (with the script).
  3. Share your deployment details in this HackMD file - there is no login required, so please play nice :smiling_face:
  4. You can join in with your name or stay anonymous - up to you!

Picking the “Official” Deployment

[UPDATE]: if people want to search for a vanity address for Hub.sol that is for sure appreciated, so if you have some compute power idle this weekend, please give it a try. A great vanity address will take precedence over the random selection (yes this will be a bit subjective, but unlikely to cause a dispute as it’s not so easy to find more than 6 characters). Failing to find a good vanity address we can fall back to the random selection of the original ceremony. Open deployment ceremony for Circles v2 - #5 by Ben

We’ll choose one deployment to be the official one. We’ll do this by looking at all the (correctly deployed) Hub.sol addresses and picking the one “closest” to a the first Gnosis Chain block hash on Monday morning (14 October 2024 00:00:01 UTC). This way we ensure picking a verifiably random community deployment. Again, more details below.

So please, if you want to participate you should do so from now, till latest Sunday. We understand that this is a small window, but Circles’ 4th anniversary is coming up on Tuesday 15 October, so we want to have all our ducks in order by then. Thanks for understanding :smiling_face:.

Come Be Part of It

Whether you’re into coding or just curious about how this works, you’re welcome to join in. This is a chance for all of us to launch Circles v2 together.

Got questions? Just ask here in the thread.

Thanks for being part of Circles all these years (or newly joined) !
About Circles ambassadors team


Now some more detailed instructions on how to contribute your deployment

You will need:

  • A computer with some software installed (js/node, forge, git)
  • A private key with some (less than 1) XDAI on Gnosis Chain mainnet. If you want to remain anonymous, consider whether this account has been linked to you in the past (indirectly).

We’ll summarize the relevant steps that are also in the README file.

Step 1: Set Up Your Environment

  1. Install Foundry if you haven’t already.
  2. Clone the repository:
    git clone https://github.com/aboutcircles/circles-contracts-v2
    cd circles-contracts-v2
    
  3. Checkout the specific commit:
    git checkout rc-v1.0.0-beta
    
  4. Install dependencies:
    forge install
    
  5. Already build and test the code
    forge build
    forge test
    

Step 2: Prepare for Deployment

  1. Copy .env.example to .env:
    cp .env.example .env
    
  2. Edit .env and set your private key. Make sure this account has some XDAI for gas fees. Specifically you only need to fill in your private key in that file:
    PRIVATE_KEY_GNOSIS=<YOUR_KEY_HERE>
    

Step 3: Deploy the Contracts

  1. Run the deployment script for Gnosis Chain mainnet - CORRECTION: also run npm install:
    cd script/deployments/
    npm install
    gnosisChainDeploy.sh
    
  2. The script will generate text files with deployment information. These files will be in a new directory:
    script/deployments/gnosischain-rc-1.0.0-beta-bb1ed9a-<day>-<time>/
    

Step 4: Report Your Deployment

  1. Go to the HackMD file we’ve set up for the ceremony. No login is required, so you can access this shared notebook anonymously.
  2. Copy the content of the two important text files generated during deployment from the deployment folder (see above). Specifically you want to share the content of:
    • gnosischain-artefacts-<identifier>.txt with verification data for each deployed contract
    • and gnosischain-<identifier>.log with a better human-readable summary of the deployment
  3. Append this information into the HackMD file, respecting the other content already there.
  4. If you wish, you can add a nickname or stay anonymous. No need to write more, we just need a list of deployed addresses to make our life easier.

Step 5: Verification

As soon as a first deployment is reported, we’ll make sure it is verified, and then all following deployments should automatically get recognised by gnosisscan.io or gnosis.blockscout.com as well.

Important Technical Notes

  • The deployment we’ll use will be chosen based on the Hub.sol address closest to the first Gnosis Chain block hash on Monday, October 14, 2024, at 00:00:01 UTC. (Closest will be determined as the Kademlia XOR “randomised distance”)
  • Make sure your deployment is complete and correct. Only valid deployments will be considered.
  • If you encounter any issues or have questions during the process, please ask in this thread. We’re here to help! Or connect over telegram @about_circles

Thank you for participating in our open deployment ceremony for Circles. Your involvement helps ensure a continued open community of people building Circles together!

3 Likes

Thank you @Ben! Will contribute to the ceremony!

I like your proposed strategy of defining a canonical version.
An alternative way we could pick one would be: Implicitly there is a “magic number” in Circles: 120804.563587458981178828
This is the number of Circles all humans would eventually hold if they would just mint Circles forever. They would end up at this number regardless if they start at 0 or if they start at 100 billion CRC. It is simply the number where demurrage and new CRC issuance equal out.

So we could alternatively pick the “hub” contract that is has the smallest difference to 0x1208045635…

I guess to deliberately come close to this number it would be good to know in the deploy script - how many contracts get deployed before the hub contract? As the address is determined by deployer address + number of contracts already deployed by that address.

2 Likes

sounds like a great idea. If we see (on chain) that someone tried to brute-force their luck, we can still socially decide to fall back to the pure random selection!

you would either need to rewrite the script to use create2, then you can brute force the salt offline; otherwise using the original create the address will depend on your actual tx nonce, so you’d have to spam the network; or search through private key space instead.

I think it’s reasonably tamper-proof to go with your proposal! So I’m all for using this technical step to help tell the story!

Hey all!

So I had misunderstood @martin_koeppelmann 's suggestion: if someone can find a great vanity address for Hub.sol then that will take precedence over the random selection! It would be great to have a recognizable address for Hub.sol :sunglasses:

As a technical note: the deployment script will first deploy Hub.sol. So if it is a new deployer address nonce 0 (or nonce 1 if you first want to test the address) will be used for the deployment of Hub.sol. So you can crawl the private key space on your machines to find a deployer key that will deploy Hub.sol under a fitting vanity address.

One repository you can use for this search is: GitHub - TaoistWorld/Vanity-ETH-Contract-Address-Generator: Create billions ERC20 addresses, find vanity wallet addresses you want or any wallet address can deploy a vanity ERC20 contract address at given nonce

Feel free to be creative.

  • One suggestion already made by Martin is trying to get as close as possible to the max-supply number 120804.563587458981178828 CRC, so starting with 0x120804(56)... would a great address
  • 0xC12C1E5… could also be nice

note that 6 matching characters is already a non-trivial compute challenge, depending on your available compute power and search time

2 Likes

While I certainly like the hidden message of 120804.56… 0xC12C1E5 looks pretty nice and is certainly easier to recognize.

on gnosisscan.io it displays in the transactions list to/from addresses with 0x[8char]…[9char]

so it would be nice to find a 0xc12c1e5*..********* where after the five it’s a nice closing char

maybe these are my favs
0xc12c1e50..*********
0xc12c1e52..*********
0xc12c1e5c..*********
0xc12c1e5f..*********

(on blockscout it formats 0x**..****, so we can ignore that)

1 Like

Hey all, here’s a small update to the install steps above to install the required node modules:

Step 3: Deploy the Contracts

  1. cd to script/deployments/ and run npm install to install the required modules.

Now continue with the original instructions:

  1. Run the deployment script for Gnosis Chain mainnet (a small change here as we’re already in the correct directory):
./gnosisChainDeploy.sh
  1. The script will generate text files with deployment information. These files will be in a new directory:
script/deployments/gnosischain-rc-1.0.0-beta-bb1ed9a-<day>-<time>/
2 Likes

I updated the main post and the README on github as well now, thanks Shorn

1 Like

I was able to do a deployment and added it to the list:

Hub: 0xc12C7E5a035da17c20Bb196C0fBeF57012f55D9b

Tip for those trying - potentially you might need to slightly increase the
–priority-gas-price 1200000000
But if you increase it too much the script will fail as the overall tx costs are hardcoded to be at max 2 GWEI (base fee + priority fee)

2 Likes

We have some nice vanity addresses already (gnosisscan shows the first 8 char - and last 9, so for vanity addresses these are most visible, front preferred imo) :

note “Circles” in best “hex” could be seen as “c12c1e5” (with a 2 looking like an R if you squint :slight_smile: )

  • “Kalahari Kindness” with 0xc12c1e5C..57b3 and
  • “Human of Circles” 0xc12C1E50..13e8

With the note that we should still thoroughly assert that all these reported deployments are correct and not tampered with (which we’ll undertake) - I want to nominate these two as our front-runners - but please disagree and discuss here.

I’ll also start with casting a first vote for “Human of Circles” (if verified to be valid), because the vanity 0 is better than the vanity “c” after Circles (imo).


if people think that we should stick to the original random selection, also feel free to raise your voice here - this is all open for discussion

3 Likes

For those trying to generate a nice address for the “Hub” contract (the most important contract of Circles)

You can run:
vanitye --contract --pattern c12c1e5 C12C7e5 --nonce 0 --allowNonce0 --cpu 8
(of course you can also do different “pattern”)

This will generate a private key like this:
VanityScore=10 Nonce=0 ContractAddr=0xc12c1e5385b013fdad156672de11a9061734713d WalletAddr=0xef19fa43644668fd05bbcb2fcae3a256646ee8e7 PrivateKey=98b616fa9cd70833b296c7a907fb4a2e5e72b6cc0d8b498d46989bc078d1cffb

If you past in that privateKey into the deploy script (and fund it with ~1xDAI) the first contract (the Hub) will get the address: “0xc12c1e5385b013fdad156672de11a9061734713d”

2 Likes

I managed to get another vanity entry in with a zero after the 5:
Hub: 0xc12c1E5065667fCF5485808bfbff589a64339492

It’s in the hackMD at this point: Link to Entry in hackMD

:slight_smile:

(adding an edit - time stamp looks like Oct. 13th at 23:43 UTC, if we’re using the timestamp. Hash link here)

2 Likes

I ran @martin_koeppelmann vanitye command for a few hours and got an interesting address out of it for the hub 0xc12c7E5d02Ec9Cc4Ab6c2DCD2E8e8B2ef6fF7D1E that I was able to run the deployment on then added to the hackMD, even if it’s really last second :sweat_smile: It feels much better that way than participating to the deployment with a “random” address like I had done right before.

2 Likes

Thanks everyone for participating.

From what I can tell we now have 3 addresses that start with “0xCircles0”

It is:
“Human of Circles”:
0xc12C1E50ABB450d6205Ea2C3Fa861b3B834d13e8

“5pence”
0xc12c1E5065667fCF5485808bfbff589a64339492

“hellno”
0xC12c1E5057c918F87B07524894619364E6F9A209

My suggestion would be to either randomly decide for one (@Ben blockhash lottery) or go with “hellno” for the reason that in the checksum notation the address starts with a capital C. What do people think?

2 Likes

Gm!

wow, first of all, thanks this was not expected to have so many people participate at short notice on a Sunday! Neither was it expected that so many people would crunch their computers for so many vanity addresses!

First as Martin shared, we have three 0xcircles0, and then 0xcircles(C, D, E). So I think it’s clear by raw (computing) effort that 0xcircles0 is the preferred vanity address.

And as we have three submissions for 0xcircles0, it’s again a mini-run off. One proposal to select “a fair community deployment” from these three front-runners, is that we can use the “Kademlia / XOR distance” of these three Hub addresses to Monday mornings’ first blockhash (as the original selection and fallback was). This is just a proposal at this point, so feel free to debate. If we opt for this, then we can also choose a soon blockhash after this discussion to reshuffle - which may be most fair after everyone has had a chance to weigh in.

Anyways, I used chatgpt to quickly draft this procedure, so you can review this here already (using Monday mornings’ first blockhash)

proposed selection algorithm:

def kademlia_distance(hex1: str, hex2: str) -> int:
    """Compute the XOR distance between two hexadecimal strings."""
    int1 = int(hex1, 16)
    int2 = int(hex2, 16)
    
    # Perform bitwise XOR
    xor_result = int1 ^ int2
    
    return xor_result

def sort_by_distance(hex_strings: list, fixed_hex: str):
    # Compute the distance for each hex string
    distances = [(h, kademlia_distance(h, fixed_hex)) for h in hex_strings]
    
    # Sort by distance
    sorted_distances = sorted(distances, key=lambda x: x[1])
    
    # Output the results
    return sorted_distances

# The 160-bit strings
hex_strings = [
    "0xc12C1E50ABB450d6205Ea2C3Fa861b3B834d13e8",
    "0xC12c1E5057c918F87B07524894619364E6F9A209",
    "0xc12c1E5065667fCF5485808bfbff589a64339492"
]

# The 256-bit fixed string
fixed_hex = "0x1a757a91dc34aa6ead8f4e28f4c1109ede71d3705b582606a3b69f4034a2b0ed"

# Run the function to sort and get the distances
sorted_distances = sort_by_distance(hex_strings, fixed_hex)
sorted_distances

output:

Result

[('0xc12C1E50ABB450d6205Ea2C3Fa861b3B834d13e8',
  11967701115180941850424656490481771403529971191459140282627079559655252271877),
 ('0xC12c1E5057c918F87B07524894619364E6F9A209',
 11967701115180941850424656490481771403556489709444268615567099146670393987812),
 ('0xc12c1E5065667fCF5485808bfbff589a64339492',
  11967701115180941850424656490481771403622114525037032843815967249833927976063)]
2 Likes

Great - lets do this! @Ben

Lets randomly select one of the 3 deployments and use your “distance script”.
Right now we have the block hight: 36498513

Lets use the hash of the block: 36499000 (that is in roughly 40 min)!

Looking forward to it!

3 Likes

10 minutes left!

Just to make it easy to follow for everyone:
We will take the blockchash

and past that into Bens script for the “fixed_hex” value. The first address that will show up in the “sorted_distances” will be the chosen one!

1 Like

If anyone wants to calculate this themselves (in ChatGPT for eg) you can use the following prompt to generate the result.

Be sure to include the hash for block 36499000 when it is available… in ~ 3 mins!


Prompt:

Using the script provided below, calculate the Kademlia distance between the blockhash and the candidates’ addresses to identify which of the candidates is closest to the given block hash.

The blockhash is: FILL THIS IN FROM THE EXPLORER

The 3 possible candidates are:

Human of Circles:
0xc12C1E50ABB450d6205Ea2C3Fa861b3B834d13e8 10:17

Hellno:
0xC12c1E5057c918F87B07524894619364E6F9A209 10:17

5pence.eth:
0xc12c1E5065667fCF5485808bfbff589a64339492


The script:

    """Compute the XOR distance between two hexadecimal strings."""
    int1 = int(hex1, 16)
    int2 = int(hex2, 16)
    
    # Perform bitwise XOR
    xor_result = int1 ^ int2
    
    return xor_result

def sort_by_distance(hex_strings: list, fixed_hex: str):
    # Compute the distance for each hex string
    distances = [(h, kademlia_distance(h, fixed_hex)) for h in hex_strings]
    
    # Sort by distance
    sorted_distances = sorted(distances, key=lambda x: x[1])
    
    # Output the results
    return sorted_distances

# The 160-bit strings
hex_strings = [
    "0xc12C1E50ABB450d6205Ea2C3Fa861b3B834d13e8",
    "0xC12c1E5057c918F87B07524894619364E6F9A209",
    "0xc12c1E5065667fCF5485808bfbff589a64339492"
]

# The 256-bit fixed string
fixed_hex = "0x1a757a91dc34aa6ead8f4e28f4c1109ede71d3705b582606a3b69f4034a2b0ed"

# Run the function to sort and get the distances
sorted_distances = sort_by_distance(hex_strings, fixed_hex)
sorted_distances
1 Like

I think we have a winner!!

The block hash is “0x4c0aa44dc1f3b182e345965d916ea2accdb7dce38fb1b42e08bd19c43d544695”

If I past this into Bens script I get:

So if anyone can confirm this we can select the “Human of Circles” deployment as the canonical address!

3 Likes