Contracts and testnet IDs
The network runs on two Move packages on IOTA:
| Package | What it contains |
|---|---|
almacen | The system (System: BLS committee, prices, capacity, accounting per epoch), Blob and Storage, staking (Staking, pools, committee by stake, epochs), the project treasury (treasury), events and Display. Payments and stake are in iota::iota::IOTA. |
sitios | Sites: Site (with Display), one Resource per path, routes, redirects, metadata and events. |
IOTA testnet
| Object | ID |
|---|---|
Package almacen | 0x6c5fef208f3d3de114b9debdfeeed88762bff823486135c82b0447b5541ac142 |
System | 0xedc9b3efa90d0bba4da9819e2c08becc0d230de36b7921040c1f53c0c6ee90cc |
Staking | 0x44d4a6a113cd7530cab0a6a8dd40717534cd5a89be78e130c72504c08f92b5a2 |
Treasury | 0x8e28d541b98302744afc9b0dbbd9a7680200c7a63d70839057429ca7ea1fa64c |
Package sitios | 0xfffd81708ef3474d7cbd5a496246b03603a27c8a747415ea1d1e2632019a3c30 |
- Chain: IOTA testnet. Public RPC:
https://api.testnet.iota.cafe. - Configuration: 4 storage nodes with 25 shards each (100 shards), 1 IOTA of stake in each, 1-day epochs and at most 53 epochs per purchase.
- Types: a stored blob is a
<almacen>::blob::Bloband a site is a<sitios>::site::Site, where<almacen>and<sitios>are the package IDs above.
Main functions
Storing and managing blobs (package almacen):
| Function | What it does |
|---|---|
system::reserve_space | Buys a Storage of a given encoded size for some epochs, paying in IOTA. |
system::register_blob | Registers a blob ID on a Storage and creates the Blob, paying the write fee. The contract recomputes the blob ID from the Merkle root and the size. |
system::certify_blob | Certifies the blob with the aggregated BLS signature of a quorum of shards and the bitmap of the signers. |
system::extend_blob | Renews a certified, unexpired Blob for more epochs, paying in IOTA. |
system::delete_blob | Deletes a deletable Blob and returns its Storage. |
blob::burn | Destroys a Blob object. |
reserve_space, register_blob and extend_blob take the payment as a &mut Coin<IOTA> and charge
exactly what is due, so the client can pay storage from the gas coin in the same transaction.
Sites (package sitios, module site): new_site, new_resource, add_header, add_resource,
remove_resource_if_exists, create_routes, insert_route, remove_all_routes_if_exist,
create_redirects, insert_redirect, take_redirects_if_exist, update_name, update_metadata
and burn.
Treasury (module treasury): anyone can deposit; only the holder of the TreasuryAdminCap can
withdraw.
Events
The storage nodes follow the events of the events module: BlobRegistered, BlobCertified
(also emitted by a renewal, with is_extension), BlobDeleted and InvalidBlobID, among others.
The treasury emits TreasuryDeposit and TreasuryWithdrawal.
Notes
- BLS keys. IOTA testnet and mainnet disable the uncompressed G1 functions, so the nodes' public
keys are stored as
Element<G1>and added withg1_add. A certificate is the aggregated signature of the signers, verified withbls12381_min_pk_verifyagainst the sum of their keys. - Treasury. The
treasurymodule receives 3 % of the rewards of each epoch and the commission of slashed nodes. - IOTA Names. The
sitiospackage does not depend on IOTA Names: the portal resolves the names.
Tests
almacen: 268/268 Move tests, 5 of them for the treasury.sitios: 39/39 Move tests.- End-to-end tests on IOTA testnet: storing through the publisher, paying from a wallet and renewing, transferring and deleting, and publishing, serving, updating and destroying sites.