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

Question about the OP_KEVA_DELETE opcode processing #23

Open
ghost opened this issue Jun 30, 2021 · 3 comments
Open

Question about the OP_KEVA_DELETE opcode processing #23

ghost opened this issue Jun 30, 2021 · 3 comments

Comments

@ghost
Copy link

ghost commented Jun 30, 2021

I'm writing an indexing script, so want to actualize the data on receiving new blocks.

Do I understand it right, that data not physically removing from the previous blocks, just we have OP_KEVA_DELETE marker in the last block incoming, that means to 'hide' the data stored before?

Thanks.

@ghost
Copy link
Author

ghost commented Jun 30, 2021

It's seems that data have physically removed, and unfortunately I've deleted the example for the #24 issue, when testing that :)

@ghost
Copy link
Author

ghost commented Jul 8, 2021

I need to clarify my question:

if I receive transaction with OP_KEVA_DELETE marker, how could I know which transaction ID should be deleted (if I have 2 same key/value pairs, for example). I think, that deletion transaction should contain some hash/ID of the target one.

Put example

block 359471
Array
(
    [value] => 0.01
    [n] => 1
    [scriptPubKey] => Array
        (
            [asm] => OP_KEVA_PUT 356a893ac5dbc64229a0700d63b019c72e5227644d 746573742064656c657465206b6579 746573742064656c6574652076616c7565 OP_2DROP OP_DROP OP_HASH160 a63bd4014af78762d13a2bb5ed6241d9a09ea269 OP_EQUAL
            [hex] => d115356a893ac5dbc64229a0700d63b019c72e5227644d0f746573742064656c657465206b657911746573742064656c6574652076616c75656d75a914a63bd4014af78762d13a2bb5ed6241d9a09ea26987
            [reqSigs] => 1
            [type] => scripthash
            [addresses] => Array
                (
                    [0] => VRpBmNtNmzUo1PsAAPmx7Ev7eeUcTW2kVA
                )

        )

)

Delete example

block 359473
Array
(
    [value] => 0.01
    [n] => 0
    [scriptPubKey] => Array
        (
            [asm] => OP_KEVA_DELETE 356a893ac5dbc64229a0700d63b019c72e5227644d 746573742064656c657465206b6579 OP_2DROP OP_HASH160 177adffd4fde22bd294bad4b2ec213b78cb1a4b5 OP_EQUAL
            [hex] => d215356a893ac5dbc64229a0700d63b019c72e5227644d0f746573742064656c657465206b65796da914177adffd4fde22bd294bad4b2ec213b78cb1a4b587
            [reqSigs] => 1
            [type] => scripthash
            [addresses] => Array
                (
                    [0] => VCoNfWsbv1h6Hg1mTU8vRzVt8PgZ418Auj
                )

        )

)

@ghost
Copy link
Author

ghost commented Jul 8, 2021

Experimentally, I've get error on trying to remove second (the same) key/value pair in the namespace. Suppose, that is a bug or maybe nice idea for the future protocol enhancement.

Screenshot from 2021-07-08 20-51-31

Finally, the removing action operates with the key/values pairs so.

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

No branches or pull requests

0 participants