Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

XPD - Do more with your PerlMonks XP

by cavac (Parson)
on Apr 04, 2022 at 19:37 UTC ( [id://11142681]=CUFP: print w/replies, xml ) Need Help??

As some of you know, i have been playing around with the PerlMonks API to create my own fake internet money. Basically, it's a way to play around with NFT without actually wasting money on that stuff.

Presenting: XPD

XPD is the Perlmonks XP Derivative. It's sort of fake monopoly money for PerlMonks. Currently, it supports sending XPD between registered accounts, creating NFT and selling them on the market for a fixed price.

Edit: If you encounter a bug, post a reply to this post. I have fixed some bugs already, but there are probably more of them around.

Here is the link: https://cav.ac

FAQ:

Is is real (crypto) currency?
Nope. This is just a play thing for PerlMonks. Just as PM XP, it has no monetary value. But it's fun.

Is it blockchain?
Nope. Blockchains are slow and cumbersome. I use the age old model of central banking. E.g. it's a PostgreSQL database.

Is it a crypto currency?
Nope. I mean, i could add checksums and stuff, but what's the point? If you want to make sure i don't mess around, there is a public ledger will all transactions available. You could copy the data. It's currently a bit cumbersome, public API coming soon.

How do i earn XPD. Mining? Proof of Work?
Nope. XPD uses Proof of Monk.

Proof of Monk?????
XPD is linked to your account on PerlMonks. Be a nice person and help others on PM. This will earn you XP. And earned XP is added to your XPD account. Be naughty and loose XP, and XPD will be deducted.

How do i register an account?
Go to https://cav.ac/user/register. You will need a PM account with at least 500 XP, at least 30 posts and a XP-per-post average of at least 4. Fill in the form. Use a password you don't use anywhere else. If you have a password manager that can generate unique random passwords, use that. You username must match your PerlMonks username exactly, because that's how you earn XPD. For validation, you will also temporarily need to add a randomly generated text to your PM homenode.

How often is generated XP added to my XPD account?
It's currently set at 72 hour. But, on account creation all XP you already have is added to your XPD account within a minute or so.

How long does it take to send XPD to another user?
You select the username and amount, then click "Send". Then the backend checks if have the required funds in your account, does a database insert and it's done. Depending on the other workloads, takes a few seconds usually.

How does NFT work?
It's PNG files, 128x128 pixels. It costs 1 XPD to create one NFT.

How long does it take to create an NFT?
Similar to sending XPD to someone. You select the PNG file, fill in title and description and hit upload. Then the backend checks (asynchronously) if your file is valid and that you have the required 1 XPD in your account, does a database insert and it's done. Depending on the other workloads, takes a few seconds usually.

Transaction fees?
Huh? Why would i charge fees for doing a few database statements that take a few milliseconds. No, the only thing that "costs" a fee is NFT creation. Mostly because i want you lot not completely filling my ancient server with PNG files within the first 24 hours.

API?
Uhm, yes, coming soon. It's currently missing a few features, like the ability to not crash the server on every other call.

Selling NFT via an auction?
Not yet. The backend if half finished, should be online in a few days.

Smart contracts? Scripting?
That's in the late design phase. Pretty much anything you can do in the web interface, you will be able to do in the scripting engine. Plus some. You'll be able to buy and sell NFTs, send XPD to someone, bid on an auction, implement a piggy bank, run a Ponzi scheme(*), ...

(*) It's not real money, XPD is a fun learning experience. If you know how to implement an automated Ponzi scheme, go for it.

perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'

Replies are listed 'Best First'.
Re: XPD - Do more with your PerlMonks XP
by cavac (Parson) on Apr 05, 2022 at 11:02 UTC

    Now for a bit of monetary theory...

    XPD are not created out of thin air. There is an "admin" account that started at zero. Everytime a user earns XPD, it gets transfered from admin to that user. This is to balance the books (zero sum game).

    This is similar on how to properly bootstrap an economy. Say the country of Elbonia has just been founded. It needs a currency, in our example ElboDollars. So Elbonia creates a government department called the "National Bank".

    The national bank lends ElboDollars to other companies like privately owned banks (which they have to pay back eventually). The national bank can do this, because it is essentially backed by the inherent value of Elbonia (the land, the resources, the workforce, the military with its nuclear arsenal,...).

    The privately owned banks can then invest in other ventures or lend out the money to private individuals and companies for a price (interest payments, shares in the company, etc). This creates cash flow, which creates wealth, which allows the banks to repay their loan to the national bank. While at the same time, this created wealth increases the value of the Elbonian economy as a whole, making ElboDollars a stronger currency, which in turn enables Elbonia to use its currency for foreign trade. Of course, that only works if Elbonia makes sure that the ratio of the total amount of ElboDollars is stable compared to the size of its economy.

    Technically, you can base a currency on pretty much anything, as long as the base of that currency provides value, meaning it's something that people want to have more of or something people strive to improve and add value. XPD is based on the idea that PerlMonks want to help each other and provide value in posting helpful and/or interesting stuff on PerlMonks. The best way to measure the creation of value for the community is XP, which is why XPD is based on PM XP.

    This is also why crypto currencies like Bitcoin are inherently unstable. There is no inherent value underlying the currency, no government to back it up with the value of its economy, no inherent creation of value in the form of goods and services. Their price is solely determined by betting on the future price. But there is no underlying base value, like "there are so many bitcoin in existance, if push comes to shove there is a country backing it that creates X amount of goods and has Y amount of resources and Z amount of workers available for hire. So the base value of one bitcoin is at least two loafs of bread or seven hours minimum wage or 100 kilogram of iron ore". Essentially, crypto currencies are just files with random data and checksums, but without anything to provide past or future creation of tangible value that can be easily exchanged for goods and services with any sort of guarantee.

    XPD is sort of my attempt to create a playing fields that let's me and other PerlMonks explore different aspects of modern monetary systems without actually having to invest any real money. This is a playing field, a digital monopoly-money simulation of modern crypto currencies. It will also let us explore the "dark" side of monetary systems like economic bubbles and criminal endeavors without breaking the law or endangering peoples livelyhood.

    So, have fun!

    Further reading: There are many good resources on monetary theory. One of the most insightful and easy to understand one is the Discworld novel "Making Money" by Sir Terry Pratchett.

    perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'
Re: XPD - Do more with your PerlMonks XP
by Discipulus (Canon) on Apr 05, 2022 at 08:40 UTC
    Hello cavac,

    I tried to register for fun but I received back some error: I filled in anything but the family name in the form ( using as name Discipulus ), I've put the temp code in my homenode but I received back Could not find a valid homenode!

    I tried to login anyway and received back a login error, but I noticed the username turned to lowercase.

    HtH

    PS 11:38 GMT+1 I confirm that I registered and logged in succesfully: fast bug fixer!!

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

      Oh, i think that's different from the "missing session cookie" bug i just fixed. Give me a few minutes.

      Edit: Ok, the Homenode parsing was a bit wonky. Should work now... i hope.

      In addition to that, there was a bug with the session cookies. When you are not logged in, you are supposed to get a session cookie for user guest for the Register form. That worked, unless you used the direct link to the form. *facepalm* This should now work as expected.

      Edit 2: As for the Username going lowercase, i'll look into that as well.. Usernames with uppercase letters should now work. If there are still problems, post a bug report here.

      perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'
Re: XPD - Do more with your PerlMonks XP
by Discipulus (Canon) on Apr 05, 2022 at 11:21 UTC
    Hello,

    dunno if they are bug or due to my misunderstanding..

    • when I selected an NFT and submitted Buy the table did not refreshed: I'd expect the item disappearing from the Market view
    • I found the new purchesed art item (;) under My NFT then selected, leveraged its price and I put on the Market again: but I cannot find it anymore on the Market
    • if I drop down the market list I can see a cryptic label: Showing 49 to 15 of 15 records (filtered from 88 total records)

    you are not the only bug sniffer :)

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

      • Yeah, the transactions happen in a background worker. I'm working on a way to update the list when the sale actually happens. But that is still in the early design stages.
      • The "market" list filters out your own items, so you don't accidently buy from yourself. You can filter or sort the "Market" column in "My NFT" to see your listings.
      • The lists (My NFT, Market, etc) are pre-filtered (server side forced filters) lists. So the label at the bottom gets a bit confused. I'll have to fix that some day, but my ListAndEdit module isn't the easiest to maintain. It's super practical and i use it a lot, but over the years of extending it the code has had a bit of a spaghettification problem..

      perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'
Re: XPD - Do more with your PerlMonks XP
by Ratazong (Monsignor) on Apr 05, 2022 at 15:16 UTC

    Fun - Thank you cavac!

    Now lets wait till the people start buying my NFTs - and then find a way to transfer the XP back to perlmonks ... lets see how fast it brings me to the top of the list of saints ;-)

    Rata

      > lets see how fast it brings me to the top of the list of saints ;-)

      You are late, BUK just bought a confiscated superyacht with his XPs ;-)

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

Re: XPD - Do more with your PerlMonks XP
by Anonymous Monk on Apr 05, 2022 at 12:42 UTC
    I can't connect to cav.ac. When I do resolve it (not always), I get Failed to connect to 149.154.155.235 port 80: Connection refused. I can trace it and everything, it just refuses the connection.

      You need to use https on port 443, so https://cav.ac

      Unsecured connections are not really supported anymore. On most browsers, the automatic redirect from http to https should work, although i don't test this regularly anymore. But i short test showed that a connection to the server over insecure http (port 80) returns a 301 Moved Permanently with a pointer to Location: https://cav.ac/

      The other possibility is that your IP is somehow on one of my firewall blacklists. Can you send me your IP via private CB ("/msg cavac my ip is 1.2.3.4") so i can check my logs?

      perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'
        I've tried HTTPS first; port 80 was a later test. Thanks, I'll /msg you the IP address.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://11142681]
Approved by kcott
Front-paged by kcott
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-03-28 21:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found