sip | title | description | author | status | Last Call | type | category | created |
---|---|---|---|---|---|---|---|---|
38 |
Map support for smart contracts |
Add the option to save/read arbitrary data inside contracts |
jjos |
Review |
2022-04-24 |
Standard |
Core |
2022-04-17 |
Allow smart contracts to save and read arbitrary data in a (key1, key2)-value form. Values saved are persistent and fully accessible. This allows to write contracts that can interact with an unlimited number of participants.
Contracts can also read data from other contracts, allowing to easily implement oracle applications or other type of communication between contracts without actually having to send transactions between them.
The following new operations are included in the virtual machine:
GET_MAP_VALUE_KEYS_IN_A = 0x0407
: get the value stored with keys in A1, A2, and A3 (if A3==0 use the AT ID as key3)SET_MAP_VALUE_KEYS_IN_A = 0x0408
: save the value in A4 with the keys in A1 and A2
This is a hard forking change, thus breaking compatibility with old fully-validating nodes.
It should not be deployed without widespread consensus.
Copyright and related rights waived via CC0.