Hi LaLi,

Great question, so the short answer is yes this is totally do-able but the longer answer is that while possible, the compact communication of a payout hyperplane (as has been done for one dimension using polynomial interpolation) is rather complex and not our first priority. That said, there is a way to use existing infrastructure for numeric outcomes as-is to support use cases like these.

Given some allowed n-by-m grid (n and m can be very large numbers for more accurate grids), enumerate the possible squares

0         | 1              | ... | m-1
m        | m+1         | ... | 2m-1
...        | ...             | ... | ...
m(n-1) | m(n-1)+1 | ... | mn - 1

Then construct n payout curve pieces (which can themselves be made out of multiple pieces) which describe the payout on each row (essentially if you have some payout surface P(x, y), approximate that curve for each fixed y), and then piece these row payouts together into a payout curve over a 1-dimensional outcome (which is the grid square number).

Finally, you can have the oracle either attest to the grid number, or you can have the oracle attest separately to two numbers (x, y) which can be added together as x + m*y to get the grid square number (noting that this approach requires a tiny bit of custom/not-yet-existing code).

Also note that this scheme can be generally extended to any number of dimensions: to go down one dimension simply view the outcome space as a list of thickened hyper-planes (e.g. thickened lines for 2D, thickened planes for 3D) and apply the lower dimensional solution to each of those resulting in a list of payout curve pieces over a 1D result, then piece these together to get a payout curve for the whole space.

In the future, if there seem to be use cases for these kinds of DLCs a more elegant solution will likely be specified and implemented which relies on a more general payout function encoding.


On Wed, Mar 24, 2021 at 5:16 AM LaLi via dlc-dev <dlc-dev@mailmanlists.org> wrote:

Hello dlc-mailing-list,

Hope you are all well.

I'm new to this realm. I recently have been reading through the DLC specs and have explored some of the implementation including the recent Krystal Ball implementation to get my head around the domain.

I was thinking the other day about a meteorite that burnt through the atmosphere over north Cheltenham, England on the 28 Feb of this year. There was a bit of excitement and a race to be the first to find some actual meteorite rocks. In addition, people were making prediction about where some of these rocks would be found. I was thinking of a DLC contract where an oracle could attest to the coordinates (Latitude and Longitude) of the first meteorite rocks to be found.

From the specs I have read (I apologise if I have missed relevant detail), is there intended support for such multi-dimensional numerical measurements? If so, is there any thinking about how they would work from announcement to attestation?

In my concrete example we have 2 dimensions of measurement, but I could see N-dimensional outcomes being useful for other predictions e.g. RGB colour and 3D space measurements.

Kind regards,


dlc-dev mailing list