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

[Bitcoin] Handle Curse Inscription #1865

Merged
merged 14 commits into from
Jun 12, 2024
Merged

[Bitcoin] Handle Curse Inscription #1865

merged 14 commits into from
Jun 12, 2024

Conversation

baichuan3
Copy link
Collaborator

@baichuan3 baichuan3 commented Jun 11, 2024

Summary

  1. Handle curse inscription in contract, add inscription_number and sequence_number for inscription
  2. The contract has temporarily skipped the reinscription curse flag processing and needs to rely on scanning all SatPoint
  3. Change parent : Option<Vec<u8>> to parents: Vec<Vec<u8>> to support multi parents
  4. Reserved for extending the Rune protocol

Among them, 1 and 3 will break the framework.

@baichuan3 baichuan3 requested a review from popcnt1 June 11, 2024 12:44
Copy link

vercel bot commented Jun 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rooch-portal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 12, 2024 9:19am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
rooch ⬜️ Ignored (Inspect) Visit Preview Jun 12, 2024 9:19am

Copy link

github-actions bot commented Jun 11, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

@@ -495,7 +495,7 @@ module rooch_nursery::bitseed {

let tx = option::destroy_some(tx_option);
let input = types::tx_input(&tx);
let index = ord::input(inscription);
let index = ord::index(inscription);
Copy link
Collaborator Author

@baichuan3 baichuan3 Jun 12, 2024

Choose a reason for hiding this comment

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

从 Ord 协议层移除了 input 字段, @steelgeek091 确认下对 bitseed 的影响

Copy link
Collaborator

Choose a reason for hiding this comment

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

bitseed 合约没有用到 ord::input 方法

@baichuan3
Copy link
Collaborator Author

Origin Curse Inscription
(https://ordinals.com/inscription/9ebd3d475e84d09af14c83c8659bb5f0069747eddf594263a08f8e8ce7ab29b7i0)

Query from Rooch RPC

curl --location 'http://localhost:50051' \
--header 'Content-Type: application/json' \
--data '{
    "id": 101,
    "jsonrpc": "2.0",
    "method": "btc_queryInscriptions",
    "params": [
        {"inscription_id":{"txid":"9ebd3d475e84d09af14c83c8659bb5f0069747eddf594263a08f8e8ce7ab29b7", "index":0}}, null, "1", true
    ]
}'
 {
    "jsonrpc": "2.0",
    "result": {
        "data": [
            {
                "object_id": "0xd23c49fb9a742624498390a5b59c90e968c11d52b6437278a0e2eb9b82824103e5d94af06e9202a8fdb57404cc1f9f165cf39ad0ab8f84542509d9a80b0d2b76",
                "owner": "rooch16qw0q4mslclducvzw5k6ev2xvd0qhjjm9sahx3muktnqcvn9gs2s0hl93e",
                "owner_bitcoin_address": "bcrt1pawzg64nlfwtwds325cd0rwhxprz6y399qpyd9fdx52j0wwp7stlq3v9lgf",
                "flag": 0,
                "value": {
                    "txid": "0xb729abe78c8e8fa0634259dfed479706f0b59b65c8834cf19ad0845e473dbd9e",
                    "bitcoin_txid": "9ebd3d475e84d09af14c83c8659bb5f0069747eddf594263a08f8e8ce7ab29b7",
                    "index": 0,
                    "offset": 0,
                    "sequence_number": 19,
                    "inscription_number": 11,
                    "is_curse": true,
                    "body": "0x3c68746d6c3e3c686561643e3c6d65746120636861727365743d227574662d38223e3c7374796c653e626f64797b6d617267696e3a303b7d3c2f7374796c653e3c2f686561643e3c626f64793e3c7363726970743e0a74643d2748347349414d5346586d55434135315533302f624d42422b353638343859494449615346536f794f5361786934344739724441326254793473554d385574757948556f3739582b663766787743674e74713672453974313939393133352b51567a77775448504b3878495a4f63466e4f6348592f5242483832674c49424e6347354767694349585478696e52526e3151596e35396a4a7144753471766d4a77756559593458634131342b623454436d385250365a354e596259534e6d6942784755544c48457147737743714330336667466f6c377543526e427157522b3432337576515763706f704a6f316c514552577a536b335361616f7a587865557264444f396f37374e67774350344a34357971693674506c7a62796531334662664a544d493632787a2f3474766675454765434c424d734a65566b557243536f4137482b71314c616b415857464c747347347476627956546c4e5479565977543275432b515057614d453445597362526b7752513732356f4f79754d4448636e4c2f2f654f6e7a3530494263756a4d4171646a2b336f4c683239537439726271304768795a7a495368646534632f596773326e37685246486d61397465355249676f76476b61756e58644b564a78595a5a326e45735a532f49707968656430596730476469464e306e54554d3339377957775535746f314861557832502f2b4d4533725a766c43366f3535756944796876644746556b6c69517633614f305a59567157646c78434b566d4a7465375847655a52565a6b524372576f706d4257476548365571762f685871373872466f662b483068774d597568343079796947316c7a346a7454327341344f746b5a6259686f316648323242316f2b7a64616f4d65713761625a797436594247735377596331456152577a4d4f37647368324f52694831733830477542506c61696e397653784667484275634841413666375243637a45592b78556f7a466f5756426c33355a7470574f675a636d6b466f78347865326a3763735457524e4d43477172726a734e77484a416e63504b546d7a61687655435635615a6b3237383150415952506c7a643535464c4873524c7a5273492b622f746630626462336a757457746d3931474158394a3230353174795555482f664b3671315854556a4f79684b46497070544c715a476958742f626570377332416d4b356f7564477844467a4b734b61516e7a513763494b41776c4c733977617a4e44764c3975423834434946756544596a592b68766a313446476761676576372b676352686950557a7578453653456162504e4a6b394372615555447252762b317570346c474c79555946313352416f5a766c2b2f41555850326f645942774141273b0a66756e6374696f6e2066666c61746543616c6c6261636b28297b0a6e6577533d646f63756d656e742e637265617465456c656d656e74282773637269707427293b0a6e6577532e696e6e657248544d4c3d66666c6174652e73747246726f6d55382866666c6174652e67756e7a697053796e63286e65772055696e743841727261792841727261792e66726f6d2861746f6228746429292e6d6170282863686172293d3e636861722e63686172436f64654174283029292929292b223b66666c61746543616c6c6261636b322829223b0a646f63756d656e742e626f64792e617070656e644368696c64286e657753293b7d0a286173796e632066756e6374696f6e28297b0a726573703d617761697420666574636828602f636f6e74656e742f32646264663965626265633662653739336664313661653962373937633763663936386162323432373136366161663339306239306237313737383236366162693060293b0a68746d6c3d617761697420726573702e7465787428293b0a68746d6c4c696e65733d68746d6c2e73706c697428225c6e22293b0a66666c617465533d68746d6c4c696e65735b32385d3b0a7035723d617761697420666574636828602f636f6e74656e742f32353563653063356130643861636133393531306461373265363034656638383337353139303238383237626137623766373233623734383966336563336134693060293b0a7035533d60636f6e73742064333d22247b6177616974207035722e7465787428297d22603b0a666643533d2266666c61746543616c6c6261636b28293b223b0a6e6577533d646f63756d656e742e637265617465456c656d656e74282773637269707427293b0a6e6577532e696e6e657248544d4c3d5b66666c617465532c7035532c666643535d2e6a6f696e28223b5c6e22293b0a646f63756d656e742e626f64792e617070656e644368696c64286e657753293b7d2928293b0a3c2f7363726970743e3c2f626f64793e3c2f68746d6c3e0a0a",
                    "content_encoding": null,
                    "content_type": "text/html;charset=utf-8",
                    "metadata": "0x",
                    "metaprotocol": null,
                    "parents": "\"\"",
                    "pointer": null
                },
                "object_type": "0x4::ord::Inscription",
                "tx_order": 1,
                "state_index": 9188,
                "created_at": 1718184001985,
                "updated_at": 1718184001985
            }
        ],
        "next_cursor": {
            "tx_order": 1,
            "state_index": 9188
        },
        "has_next_page": false
    },
    "id": 101
}

@jolestar jolestar merged commit b3ea896 into main Jun 12, 2024
8 checks passed
@jolestar jolestar deleted the inscription_number branch June 12, 2024 13:27
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.

[Bitcoin] Handle Cursed Inscription
4 participants