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

Adding sender signature details in block #144

Merged

Conversation

maneeSHA-256
Copy link
Contributor

@maneeSHA-256 maneeSHA-256 commented Apr 30, 2024

Here we are adding sender signature details to the token chain block where the details include the following fields:

  1. NLSS_share : sender's NLSS private share
  2. Private_sign : sender's signature using private key (BIP sign in case the sign version is 0)
  3. DID : sender did
  4. Hash : signing data
  5. SignVersion : 0, if signed using BIP signing scheme, and
    1, if signed using NLSS signing scheme

The numeral key assigned to the Sender Signature filed is "12". Shown below are the structures of a block in a dumped token chain with sender signature filed in two different scenarios.

Basic mode sender did with NLSS signature:

{
        "2": "02",
        "8": {
            "bafybmiezxgksjnhbz42fgkj3rm5tksvpve2cd4bnyaxkpgpjljy766eumu": [
                {
                    "1": "QmaEpHqXEzQTryeR9GSwmxbAFYjRUNF69s16DKWGt654hh",
                    "2": 3,
                    "3": "4-5b9eb9ae869b9e23c848bae7242d4f167410fbd26d0cbc6051520f4ffb5dfcfd"
                }
            ]
        },
        "3": "bafybmihhyp7jdwcxlq4dqfcjzjwhqob2qugi2hxp6jaytll6mcjhoagar4",
        "5": {
            "6": {
                "QmUe9wbro6D1ZW6Q8QbPTHJpR6yWC7NTecmnUfo6uVSHaf": {
                    "1": 3,
                    "4": "1",
                    "5": "0-dea1c222708287fe3e394c191c84a174f07bf5aeae923ec97e2871d771b823bc"
                }
            },
            "1": "bafybmifvz3lez66vbenw45c2zbtpjrk6zdp5nxrsbf64pm46wfq35zb53m",
            "2": "bafybmihhyp7jdwcxlq4dqfcjzjwhqob2qugi2hxp6jaytll6mcjhoagar4",
            "4": "5bb5811032953c3cb0f5fe6497ceeff08d3c883eea50e4b570357204c88ed34f"
        },
        "6": "a3613159014ea46131006132006133a36131783b62616679626d6966767a336c657a36367662656e77343563327a6274706a726b367a6470356e78727362663634706d343677667133357a6235336d6132783b62616679626d6968687970376a647763786c7134647166636a7a6a7768716f62327175676932687870366a6179746c6c366d636a686f61676172346134a1782e516d5565397762726f3644315a5736513851625054484a705236795743374e5465636d6e55666f36755653486166a46131036132783b62616679626d6966767a336c657a36367662656e77343563327a6274706a726b367a6470356e78727362663634706d343677667133357a6235336d61337842302d646561316332323237303832383766653365333934633139316338346131373466303762663561656165393233656339376532383731643737316238323362636134f93c006134f93c0061325880a1783b62616679626d6966767a336c657a36367662656e77343563327a6274706a726b367a6470356e78727362663634706d343677667133357a6235336d784032643033653933393136393365333361633230363933393361636137643162666265393461633063333630653336616661363065376233656134653362663666613358cea1783b62616679626d6966767a336c657a36367662656e77343563327a6274706a726b367a6470356e78727362663634706d343677667133357a6235336d788e33303435303232313030613930613634623937336238653535346534613561633266353837316536316138336134643662356535626165343236626136376434643932323564663162663032323035353530383231363261323664303962643966663537373834386562616537653165356332666530336533393935386462306263373336306432643534666239",
        "7": [
            {
                "priv_signature": "304402203de81987ab12e29decd43a8a7faf1368d6b7c6923828bf1b193ec5eb0954cb3902206089e202d0bf50cf1a43e29967a71eace0607533468d29542312d97d6748d8e5",
                "did": "bafybmibkd3luskhmwrwn3wj534kxtjc3s774ewffhruyzfkwlbt2kronly",
                "hash": "",
                "sign_type": "1",
                "signature": "94a3409bda9be98c8ce943e83a574c57d2fb4a3d4b952b93f3937db22bcae940"
            },
            {
                "did": "bafybmigwtyyopxeajusih3dhuddkr5ylmqoae3pib74pzek24slhwkrwd4",
                "hash": "",
                "sign_type": "1",
                "signature": "4acfa7a1a79e9a639a589a1dbf58d5751fdbdea90d3ffedb4cb6b6e1badb280b",
                "priv_signature": "3045022100f6173e05072bb7aee9f4c01bdfc2bb03be645ccf9652f6ba27b58303d589001b0220534466b6d815f0ba6f81b7df58a9df591b877637ee944e88669551b0c35af663"
            },
            {
                "signature": "0e16ed7ca949f509dc09740947590ad559256446e4af1c4ac68024edefee0dae",
                "priv_signature": "3045022100ac3d9e2b8da6453356f069af5453c223934ac3ee7d9a755df454406e9e6935b602202544b41b63ed48ea7335eedfeecf41ce617111a19b638edfa52da2b4e47ca1a1",
                "did": "bafybmidofktaoh756ddtzp5xobbwjwgaemq3ano6qlnznz7hu2ktsg3ary",
                "hash": "",
                "sign_type": "1"
            },
            {
                "hash": "",
                "sign_type": "1",
                "signature": "9730f346e582a4e5f2d86b62e02e932ea8f1e0954880f1a3b24432acfb07ac41",
                "priv_signature": "3046022100e29c71af40946a0a34b28ed2ff04e35c1b5df2f84265a3c0ffe32d7734bb0c72022100953390eb986ce6c05755c6d3a5b5a5da3f4dbc32d920ef3c04fe5ece7f39aa11",
                "did": "bafybmiezxgksjnhbz42fgkj3rm5tksvpve2cd4bnyaxkpgpjljy766eumu"
            },
            {
                "priv_signature": "30450221008cc14e73afb4d3e35415edf37b31b52f530268d2d20e9df888c37b3940770717022026e57fc2a754f62d8ea7cb1e178f4cdd5a52f7739f58fe2763f882490c647a4a",
                "did": "bafybmihdukpykm72y3dvbga6n6vvvglunzhn4zgdoky3xgo6zqymrprvlm",
                "hash": "",
                "sign_type": "1",
                "signature": "c541210d95c00dd242c6bc6bb520b51948f9cbcb6fcbc9b55f850dddc7d95f4f"
            }
        ],
        "11": [],
        "12": {
            "priv_signature": "3045022100a90a64b973b8e554e4a5ac2f5871e61a83a4d6b5e5bae426ba67d4d9225df1bf0220555082162a26d09bd9ff577848ebae7e1e5c2fe03e39958db0bc7360d2d54fb9",
            "nlss_share_signature": "2d03e9391693e33ac2069393aca7d1bfbe94ac0c360e36afa60e7b3ea4e3bf6f",
            "hash": "65d59f427887858a493604d4df8b601cef1ee33c20e361828f22b94c3bc8ff97",
            "sign_type": 1,
            "sender_did": "bafybmifvz3lez66vbenw45c2zbtpjrk6zdp5nxrsbf64pm46wfq35zb53m"
        },
        "99": {
            "bafybmiezxgksjnhbz42fgkj3rm5tksvpve2cd4bnyaxkpgpjljy766eumu": "304502203901c2df97a6de29c0eec2b08937b686d6e7450ec75f6838b1b981590987bb07022100ab20f8a81670943f443bff2394fb9f9d28a836c77c8adb5ef414d642920ee529"
        },
        "98": "816f69d8aad763b4d5dedc9a718d75c180e0b9af3797af022b655336e82ee11d"
    }

Light mode sender did with BIP signature:

{
        "7": [
            {
                "sign_type": "0",
                "signature": "",
                "priv_signature": "3046022100a6d25495edcbfb0f39c00669d4ff740c1ab4bcbb64c9e7d6074c3f37824e85be022100d556612620c1a98f468f7668321ef724b4326ba01bd91d6105c0fb2d37daaa52",
                "did": "bafybmiaaj2ptb3x627xkmy6j2tgfayhovrogtaakbhuq7v4k7puiwe3yoy",
                "hash": ""
            },
            {
                "did": "bafybmidlhtl2xao5cqzofuex5z2sgrxspgh4egtkk65comhpdahjlbl4li",
                "hash": "",
                "sign_type": "0",
                "signature": "",
                "priv_signature": "3046022100d80df35306416c36a2b404120533780324f173c326e45e77ad3d1bb3486076d302210080700c37be2e3dc5fc950189beb27f39514d9536a63ab8f4be76fdaebd6aa336"
            },
            {
                "sign_type": "0",
                "signature": "",
                "priv_signature": "3046022100ea2029b7ff6c87ae60cd566fb424fdf330c775683b52fdca10d50c47323b6a05022100de5ffec998afdb363076cfabaab276bc1e58ddc5598b3d9f325de151d08365ce",
                "did": "bafybmiajgsh7zy4js56wfhnnq45kfoknhuxtumw2yscgtwzsa3wb6mg5jq",
                "hash": ""
            },
            {
                "did": "bafybmihvbl2htcegx5osbufmv3rvjomyjrbpybej7wkrc53cgaszxwbkni",
                "hash": "",
                "sign_type": "0",
                "signature": "",
                "priv_signature": "3046022100e91e4dd4605f3021fb037e48d0b7e45f44bd2bae8a42bc4e8ddc1868fd2ebd45022100be45639b5ee9c74644418f6c24b4d28c6b88a3a8baa2f2845c52cac70c467e2b"
            },
            {
                "did": "bafybmifccida6vjfzh7d2rv3xwvny6dzvvobqhklqgmvew7q3cldpbam6m",
                "hash": "",
                "sign_type": "0",
                "signature": "",
                "priv_signature": "304502210088cfc4ab0372850579d90240529a010ed8b0dcd650ead90e4c9e2e18acb923030220482b446c911427b10058f34b62e211a3e423d0158cf989744657319c30957bc9"
            }
        ],
        "12": {
            "sign_type": 0,
            "sender_did": "bafybmiapjcgohsznx3svkntjffu5w6kzvisjoulc2srs4dafbyx37pdwny",
            "priv_signature": "3044022049c460444e16899c89eb86ac449a5cfa7b5c63623027bff7a702b7bcba2208f70220026f6094a704dea4d58f580d01219a020dc65a35eff16a12f03d13c9c6a71a75",
            "nlss_share_signature": "",
            "hash": "2f6eb99d8a15222744fe66376d9578ab201b22f3aaaf7c1d3c1d091822598819"
        },
        "99": {
            "bafybmiajgsh7zy4js56wfhnnq45kfoknhuxtumw2yscgtwzsa3wb6mg5jq": "30450221008bcb669140f613dacf8c4ce4513979f4f8b92986762f5035f895ed7f2e1c8267022061b2e9f20538592d4c5614d44f78663c17f2ee3a147d84e50fa7509bf93e20ae"
        },
        "2": "02",
        "5": {
            "1": "bafybmiapjcgohsznx3svkntjffu5w6kzvisjoulc2srs4dafbyx37pdwny",
            "2": "bafybmifhmdlxxekkddaqejq53kzlv7wai3tyqfhdmdptumz6mpur5dvsg4",
            "4": "77caf2e16ef6ba9782fdf0df58a5173492e91e4108159cfef8327939d7641a0f",
            "6": {
                "QmQ5iStGZ61uGf9e1mYr75Kwk24aueou6avZSFPHvyBov2": {
                    "1": 5,
                    "4": "2",
                    "5": "1-f1d6c863aa805c4ade65ec985fbe44dc9ee5edbf3cfad2a688ead06179883546"
                },
                "QmbzczHDR15e2zUQkELXnhdireSVJuZPy6UScyk3Fsm8Tv": {
                    "1": 3,
                    "4": "2",
                    "5": "1-55a3da081dfa6ec2d6ad8a9e9059e5e43e7954cda0b35b85ce9aba2f1b32034d"
                }
            }
        },
        "6": "a3613159020ca46131006132006133a36131783b62616679626d6961706a63676f68737a6e783373766b6e746a6666753577366b7a7669736a6f756c63327372733464616662797833377064776e796132783b62616679626d6966686d646c7878656b6b64646171656a7135336b7a6c7637776169337479716668646d647074756d7a366d7075723564767367346134a2782e516d5135695374475a36317547663965316d597237354b776b32346175656f753661765a534650487679426f7632a46131056132783b62616679626d6961706a63676f68737a6e783373766b6e746a6666753577366b7a7669736a6f756c63327372733464616662797833377064776e7961337842312d663164366338363361613830356334616465363565633938356662653434646339656535656462663363666164326136383865616430363137393838333534366134f93800782e516d627a637a484452313565327a55516b454c586e686469726553564a755a507936555363796b3346736d385476a46131036132783b62616679626d6961706a63676f68737a6e783373766b6e746a6666753577366b7a7669736a6f756c63327372733464616662797833377064776e7961337842312d353561336461303831646661366563326436616438613965393035396535653433653739353463646130623335623835636539616261326631623332303334646134f93c006134f93e006132583fa1783b62616679626d6961706a63676f68737a6e783373766b6e746a6666753577366b7a7669736a6f756c63327372733464616662797833377064776e7960613358cca1783b62616679626d6961706a63676f68737a6e783373766b6e746a6666753577366b7a7669736a6f756c63327372733464616662797833377064776e79788c3330343430323230343963343630343434653136383939633839656238366163343439613563666137623563363336323330323762666637613730326237626362613232303866373032323030323666363039346137303464656134643538663538306430313231396130323064633635613335656666313661313266303364313363396336613731613735",
        "98": "e414c4d34c7ebbbd102807c0051c65d581036a71d5d5938329ea70234e684de9",
        "3": "bafybmifhmdlxxekkddaqejq53kzlv7wai3tyqfhdmdptumz6mpur5dvsg4",
        "8": {
            "bafybmiajgsh7zy4js56wfhnnq45kfoknhuxtumw2yscgtwzsa3wb6mg5jq": [
                {
                    "1": "QmeJgFRTLp5SbaMiZwFkC31SYtCXc1f451WYht1zaizb6F",
                    "2": 3,
                    "3": "2-06bbff0f548991bab2390cfa8de9e67f8a48d177cbc9379fccc6024fabccbd00"
                },
                {
                    "1": "QmfQPkQLxcLoo1K7teT8L8ojkSyYpYPo6KNT3Nwf7KqdD1",
                    "2": 5,
                    "3": "0-224c7929a38bcbdccb1bff54410f08e312331372c1954dd48c37e974f535b83a"
                }
            ]
        },
        "11": []
    }

@thewebchap
Copy link
Member

thewebchap commented May 16, 2024

Error while parsing the json file . Can you make sure it's in proper json format?
Parse Error at : ."1":"05"}},{"7":["{"signature":"","priv_

P.S : I think this is an existing issue predating this PR.

@maneeSHA-256 maneeSHA-256 force-pushed the maneesha/sender-signature-in-block-with-signVersion branch from 8bad32c to bd7b94c Compare May 22, 2024 05:37
@maneeSHA-256
Copy link
Contributor Author

Error while parsing the json file . Can you make sure it's in proper json format? Parse Error at : ."1":"05"}},{"7":["{"signature":"","priv_

P.S : I think this is an existing issue predating this PR.

fixed

@thewebchap thewebchap merged commit 9f1b5fa into development May 24, 2024
3 checks passed
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