Kiosk is opensource and written in Scala. To run it from source, first, clone the repository and do sbt run (requires SBT to be installed). The web-interface will open in http://localhost:8080
Kiosk requires a fully configured Ergo node running and by default assumes that its REST API is available at http://localhost:9052. This can be changed by calling the method org.sh.kiosk.ergo.ErgoAPI.setUrl from the web-UI.
A precompiled jar is available here, which can be run using java -jar <jarfile>.
You can generate the jar from sources by issuing the command sbt assembly.
Use it as follows:
Set the environment to use in ErgoScript. This is a map of (key, value) pairs where keys will be referenced within ErgoScript code and also for setting registers of boxes. See the first image.
It seems Kiosk is the most powerful tool to work with the scripts right now. Unlike other tools it is supporting context variables. Will play with it more in coming days.
I was able to claim the P2S box (it was quite straightforward as no additional information was required to spend the box, since the script already evaluates to true).
However, I’m having trouble spending the P2SH box. My script matches the expected blake2b-256 hash. But I get the following error:
Malformed transaction: Scripts of all transaction inputs should pass verification. 6ab7e2e0d8bb2c62b2209c80dec88227f6af83f6ccfdb61ff3df864933e1acca: #1 => Failure(org.ergoplatform.validation.ValidationException: Validation failed on ValidationRule(1000,Deserialized script should have expected type) with args WrappedArray(DeserializeContext(1,SSigmaProp), ConstantNode(Coll(-1),Coll[SInt$])))
It’s possible I’m not serialising the context variable correctly and I’m missing some kind of wrapper. Or perhaps there’s a bug in the P2SH contract?
As follow up, an online instance of Kiosk for experimental use is deployed at https://ergo.kioskweb.org/
This is running the exact code at https://github.com/scalahub/Kiosk
Please use the above instance only for experiments and not for transferring any large amounts.
For actual use, run your local instance as explained below.
To run you own copy (which is the right way to use it), you must clone the project and then do one of the following.
Run sbt using the command sbt
Then inside sbt prompt type the following jetty:start
This will run the project using built in jetty web server on port 8080 which you can access at http://localhost:8080
Compile the war file using sbt package. (the file is in target/scala-2.12 folder in my case). Then run the war file as you would run any other J2EE app.
Kiosk currently depends only on ergo-appkit and uses the public explorer to post transactions. In particular it does not require a local running Ergo node.
Signing is performed via Appkit, which replicates a large part of the Ergo node wallet’s functionality locally. after all both are JVM based).
Kiosk is “multi-tenant” because each URL corresponds to a private copy of the script environment and box storage. Hence you can bookmark a URL and visit it later, and your declared variables and boxes should be present. Without the same URL, no one else will be able to see or modify your environment.