Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update erc-7007.md to add opML compatibility #1

Merged
merged 11 commits into from
Jan 10, 2024

Conversation

tina1998612
Copy link
Collaborator

When opening a pull request to submit a new EIP, please use the suggested template: https://github.com/ethereum/EIPs/blob/master/eip-template.md

We have a GitHub bot that automatically merges some PRs. It will merge yours immediately if certain criteria are met:

  • The PR edits only existing draft PRs.
  • The build passes.
  • Your GitHub username or email address is listed in the 'author' header of all affected PRs, inside .
  • If matching on email address, the email address is the one publicly listed on your GitHub profile.

},
"verificaton": {
"type": "string",
"description": "Specify the verification method. Input zkML or opML."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this makes sense. want to propose another possible wording:
"proof_type": {
"type": "validity" / "fraud",
...
}
the point here is to align with "aigc_type".
we can discuss this.

ERCS/erc-7007.md Outdated
*/
function verify(
bytes calldata prompt,
bytes calldata aigcData,
bytes calldata proof
bytes calldata proofOrState
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a good way to integrate. just a question:
I assume the 'state' means the state root hash in opml, provided by the submitter, but then can we still call it 'verify'? would like to see how does the opml challenger interact with this interface.

)
);
_setTokenURI(tokenId, tokenUri);
tokenIdToRequestId[tokenId] = IOpmlLib(opmlLib).initOpmlRequest(keccak256(prompt));
Copy link

@0x1cc 0x1cc Jan 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IOpmlLib(opmlLib).uploadResult(tokenIdToRequestId[tokenId], keccak256(aigcData));

bytes calldata proof
) public view virtual override returns (bool success) {
uint256 tokenId = uint256(keccak256(prompt));
return IOpmlLib(opmlLib).isFinalized(tokenIdToRequestId[tokenId]);
Copy link

@0x1cc 0x1cc Jan 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uint256 tokenId = uint256(keccak256(prompt));
bytes32 output = IOpmlLib(opmlLib).getOutputHash(tokenIdToRequestId[tokenId]);
return IOpmlLib(opmlLib).isFinalized(tokenIdToRequestId[tokenId]) && (output == keccak256(aigcData));

Copy link

@0x1cc 0x1cc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should utilize the output (aigcData) in function mint and verify to check the result.

pragma solidity ^0.8.18;

interface IOpmlLib {
function initOpmlRequest(bytes32 inputHash) external returns (uint256 requestId); // we can construct the initialState using the input, can replace input with prompt (string)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function initOpmlRequest(bytes calldata input) external returns (uint256 requestId);


interface IOpmlLib {
function initOpmlRequest(bytes32 inputHash) external returns (uint256 requestId); // we can construct the initialState using the input, can replace input with prompt (string)
function uploadResult(uint256 requestId, bytes32 output) external;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function uploadResult(uint256 requestId, bytes calldata output) external;

function proposeState(uint256 challengeId, bytes32 stateHash) external;
function assertStateTransition(uint256 challengeId) external;
function isFinalized(uint256 requestId) external view returns (bool);
function getOutputHash(uint256 requestId) external view returns (bytes32 output);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function getOutput(uint256 requestId) external view returns (bytes memory output);

Copy link

@0x1cc 0x1cc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace bytes32 (input/output) in IOpmlLib.sol with bytes (we cann allow upload the whole data or only the hash)

@socathie socathie merged commit 93bce2d into AIGC-NFT:master Jan 10, 2024
socathie added a commit that referenced this pull request May 10, 2024
* Update erc-7007.md to add opML compatibility (#1)

* Update erc-7007.md to add opML compatibility

* Update erc-7007.md param name

* Create IOpmlLib.sol

* Update and rename ERC7007.sol to ERC7007_zkml.sol

* Update IOpmlLib.sol

* Update IOpmlLib.sol

* Update IOpmlLib.sol

* Create ERC7007_opml.sol

* Update ERC7007_opml.sol

* Update IOpmlLib.sol

* feat: update implementation to include owner address

* feat: update authorship, added Updatable extension, update metadata with `proof_type`

* fix: full term before abbreviation

* feat: Update ERC7007 contracts and add IERC7007Updatable interface

* feat: Add rationale and security considerations

* feat: `update` function to use `verify` in `require` statement

* misc: capitalization

* xhyu patch 1 (#2)

* misc: improve abstract & motivation

* fix: Spec intro & Model Publication wording

* fix: Rewrite part of motivation

* corrected some small typos
* rewrote the last two paragraphs in Motivation

---------

Co-authored-by: drCathieSo.eth <[email protected]>

* fix: proposal reference and header

* fix: file references

* Update erc-7007.md: Fix wordings (#4)

* Update erc-7007.md: Fix wordings

* update license

* Update description and motivation -> rationale

---------

Co-authored-by: drCathieSo.eth <[email protected]>

* Add workflow (#5)

* Add workflow diagram

* Add workflow description

* Apply suggestions from code review

Co-authored-by: Sam Wilson <[email protected]>

* Update erc-7007.md

* Fix uppercase keywords

* Update erc-7007.md

---------

Co-authored-by: 李婷婷 Lee Ting Ting <[email protected]>
Co-authored-by: xhyumiracle <[email protected]>
Co-authored-by: Sam Wilson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants