Skip to content

Commit 6bf7e62

Browse files
committed
archived-resources, context for policies
1 parent 4b40fad commit 6bf7e62

File tree

1 file changed

+261
-0
lines changed

1 file changed

+261
-0
lines changed
+261
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,261 @@
1+
---
2+
id: archived resources
3+
sidebar_position: 4
4+
slug: /archived-resources
5+
---
6+
7+
# Archived Orcfax resources
8+
9+
This section contains links, instructions, and commentary relating to Orcfax
10+
solution versions and/or components **which are no longer in operation**. This
11+
information has been left as an educational resource and as a testament to the
12+
development journey of the Orcfax oracle solution.
13+
14+
## v0
15+
16+
The v0 solution offered by Orcfax on Cardano mainnet was released in 2023 and
17+
utilized the Cardano Open Oracle Protocol ([COOP][coop-1]) to format and publish
18+
information on-chain. The protocol constituted a set of technical guidelines
19+
that specified a process, and format, for the publication and consumption of
20+
off-chain data by smart contracts on the Cardano blockchain.
21+
22+
The Orcfax team developed the Cardano Open Oracle Protocol as a Catalyst funded
23+
research project that aimed to maximize the eUTXO model and leveraged design
24+
principles to prioritize a cost-sensitive, post-Vasil native method for
25+
publishing secure, signed, datums on-chain for Reference Input consumption by
26+
Cardano dApps.
27+
28+
The initial version of COOP was developed in collaboration with [MLabs][mlabs-1]
29+
consultancy. The guidelines and specification in COOP are free, open-source, and
30+
can be implemented by any other project seeking to develop their own Cardano
31+
oracle feeds.
32+
33+
Shortly after this version was released, IOG discontinued support for both
34+
the Plutus Application Backend (PAB) and Plutus-Chain-Index. Both were critical
35+
components in the COOP v0 stack. Aware of the discontinued support, the Orcfax
36+
team partnered with technical consultants through MLabs to replace the
37+
components. Unfortunately, the plutus-chain-index component failed before a
38+
replacement could be rolled-out.
39+
40+
And so v0 was suspended in May of 2024.
41+
42+
More information pertaining to this failure can be found in both the
43+
[public announcement][medium-1]
44+
and in the subsequent [incident report][report-1]
45+
46+
[coop-1]: https://github.com/mlabs-haskell/cardano-open-oracle-protocol/
47+
[mlabs-1]: https://mlabs.city/
48+
[medium-1]: https://medium.com/@orcfax/orcfax-feed-suspension-and-protocol-upgrade-a45709dafb56
49+
[report-1]:
50+
51+
### v0 Mainnet
52+
53+
Policy ID:
54+
55+
```text
56+
2cccc05192920ff1eb02bcfa7bb2a1fc5352ce58391d7ba3c66a555b
57+
```
58+
59+
On [cexplorer][cexplorer-1].
60+
61+
[cexplorer-1]: https://cexplorer.io/policy/2cccc05192920ff1eb02bcfa7bb2a1fc5352ce58391d7ba3c66a555b
62+
63+
Smart contract address:
64+
65+
```text
66+
addr1w8tcecfy7np3sduzn99ffuv8qx2sa8v977l0xql8ca7lgkgq7lqh2
67+
```
68+
69+
On [cexplorer][cexplorer-2].
70+
71+
[cexplorer-2]: https://cexplorer.io/address/addr1w8tcecfy7np3sduzn99ffuv8qx2sa8v977l0xql8ca7lgkgq7lqh2
72+
73+
### v0 Preprod
74+
75+
Policy ID:
76+
77+
```text
78+
104d51dd927761bf5d50d32e1ede4b2cff477d475fe32f4f780a4b21
79+
```
80+
81+
On [preprod.cexplorer][preprod-1].
82+
83+
[preprod-1]: https://preprod.cexplorer.io/policy/104d51dd927761bf5d50d32e1ede4b2cff477d475fe32f4f780a4b21/mint
84+
85+
Smart contract address:
86+
87+
```text
88+
addr_test1wrtcecfy7np3sduzn99ffuv8qx2sa8v977l0xql8ca7lgkgmktuc0
89+
```
90+
91+
On [preprod.cexplorer][preprod-2].
92+
93+
[preprod-2]: https://preprod.cexplorer.io/address/addr_test1wrtcecfy7np3sduzn99ffuv8qx2sa8v977l0xql8ca7lgkgmktuc0
94+
95+
### In use
96+
97+
Minting policy identifiers were critical as fact statements were to be verified
98+
as having come from a known source. These identifiers also provided the ability
99+
to filter all of the UTxO at a given smart contract address and to filter out
100+
those sent by others to the same address.
101+
102+
Users were required to use the following information to identify the latest
103+
facts published.
104+
105+
- Minting policy ID.
106+
- Datum format, including:
107+
- Most recent (`ValueReference -> PropertyValue[1] -> value)`, i.e. the
108+
largest POSIX timestamp compared to other fact statement datum,
109+
- Feed name, e.g. "ADA-USD".
110+
111+
> Note: Users on preprod will find a volume of test data that was not ever
112+
> retired as Orcfax previously used this space as a testing sandbox.
113+
114+
In this model, unconsumed reference inputs were those still available for smart
115+
contracts to use on-chain. Spending a UTxO with a reference input would render
116+
it unusable in a smart contract (though the data was still visible in the
117+
historical transaction). This process of consuming reference inputs is also
118+
referred to as _garbage collection_ or the _retiring_ of fact statements.
119+
120+
At the time of this version, Orcfax committed to a mainnet policy whereby two
121+
unspent fact UTxO would remain on-chain at all times in order to provide
122+
continuous datum coverage.
123+
124+
> Note: maintaining at least two datum on-chain gave smart contracts (and their
125+
> developers) access to the most current datum and the datum before that for
126+
> inspection. The POSIX timestamps denoting a valid-from and valid-through
127+
> period could be inspected to ensure that they were still within a valid
128+
> window.
129+
130+
For more information about the use of reference inputs and the inline datum
131+
utilized in COOP v0, see the relevant COOP [design document][coop-design-1].
132+
133+
[coop-design-1]: https://github.com/mlabs-haskell/cardano-open-oracle-protocol/blob/9e9c9aedba84d32e424b1dd116b4734e1a42f3bc/coop-docs/00-design.md#cardano-features-enabling-oracles
134+
[utxo-1]: https://docs.cardano.org/learn/eutxo-explainer/
135+
[reference-1]: https://docs.cardano.org/cardano-testnet/about/feature-overview/#referenceinputs(cip-31)
136+
[datum-1]: https://docs.cardano.org/cardano-testnet/about/feature-overview/#inlinedatums(cip-32)
137+
138+
### v0 datum structure
139+
140+
All fact statements were structured as [JSON-LD](https://json-ld.org/) objects
141+
before being serialized into the Concise Binary Object Representation
142+
([CBOR](https://cbor.io/)) used in Cardano transactions.
143+
144+
![Fact Statement](/img/2023-09-30--Orcfax--fact-statement.jpg)
145+
146+
#### v0 JSON-LD schema
147+
148+
The Orcfax V0 datum was translated to on-chain CBOR from the following JSON
149+
schema (example given is from Sep 28, 2023):
150+
151+
```json
152+
{
153+
"@context": "https://schema.org",
154+
"type": "PropertyValue",
155+
"name": "ADA-USD|USD-ADA",
156+
"value": [0.249495, 4.008096354636367],
157+
"valueReference": [
158+
{
159+
"@type": "PropertyValue",
160+
"name": "validFrom",
161+
"value": 1695939870811
162+
},
163+
{
164+
"@type": "PropertyValue",
165+
"name": "validThrough",
166+
"value": 1695943470811
167+
}
168+
],
169+
"identifier": {
170+
"propertyID": "Arkly Identifier",
171+
"type": "PropertyValue",
172+
"value": "urn:orcfax:4ae10640-10b9-4c23-af1d-c4a9dbd8938d"
173+
},
174+
"_:contentSignature": "40330ff2597c399ddaaab6c1dbaab52173ef82bf7f08d3ca84585ab5e76429a0"
175+
}
176+
```
177+
178+
### Reading v0 datum on-chain
179+
180+
Orcfax fact statement datum were readable on-chain as Cardano
181+
[Reference Inputs](https://github.com/perturbing/vasil-tests/blob/main/reference-inputs-cip-31.md).
182+
183+
To have read the `ADA-USD|USD-ADA` Mainnet feed, users were encouraged to check
184+
the latest transaction issued by the
185+
[feed smart contract](https://cexplorer.io/address/addr1w8tcecfy7np3sduzn99ffuv8qx2sa8v977l0xql8ca7lgkgq7lqh2/tx#data).
186+
187+
### Reading v0 datum off-chain
188+
189+
The [PyCardano](https://pycardano.readthedocs.io/) SDK provided convenient
190+
helper functions for converting on-chain CBOR.
191+
192+
The Orcfax team created an open-source PyCardano
193+
[demo script](https://github.com/orcfax/datum-demo/tree/main#readme) to assist
194+
users in reading and parsing the on-chain Orcfax datum.
195+
196+
This script converted the Cardano transaction's CBOR serialization to human and
197+
machine-readable JSON while simultaneously logging various details about the
198+
Datum as it went.
199+
200+
It's very easy to customize the configuration options of this script to match
201+
the requirements of another dApp.
202+
203+
This resource was made freely available under an open-source Apache
204+
v2.0 license so that users could test, integrate, and extend their own solutions
205+
by integrating Orcfax fact statement feeds.
206+
207+
<!-- markdownlint-disable MD013 -->
208+
209+
_demo script output:_
210+
211+
```text
212+
2023-09-28T16:24:13Z INFO :: read_datum.py:264:read_datum() :: entering this script...
213+
2023-09-28T16:24:13Z INFO :: read_datum.py:265:read_datum() :: oracle smart contract: addr_test1wrtcecfy7np3sduzn99ffuv8qx2sa8v977l0xql8ca7lgkgmktuc0
214+
2023-09-28T16:24:15Z INFO :: read_datum.py:226:get_latest_utxo() :: inspecting '862' UTxOs
215+
2023-09-28T16:24:15Z WARNING :: read_datum.py:254:get_latest_utxo() :: '7.00' hours since datum was published (1695943470811)
216+
2023-09-28T16:24:15Z INFO :: read_datum.py:191:validate_utxo() :: inspecting the utxo for valid auth tokens
217+
2023-09-28T16:24:15Z INFO :: read_datum.py:217:validate_utxo() :: the utxo is valid, it contains the correct auth token
218+
2023-09-28T16:24:15Z INFO :: read_datum.py:79:display_utxo() :: (input) transaction id: 078d548b0ed91b95164d0baaf2b486161e06aab84483d99ed01a2180090ab0f3
219+
2023-09-28T16:24:15Z INFO :: read_datum.py:80:display_utxo() :: (output) transaction addr: addr_test1wrtcecfy7np3sduzn99ffuv8qx2sa8v977l0xql8ca7lgkgmktuc0
220+
2023-09-28T16:24:15Z INFO :: read_datum.py:81:display_utxo() :: (output) datum cbor:
221+
222+
590207d8799fa74840636f6e746578745268747470733a2f2f736368656d612e6f7267525f3a636f6e74656e745369676e61747572655840343033333066663235393763333939646461616162366331646261616235323137336566383262663766303864336361383435383561623565373634323961304a6964656e746966696572a34a70726f706572747949445041726b6c79204964656e74696669657244747970654d50726f706572747956616c75654576616c7565582f75726e3a6f72636661783a34616531303634302d313062392d346332332d616631642d633461396462643839333864446e616d654f4144412d5553447c5553442d41444144747970654d50726f706572747956616c75654576616c75659fd87c9f1a0003ce971bfffffffffffffffaffd87c9f1b000e3d57a771924e1bfffffffffffffff1ffff4e76616c75655265666572656e63659fa34540747970654d50726f706572747956616c7565446e616d654976616c696446726f6d4576616c75651b0000018adde4c05ba34540747970654d50726f706572747956616c7565446e616d654c76616c69645468726f7567684576616c75651b0000018ade1baedbff5820303443413030303148424559394b4b34343950314345513850483744544a5954d87a9f1b0000018ade1baedbff581c90b121aa6b689200adf7ed115040a96375d2b68e23633d6864c53a91ff
223+
224+
2023-09-28T16:24:15Z INFO :: read_datum.py:84:display_utxo() :: (output) Tx cost: 3.42214 ADA
225+
2023-09-28T16:24:15Z INFO :: read_datum.py:151:decode_utxo() ::
226+
227+
{
228+
"@context": "https://schema.org",
229+
"type": "PropertyValue",
230+
"name": "ADA-USD|USD-ADA",
231+
"value": [
232+
0.249495,
233+
4.008096354636367
234+
],
235+
"valueReference": [
236+
{
237+
"@type": "PropertyValue",
238+
"name": "validFrom",
239+
"value": 1695939870811
240+
},
241+
{
242+
"@type": "PropertyValue",
243+
"name": "validThrough",
244+
"value": 1695943470811
245+
}
246+
],
247+
"identifier": {
248+
"propertyID": "Arkly Identifier",
249+
"type": "PropertyValue",
250+
"value": "urn:orcfax:4ae10640-10b9-4c23-af1d-c4a9dbd8938d"
251+
},
252+
"_:contentSignature": "40330ff2597c399ddaaab6c1dbaab52173ef82bf7f08d3ca84585ab5e76429a0"
253+
}
254+
255+
2023-09-28T16:24:15Z INFO :: read_datum.py:152:decode_utxo() :: oracle datum identifier (internal): b'04CA0001HBEY9KK449P1CEQ8PH7DTJYT'
256+
2023-09-28T16:24:15Z INFO :: read_datum.py:157:decode_utxo() :: oracle datum timestamp: 2023-09-28T23:24:30Z (1695943470811)
257+
2023-09-28T16:24:15Z INFO :: read_datum.py:170:pretty_log_value() :: ADA-USD: 0.249495
258+
2023-09-28T16:24:15Z INFO :: read_datum.py:170:pretty_log_value() :: USD-ADA: 4.008096354636367
259+
```
260+
261+
<!-- markdownlint-restore -->

0 commit comments

Comments
 (0)