The Penny Oracle on Theta

The Penny Oracle for Tfuel is now auto-updated. When the price changes more then 3% over 4 hours, the blockchain gets updated.

Been wanting to write this update for a long time. The Penny Oracle that I launched on the Theta blockchain is now auto-updated. In other words, I no longer have to manually update the price for minting any of my NFTs in any of my projects. This automation is a huge psychological win for me. Kinda makes me feel like the code is actually doing something useful.

Note that all the projects that use the Selene Network (distributed sales network) NFT functionality use a Penny Oracle. And, in order for a creator to stay in charge of their project pricing, they would either launch their own, or use a trusted Penny Oracle. If they use my official one, the price is kept current (automagically).

What is a Penny Oracle?

The Penny Oracle provides the amount of Wei that represents a penny’s worth of Tfuel.

Why is it useful?

People that visit my projects think in dollar terms. The Penny Oracle is used by the smart contracts so that they have a current ‘close enough’ representation of the amount of tfuel that it takes to buy their NFT.

By having a relatively accurate price for my NFTs, the value exchange that I’m looking for can be stated in dollar terms rather than Tfuel Wei.

How does this magic work?

The first step comes from a little program that makes API calls to a number of different exchanges that allow for the trading of different Tfuel pairs. From that, the software determines the average price at that current moment. If the code determines that the price has change enough, (three percent from the previous recorded price,) it signs a transaction and posts it to the block chain.

How can you view this?

Well, here is the contract address for the Penny Oracle Version 1:

0x945c5b985a0d4ba6c42a88c1330bded9cd442389

If you look at it’s transactions, you can see that the automation has just recently started. Each time the smart contract is updated, the price averaging code sends the current dollar price of Tfuel and the Wei that represents a penny’s worth of Tfuel.

If you want to view the values that are reported by the smart contract, you can do so by visiting the Interact with a Smart Contract page on ThetaScan.io and use the following ABI to go with the contract address above.

ABI:

[{“inputs”: [],”name”: “pennyPriceTfuel”,”outputs”: [{“internalType”: “uint256″,”name”: “_pennyTfuelWei”,”type”: “uint256”},{“internalType”: “string”,”name”: “_priceOfTfuel”,”type”: “string”}],”stateMutability”: “view”,”type”: “function”}]

When you read this function (pennyPriceTfuel) you’ll see that it returns two items: _pennyTfuelWei and _priceOfTfuel.

How robust is this?

Would like to say that it’s failsafe, but nothing is.

In order for the Penny Oracle to get updated, the software on my machine has to run. With means, if the power grid goes down for me, the Penny Oracle will still report the older update.

The current design limits the number of updates to no more than 1 time every four hours and only if the price has moved more than 3% from the last recorded time. Simulation testing has shown that on average, the price will get updated about every 14 hours.

It shouldn’t take long before there will be enough transactions on chain to confirm this average update period.

The best news is that I’m motivated to make sure that this Penny Oracle stays current for the price it reports is what all my projects use.

What’s next?

Now that this automation is running, it’s time to refocus on smart contract functionality. It’s time to have a little fun with things. 

The DRM Anything NewFunctionaliTee

A while ago, I was asked to create the framework that would allow someone to hide a document on a server and then only allow access to someone that proved they owned a particular NFT. Likewise, provide functionality that downloads a file to the user machine after it passes the signature and if it holds an NFT of the given project.

Well, I have a demo and it is called the DRM Anything NFT.

I’ve updated this code again, so now not only does it present a link and download a file, but it also allows the ‘unlocking’ of a unlisted video on YouTube.

And yes, we both know that the content that is being delivered can be copied and shared. Most content online can be. What this demonstrates is that the server will only share this content with website visitors that demonstrate that they own an NFT in the project and that they are the owners of the wallet that holds the NFT.

Mint: DRM Anything NFT

Feel free to follow the link so as to see the project metadata and read the whitepaper. If you have questions about that, let me know. You’ll need to visit the links from a device (or system) that has MetaMask installed and inside MetaMask, connect to my website. Once you do, the website will be able to talk to the smart contracts that are currently live on the Theta blockchain.

More Info

Not only does this NFT support basic Distributed Selene Network (dsn) functionality (which offers sales commissions to sales agents and allows for common minting) but it uses the new infrastructure that I added which can be used to validate signatures.

The NewFunctionaliTee is the Instant Access button. If the visitor does not own the project NFT, the Instant Access button will be disabled. Once minted, the button is enabled. When it’s clicked, MetaMask is launched so as to sign a message that can be decoded on the server. The message is the timestamp and smart contract address.

When MetaMask returns the signature, the client browser sends that information to the server so it can be decoded and validated. When the info is found to be valid, the server validates that the signing address actually holds a non-zero balance in the project.

After all this checks out, the server returns the hidden information and it’s displayed to the visitor next to the Instant Access button.

What are the dependencies?

The good news is that the code that performs this work is all in the dsn core files. This means that the entire system (dsn) can be easily installed on just about any server.

The bad news is that there is no built-in database functionality with this NFT. This means that the file that provides the secret will need to be edited to change the prize.

What’s next?

Well, I’d kinda like to see this code evolve so that it could be modified using WordPress on the backend. Ultimately, the artist should be able to make simple modifications to their database and the signing process unlocks a database searchable list of secrets.

The classic example would be to sell an NFT that works as a membership ticket. The NFT has a lifespan and the owner uses it to unlock private content.

Let me know what you think.

A Theta Hackathon project – Selene Network

Today, I officially entered the blockchain based distributed sales network(dsn) in the Theta Hackathon as the SeleneNet project. I’m going to call is SelNet for short.

Here is a link: https://devpost.com/software/amorstyle-distributed-sales-network-selnet

If you missed my previous blog post, this dsn is flexible opt-in sales system that empowers creators to incentivize sales through influencers bypassing standard centralized marketing approaches.

In this system, creators determine the sales commission and influencers determine if it is worth talking about. Settlement happens at the time of minting and as long as the sales goals are met, there is no restriction on capturing the rewards.  

In really simple terms, if you are an influencer and you like talking about cool NFT projects, this is a way to get paid if people mint based on your endorsement as long as the NFT project build to this protocol.

Support my work!

In order to show off how it works, I created a time limited mintable NFT that can be minted throughout the Hackathon (last mintable block number: 26243000 ). This NFT pays 50% of the mint Tfuel to any Agent that makes the sale. It also pays 5% to any website that offers access to the network.

To qualify for this commission, you have to get registered as an Agent or a website. If you want to build a sales force, you mint an Agent NFT. If you just want to endorse projects and capture the commission, you need to find someone that is willing to register your MetaMask compatible Theta Network address into the Agent system.

To learn more about becoming an Agent, check out the Agent information that I’ve linked too on my website.

Agent project overview

If you have a server and you want to provide access to SeleneNet compatible NFT contracts, talk to me about getting a Website NFT.

Website project overview

Mint: Hack it 2024

Second NFT in project

I’ve added a second Selene Network compatible NFT to the project. This one is a NFT that demonstrates how to display secret information after signature verification. In this case, the server protects a file and once the signature validation has occurred, the user is presented with a link to the document.

To read the whitepaper or get a better understanding for what it offers, visit the minting link.

Mint: DRM Anything NFT

I want to support you!

The other part about this project is that it needs people to build and deploy projects that are SeleneNet compatible. For most people, this can be technically challenging or, even worse, daunting. I’m here to help simplify this. The infrastructure that I’ve created takes a lot of the complexity out of the process.

If you already know that creating a simple NFT is something that you need, pitch me your idea and I can help you realize the benefits of this decentralized sales network infrastructure.

If you are an influencer, getting setup as an Agent is another option. Nothing better than getting paid to talk about things that you already love.

Minimum requirements

It should be obvious, but the smart contracts and NFTs are all built on the Theta blockchain and require that anyone interacting with the network use MetaMask. It’s pretty easy to setup, search for the official MetaMask website and download the browser extension that works for you.

Once you install, you’ll need to make your MetaMask wallet Theta blockchain aware. After doing that, you’ll need to acquire some Tfuel, most likely through a decentralized exchange.

Unfortunately, when it comes to using the technology, the customer has to show this basic level of technical understanding. This is one of the reasons why the network checks for the Participant NFT in the connecting wallet. The thinking is, if the customer can’t get this far, they will not be able to use the NFT as designed by the creator.

The good news is that MetaMask currently have over a million customers and they are working to solve that onboarding issue. As they solve that issue, more customers will be available to use the network.

What’s Next?

If participating in a network like this appeals to you, feel free to contact me. Best way is via my twitter handle: @AmorStyleYoga.

If you’re an influencer and you love the Theta blockchain or NFT projects on the Theta blockchain, let the creators know that this network is available so they can drive sales through the people that teach people about the projects. It’s an Opt-In system!