Digital🛢- Will you strike digital oil? — Issue #4 — Oil Strike #1: Task #2

DigitalOil.nftr
6 min readMar 4, 2022

Digital🛢(oil) is a brand-new scavenger hunt newsletter that pays you to learn about blockchains. At the end of the month you’re eligible to strike digital oil ($500 paid in USDC) if you complete all checkpoints. Solve quick (2–3 min) and simple (easy) tasks that arrive in your inbox weekly, designed to teach you how to interact with blockchains. A smart contract will select one eligible address at random every month and will send $500 in USDC to the winning address.

Your First Self-custody Crypto

From what I could tell from who clicked on the download link, at least 8 of you didn’t have Metamask before. Which likely means that if you had crypto it was custodial, meaning that you delegated custody of your account keys to Coinbase, Binance, etc. Before you downloaded Metamask, you “had” crypto but you didn’t really control it. You had it just like you have fiat currency, meaning you see your account balance, but you don’t really control it or know for sure if it’s really there or not behind the online banking site. With Metamask, you can now have direct control of the coins that owned by the account you created.

This issue comes to your inbox with good news, anons! If you are one of the 18 people who submitted an account address, you now have 1 free MATIC there. But before you go check, first a quick primer on Polygon and MATIC.

Polygon

The first smart contract blockchain was Ethereum. For this and other reasons, it’s my favorite. However, transacting on Ethereum only makes sense for high value transactions. Ethereum is also used by other (cheaper) blockchains to settle a synthesis of the transactions that occur on them, thus diluting the cost of transacting on Ethereum among many transactions (more on this in later issues).

Polygon is one of these alternative blockchains. It functions very similar to Ethereum. Thus for developers and for users the transition between the two is seamless.

MATIC

Matic serves exactly the same purpose on Polygon that Ether does on Ethereum. That is, it serves as the gas that makes the blockchain gears turn. More precisely, blockchains require servers (nodes) to do some work behind the scenes. There are people and costs behind those servers. Every time you make a transaction on the blockchain you are asking servers to record your transaction, and this has a cost. This cost is paid in gas. The Matic you have in your account is how you will pay for gas every time you do one of the tasks I assign.

If you are one of the 18 people that sent their address, you can participate in the scavenger hunt and compete for $500. The 18 addresses have been whitelisted into the “tell a joke” smart contract that I designed and launched for this purpose. So even if you have access to Matic elsewhere, if you weren’t whitelisted, you’ll have to wait until the next Oil Strike (scavenger hunt), which I will send out once we’re done with this one. Whitelisting was done to promote fairness and avoid people from competing using multiple addresses.

Separating the Grownups from the Children

Although every task I assign is extremely simple and should only take 1–2 mins, this is where the grownups will be separated from the children. Will you continue along this scavenger hunt, completing this and the next two tasks and compete for the $500? I hope you all do.

By the way, the $500 are already inside the smart contract, and the smart contract is programmed to automatically send the $500 in USDC to the winning account. This is part of the magic of blockchains.

$500 USDC balance showing in our smart contract

Set Metamask to Polygon

The first thing you’ll need to do is change the blockchain you are connected to. Metamask connects to Ethereum by default, so you’ll need to add Polygon to it.

Go to polygonscan.com and click the button at the bottom the page that says Add Polygon Network.

That will pop open the Metamask plugin. Click on Approve. Then, click on Switch Network. Since the Metamask account you created on Ethereum can also be used on Polygon, if you open Metamask again, you’ll see that you have 1 Matic in your wallet 👏.

Submit your Joke to the Smart Contract

Now you’re ready to submit a joke to the smart contract. To do so, we’ll be using a tool called Polygonscan. Polygonscan is a website that scans for all smart contracts on Polygon and all interactions of accounts with the blockchain. This means that every time you send funds from your account to another and every time you transact with a smart contract (an app), Polygonscan records it. On their site you can explore every detail of every transaction in the history of the blockchain. To view our smart contract interface on Polygonscan, go here. There, you will see something similar to this:

Now, click on where it says Connect to Web3, and then click on Metamask. Then click on the Next button. And then Connect. Once you do so, you’ll see that your account has been connected:

Now you’re ready to submit your joke to the contract. Scroll down the form to the 7th section called submitJoke:

Now, enter your best joke and click on Write. Your Metamask will pop open. Wait for the Confirm button to turn blue and then click on it.

Congrats 🎉, you just did your (possibly) first transaction with a blockchain. Your interaction changed the state of it forever. Plus, you just completed your second task in this first Oil Strike.

Some Bonus Content For the Nerd in You

So, what just happened? Your Metamask Wallet contains a key. That key is private to you. It was generated by Metamask and nobody else can ever see it. That key corresponds to an account (or public address) which is kind of like your id or pseudonym for the blockchain.

When you pressed Confirm, your key was digitally signing a transaction, and that transaction was being sent to the blockchain network. The transaction said something like: Please tell the Digital Oil Strike 1 “tell a joke” smart contract that this is my joke.

The contract is an app that I coded and submitted to Polygon. It and every interaction with it will be recorded there forever. That is why the button you pressed before Confirm is called Write. You are writing new information to the blockchain. Nobody (not even me) can modify the code, so all the rules and conditions I set when I designed it, are fixed. If you want to see the code (in a language called Solidity), click here. If you want to read the state of the smart contract (things like what jokes have been submitted), click here.

Users don’t usually interact with these apps through Polygonscan. Developers also develop websites or apps that can connect to the contract, providing a better experience.

And… Next Week’s Task

Next week’s task will be even easier. You’ll scan through all the jokes submitted, and vote for your favorite one. You won’t be able to vote for your own joke, and you won’t be able to vote if you didn’t submit a joke. Meaning, you won’t be able to complete the third task if you didn’t complete the second one. This is hardcoded into the contract — and you know what they say — in blockchains, Code is Law. Also, since all the code is immutable, nobody can cheat who wins the funniest joke vote. Not even me. Don’t worry, though — the funniest joke winner doesn’t win the $500. The prize winner will be determined by a raffle that executes within the contract. All of you who submitted a joke, voted, and then entered the raffle, have a chance to win.

Until next week.

Cheers,

Adam

--

--

DigitalOil.nftr

Early. Ethereum dev and founder @nft_registry . Podcast host @0xCryptoLatinos . Business director. Former ios dev & satcom engineer. @GeorgiaTech ee & @mit