Skip to content

v0.0.18

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 01 Aug 14:59
e1b6b9a

Release Notes

Periodic Pledging

In this release, we have replaced the current pseudo Proof-of-Work based unpledging with Periodic Pledging. This feature will provide a better tokenomics for pledge validators allowing them to quantify the expected returns with respect both time and space factors.

Time based Pledging

For each transaction, Quorums pledge tokens for a period of 7 days. After this period, the Quorums can unpledge their tokens via the CLI/API. Upon successfully pledging for 7 days, the Quorums earn a credit. If the transaction tokens experience a state change before 7 days, the pledged tokens become eligible for unpledging, and the credits earned are proportional to the number of days the tokens were pledged.

CLI:

./rubixgoplatform run-unpledge -port <server node port>

API:

POST: /api/run-unpledge

Params: No params

While transferring tokens, the sender informs the previous quorums to unpledge the previous token state, since the new quorums who are validating the current transactions, are going to Pin this state. The previous quorums, upon receiving this message from sender, proceed the remove the related records from TokenStateHash table.

Whenever the unpledge process is executed, we loop through the UnpledgeSequence table and for each transaction, we check if the records (associated with the transaction id) are present in the TokenStateHash table. If yes, then we proceed to unpledge tokens. If no, then we skip it.

Quorums can use the following commands to check all pledge tokens and their respective TokenStates that they have pledged for, as well as, check if a particular token state is exhausted or not.

Query Pledge Token States:

CLI:

./rubixgoplatform getpledgedtokendetails -port <server node port>

API:

GET: /api/get-pledgetoken-details

Params: No params

Check if Token State is Pinned:

CLI:

./rubixgoplatform checkpinnedstate -tokenstatehash <Token State Hash> -port <server node port>

API:

DELETE: /api/check-pinned-state

Query Params:
- tokenstatehash: Token State Hash

Self Transfer

To ensure continuous pledging for transaction tokens and the pinning of their token states after the 7-day pledge period, we have introduced the concept of Self Transfer. This is a pseudo state change where the sender and receiver are the same. Since it is treated as a transaction by the protocol, Quorums proceed to pledge and pin the previous state of the transaction tokens. This is an externally triggered process.

The CLI and API structure is similar to a general RBT token transfer, except that only the sender's DID and transaction type need to be provided.

CLI:

./rubixgoplatform self-transfer-rbt -senderAddr <sender DID> -transType <transaction type> -port <node server port>

API:

POST: /api/initiate-self-transfer

Request Body:
{
  "sender": "<sender DID>",
  "type": "<transaction type>"
}

NOTE: Similar to the RBT Transfer API (/api/initiate-rbt-transfer), you need to call the Signature Response API (/api/signature-response) after calling the Self Transfer API

Unpledging of PoW-based pledge tokens

Since we are moving away from psuedo PoW-based pledging from this version, we have introduced a CLI/API to unpledge those tokens which were pledged as part of PoW-based pledging. This CLI/API loops through all tokens present in unpledgequeue table (if present) and unpledges them by adding an unpledge block to the tokenchain and changing their status in TokensTable to Free, following which the unpledgequeue table is dropped. Henceforth, information about new pledge tokens are reflected in the new UnpledgeSequence table.

CLI:

./rubixgoplatform unpledge-pow-pledge-tokens -port <node server port>

API:

POST: /api/unpledge-pow-unpledge-tokens

Params: No params

Account Recovery

We have introduced the following features which come together to facilitate Account Recovery

Importing BIP-39 based DIDs through Mnemonic

When a DID is created using the BIP-39 mode, the mnemonic is usually stored in the respective DID's directory as a .txt file. Users can take backup this mnemonic, and at any point of time can regenerate/import the DID using the same mnemonic string.

Inorder to recover DID and key pairs, backup the mnemonickeyfile in a seperate folder and call createdid with -didType 4 -mnemonicKeyFile /pathtomnemonickeyfile. This will create the same master key and key pairs.

./rubixgoplatform createdid -didType 4 -mnemonicKeyFile mnemonic.txt

Pinning Service

The pinning service enables token owners to pin their tokens on a pinning node on their behalf. The token's ownership remains unchanged; however, the pinning node will have all the information about the pinned token and its token chain. This is an important step towards protocol adoption in Lite nodes (Mobile , IoT like devices that doesnt either remain online all the time or have storage constraints). The pinning service also brings an oppotunity for our community to build a delegated Proof-of-Pledge algorithm , where even Lite nodes can earn partial credits.

For Pinning Token on User's Behalf:

CLI:

./rubixgoplatform pinToken -senderAddr <sender DID> -pinningAddress <Pinning DID> -transComment <comment> -transType <transaction type> -port <node server port>

API:

POST: /api/initiate-pin-token

Request Body:
{
    "pinningNode":"<Pinning DID>",
    "sender":"<Sender DID>",
    "comment":"<Comment>",
    "type": <Transaction Type>,
    "password":"<Password>"
}

For Token Recovery:

CLI:

./rubixgoplatform recoverToken -senderAddr <Sender DID> -pinningAddress <Pinning DID> -port <node server port>

API:

POST: /api/recover-token

Request Body:
{
   "pinningNode": "<Pinning DID>",
   "sender":"<Sender DID>"
}

Manual Peer detail registeration and Address format change

To transfer a token to a receiver, the sender must now manually add the receiver and type 2 quorum details by providing the PeerID, DID, and DIDType. This can be done either through a direct API call or via the CLI. Manually adding these details ensures that only the required peers are included, as opposed to populating the database with all peers in the network, which was previously done through RegisterDID. The addition of peer details should be performed when a node is connecting to the peer node for the first time..

CLI:

$ ./rubixgoplatform addpeerdetails -port 20006

Enter PeerID : 12D3KooWQ2as3FNtvL1MKTeo7XAuBZxSv8QqobxX4AmURxyNe5mX
Enter DID : bafybmicro2m4kove5vsetej63xq4csobtlzchb2c34lp6dnakzkwtq2mmy
Enter DID Type : 4
2024-05-22T16:41:02.681+0530 [INFO]  Main: Peer added successfully

$ ./rubixgoplatform addpeerdetails -port 20006 -peerID 12D3KooWQ2as3FNtvL1MKTeo7XAuBZxSv8QqobxX4AmURxyNe5mX -did bafybmicro2m4kove5vsetej63xq4csobtlzchb2c34lp6dnakzkwtq2mmy -didType 4

API:

POST: /api/add-peer-details

Request Body:
{ 
	"peerid": "12D3KooWJUJz2ipK78LAiwhc1QUVDvSMjZNBHt4vSAeVAq6FsneA", 
	"did": "bafybmics43ef7ldgrogzurh7vukormpgscq4um44bss6mfuopsbjorbyaq", 
	"didtype": 0 
}

There has been change in address format from PeerID.DID to DID.

When a node, say Alice, connects to another node, Bob, to check Bob's peer status (using the getPeer function) or to fetch Bob's DIDType for token ownership validation (using the GetPeerdidType_fromPeer function), Alice will now share her details (PeerID, DID, and DIDType) through the same API used for fetching Bob's status or DIDType. Bob will register or update Alice's details in the SQLite database in the DIDPeerTable if they are not already registered or need updating. This improvement will streamline peer connections and reduce the extra work of manually registering peers.

Distributed Pledging

During a transfer, the pledged amount from each quorum varies based on the availability of tokens within that quorum. To ensure equal participation, the total pledge amount is divided equally among all quorums, resulting in the same pledge amount for each. If the division of the pledge amount by the number of quorums results in a value with more decimal points than allowed, the value is rounded up to the maximum permitted decimal places. For instance, a pledge value of 0.1234 would be rounded to 0.124.

Adding Initiator Signature to block structure

An initiator is the one who is initiating the transaction, in case of RBT transfer it is the sender, in case of smart contract deploy it is the deployer and in case of smart contract execution it is the executor. This feature will include any initiator's signature in the corresponding block. Here we are adding Initiator Signature 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 Initiator Signature field is "12". Shown below are the structures of an Initiator Signature in a block in a dumped token chain in different scenarios.

RBT Transfer:

Basic mode sender did with NLSS signature:

"12": {
    "priv_signature": "3045022100a90a64b973b8e554e4a5ac2f5871e61a83a4d6b5e5bae426ba67d4d9225df1bf0220555082162a26d09bd9ff577848ebae7e1e5c2fe03e39958db0bc7360d2d54fb9",
    "nlss_share_signature": "2d03e9391693e33ac2069393aca7d1bfbe94ac0c360e36afa60e7b3ea4e3bf6f",
    "hash": "65d59f427887858a493604d4df8b601cef1ee33c20e361828f22b94c3bc8ff97",
    "sign_type": 1,
    "initiator_did": "bafybmifvz3lez66vbenw45c2zbtpjrk6zdp5nxrsbf64pm46wfq35zb53m"
},

Light mode sender did with BIP signature:

"12": {
    "sign_type": 0,
    "initiator_did": "bafybmiapjcgohsznx3svkntjffu5w6kzvisjoulc2srs4dafbyx37pdwny",
    "priv_signature": "3044022049c460444e16899c89eb86ac449a5cfa7b5c63623027bff7a702b7bcba2208f70220026f6094a704dea4d58f580d01219a020dc65a35eff16a12f03d13c9c6a71a75",
    "nlss_share_signature": "",
    "hash": "2f6eb99d8a15222744fe66376d9578ab201b22f3aaaf7c1d3c1d091822598819"
},

Smart Contract Deploy:

Deployer signature in smart contract deploy block:

"12": {
    "sign_type": 0,
    "initiator_did": "bafybmicyxi3fqwpgxnerlntu6ynsn7vwtf75rjxxse4pezr2jrcoxwg7qm",
    "priv_signature": "3046022100d95a5eb1a77e345f6759fb5b874eab4434be314f0398b54371b8f133b4655af4022100c5701a991d3d47fe9ab46531ddb8210092c0a2d2f85b193b7b0cc07c87eafa99",
    "nlss_share_signature": "",
    "hash": "a25fcf60d0daf91c522358740b987331e531a186226ac3c8727d2e2d64fc0d95"
}

Smart Contract Execution:

Executor signature in smart contract execute block:

"12": {
    "hash": "f52100f9b883a03ece23f961c894e2a6bb1874f59c133c21009effe44df76f34",
    "sign_type": 0,
    "initiator_did": "bafybmihd273wcr6qm76qzflqo2dv2antpyd6xgyvy7ywgmzkulw4o3mshq",
    "priv_signature": "304602210097b57becf69cb6b80cbfa5875fe69aacef8dbe591a261afbf7f7ce49a4f1e3c6022100b1a9e2411e978f3071f1a38a0767d1379a0672884a6333c33da57b1d15fcbbbb",
    "nlss_share_signature": ""
}

Changelog

  • 3fc3244 Add Feature : Pinning as a service
  • 971e794 Add MinDecimalValue() function & minTotalPledgeAmount variable.
  • 35d1998 Add QuorumRequired const. and change in GetFinalQuorumList() func
  • f6fadf7 Add api and cmd : quorum-setup-check
  • 6b0e2a9 Add feature: Recover token and token chain
  • ffcc77c Add fix: passing random uuid for signature
  • acd7f6a Add function moveFile
  • 55aa965 Add minimum pledge amount fix
  • 94c6a46 Add minor fix
  • 4af4610 Add missing MaxDecimalPlaces
  • a3d8123 Add parts token unpledging & Fix : Pledge token sending
  • 0be3476 Add proper error messages
  • 1db36df Add swagger [initiate-pin-rbt]
  • afabefe Add typoerror fix
  • 4b46439 Add variables and equal distribution
  • a289364 Adding Peer Details Manually
  • 4d16a67 Adding sender signature details to block
  • 1c604dd Change error message
  • 9de8aab Change from single qrm tokens unlock to all qrms tokens unlock
  • 064d1dc Change in maxDecimalPlaces and string formatting
  • 96455d3 Change passing of tknType varible
  • 4680091 Change passing of tknType varible
  • 17da864 Fix : Consensus request to selected quorums only- Alternate Quorums
  • 5d9a84e Fix : Consensus request to selected quorums only- Alternate Quorums W/O comment
  • 7b5520e Fix : Pinning node able to transfer pinned token
  • b7eaceb Fix : invalid tokenchain block
  • 81dbe08 Fix DID mode compatibility issue
  • ac7ec7a Fix typo error
  • 74f9cc3 Fix: Changes respective to rebase
  • d400d89 Fix: Missed params and checks during rebase
  • a3c18d4 Fix: Quorom Status Check [Working]
  • 5031ea3 Fix: flag quorumAddr not found [Add debug : WIP-Breaking]
  • 2bd283e Fix: minor typo
  • 91de45e Fix: when rbtamount is not specified the entire tokens will be pinned
  • 4580632 Increase test script wait time to 80s
  • e06a858 Merge branch 'arnab/fix-self-transfer-cmd' of https://github.com/rubixchain/rubixgoplatform into vaishnav/fix/changeInDecimalPoint
  • 258f12e Merge branch 'ashita/QuorumCheckforPledgedTokenState' into ashita/testingPeerAddQuorumPledging
  • df642c8 Merge branch 'ashita/QuorumCheckforPledgedTokenState' of https://github.com/rubixchain/rubixgoplatform into arnab/periodic-pledging
  • b75cbeb Merge branch 'ashita/QuorumCheckforPledgedTokenState' of https://github.com/rubixchain/rubixgoplatform into ashita/QuorumCheckforPledgedTokenState
  • 0a303dc Merge branch 'ashita/QuorumCheckforPledgedTokenState' of https://github.com/rubixchain/rubixgoplatform into ashita/QuorumCheckforPledgedTokenState
  • 88b5cad Merge branch 'development' into ashita/QuorumCheckforPledgedTokenState
  • d9d5ba4 Merge branch 'development' into ashita/adding-peer-details
  • 9de2633 Merge branch 'development' into maneesha/sender-signature-in-block-with-signVersion
  • 505f3ff Merge branch 'development' into maneesha/sender-signature-in-block-with-signVersion
  • 1469f77 Merge branch 'development' into vaishnav/fix/DistributedPledging
  • da023e8 Merge branch 'development' of https://github.com/rubixchain/rubixgoplatform into arnab/periodic-pledging
  • 5c24a19 Merge branch 'development' of https://github.com/rubixchain/rubixgoplatform into arnab/periodic-pledging
  • 78af08f Merge branch 'development' of https://github.com/rubixchain/rubixgoplatform into ashita/QuorumCheckforPledgedTokenState
  • 2599f3e Merge branch 'development' of https://github.com/rubixchain/rubixgoplatform into ashita/QuorumCheckforPledgedTokenState
  • 94f8975 Merge branch 'development' of https://github.com/rubixchain/rubixgoplatform into ashita/adding-peer-details
  • f0ae2f3 Merge branch 'vaishnav/fix/partsTokenUnpledging' of https://github.com/rubixchain/rubixgoplatform into vaishnav/fix/partsTokenUnpledging
  • 9f1b5fa Merge pull request #144 from rubixchain/maneesha/sender-signature-in-block-with-signVersion
  • cd83262 Merge pull request #153 from rubixchain/vaishnav/fix/partsTokenUnpledging
  • eed2610 Merge pull request #161 from rubixchain/ashita/adding-peer-details
  • 6e0d6cd Merge pull request #169 from rubixchain/main
  • 5f7d9d5 Merge pull request #170 from rubixchain/maneesha/DIDModeCompatibility
  • 86ac9de Merge pull request #171 from rubixchain/hari/change-peeriddid-to-did
  • 045b632 Merge pull request #173 from rubixchain/vaishnav/fix/DistributedPledging
  • 9296650 Merge pull request #174 from rubixchain/hari/mnemonicfile-check
  • 805d02b Merge pull request #175 from rubixchain/hari/mnemonicfile-check
  • d489e49 Merge pull request #176 from rubixchain/maneesha/ping-peer-improvement-new
  • 470901d Merge pull request #177 from rubixchain/hari/type1-quorumselection
  • 7b8a65b Merge pull request #178 from rubixchain/arnab/hotfix/add-license
  • c49223a Merge pull request #179 from rubixchain/main
  • b3bc97b Merge pull request #180 from rubixchain/maneesha/fix-smartcontract-deploy-error
  • 6a33374 Merge pull request #183 from rubixchain/sai/sc-rename-error
  • dc52983 Merge pull request #187 from rubixchain/ashi/parametersvalidation
  • fea068a Merge pull request #189 from rubixchain/feat/allen/pinning-service
  • 0a8fc7b Merge pull request #191 from rubixchain/arnab/periodic-pledging
  • d566e17 Merge pull request #192 from rubixchain/maneesha/fix-smart-contract-bugs
  • b98e084 Merge pull request #193 from rubixchain/hari/distribured-pledging-fix
  • b351d61 Merge pull request #197 from rubixchain/arnab/rpeerid-variable-assignment-fix
  • fe88606 Merge pull request #198 from rubixchain/MinorFixes
  • 9690056 Merge pull request #199 from rubixchain/arnab/change-test-swarm-key-dir
  • 7974a20 Merge pull request #200 from rubixchain/vaishnav/fix/changeInDecimalPoint
  • 6664705 Merge pull request #201 from rubixchain/arnab/fix-self-transfer-cmd
  • c8d86bd Merge pull request #202 from rubixchain/arnab/bump-version-number
  • 5ccbd47 Merge pull request #203 from rubixchain/arnab/fix-self-transfer-server-handle
  • e1b6b9a Merge pull request #204 from rubixchain/development
  • 1cb07f8 Merge remote-tracking branch 'origin/development' into vaishnav/fix/partsTokenUnpledging
  • de674f7 Modify the condition statement
  • 19e19ce Remove MinTrnxAmt constant
  • 5373cd0 Remove comment
  • c14f3d7 Remove debug and minor fixes
  • 812b27e Remove debug log
  • 083c9b1 Remove extra codes and optimization
  • 522428e Remove extra comments
  • 47cef17 Remove hardcoded quorum count
  • 535fbd1 Remove loggers used for testing
  • afc9eac Update cmd and api nomenclature
  • 63866b5 Update command.go
  • 9da8b33 Update quorum unavailability error
  • b24fa9c Update quorumlist to support Alternate quorum
  • c8cb7c3 Updating swagger and readme
  • 24fea47 [skip actions] add LICENSE
  • a625f8c add initiator sign to block and other fixes
  • d5d39f6 added CLI/API to unpledge POW based pledge tokens and drop the unpledgequeue table present in rubixgoplatform node versions v0.0.17 and earlier
  • 8e9174b added OS alias in artifact name
  • be28e17 added check to skip tokens, part of PoW pledging, for self transfer operation
  • 3d12ffa added checks and instructions to support execution in windows os
  • 9e2f1bd added dockerfile for running tests in ubuntu-amd64 environment
  • 70df360 added entry for .sh file extension
  • bb850f6 added func to get the build dir based on the target OS
  • d96cdd6 added node_registry.json config to list all the node server indeces; run_non_quorum_nodes is removed
  • c6ad83e added script to collect all quorum and non-quorum logs; added step in test workflow to upload the node logs as artifacts in Github Action sessions
  • c425be1 added test scenario for BIP39 and NLSS transfers
  • 9e9fce9 added timestamp for node log artifacts
  • 82335a2 adding checks at API side and updating CheckQuorumStatusCmd
  • f54bd20 adding ping-peer-improvement test cases to rbt-transfer test cases
  • e43aa46 adding pledged token state details at quorum side
  • af9ccf4 adding token state hash with the receiver
  • 431f0bf bump version from 0.0.17 to 0.0.18
  • bd7b94c change field name SignVersion to SignType
  • dcf3cd3 changed test swarm key
  • babff64 changing variable and function names
  • 130c3ba client side parameter validation checks
  • 23bf969 code update
  • 460c0f6 created three swarm keys for each os environment
  • 1c555b1 error handling for mnemonicfile
  • d635854 feat: added API endpoint and CLI command to fetch a node's peer ID
  • 2d02d77 feat: added python tests for RBT transfer
  • 026b79a feat: added test workflow
  • f269643 feat: periodic pledging implementation
  • e3cc03e fix for quorum length 5 to 7
  • b8e59a7 fix parse error in dump-token-chain
  • a0a4b52 fix smart contract deploy error
  • dc4c6cf fix wallet and standard mode issues
  • 8a80a32 fix: removed token count check from main initiateRBTTransfer func
  • 3cdc4ee fixed assignment for rpeerid variable
  • 82763c1 fixed pledging period
  • 7f52b6b fixed pledging period
  • f75ab3d fixed precision to MaxDecimalPlaces (currently 3) for RBT token value
  • c5679bb fixed swagger doc for token pinning and recover
  • 3c5de7f fixed swagger input by removing input params which were not necessary Self Transfer API by defining a seperate struct for user input; assigned reciever to be same as sender in the Self Transfer handle func
  • 1725932 fixed the pledge period variable
  • f404a07 fixed the query string for GetUnpledegeSequenceDetails func
  • 56d4be3 fixed the self transfer command by changing the TransferRBT client package call to SelfTransferRBT call
  • 17fb83a fixed the update of transaction_id in TokensTable
  • c4a2a6f fixed the validation to check RBT amount minimum value from 0.00001 to 0.001
  • 1f13749 formatting
  • 15c4a5c increased node liveness wait time to 40 seconds
  • 9190dbb informing old quorums about exhausted state post transfer
  • 992c505 issue with mnemonickey reading
  • 3af856a minor edits
  • b4be393 minor fixes
  • a37bb4a non quorums DIDs are now being registered for the RBT transfer transaction to happen successfully
  • 0590554 parse did to get cid digest and use this to calc lastchar
  • 586b7a5 ping peer to get peer did type
  • 8587afc read peerid from db and added tests
  • 54ae41e reduced node liveness wait time from 60 seconds to 15 seconds
  • f6f667e register while pinging a peer
  • 9ff1a40 remove delay in transfer finality when quorum have insufficient balance.
  • dbfb55e removed manual entering of DIDType
  • dc4e24e removed unneeded print statement
  • 8d37820 removing the debug statements
  • f1b8a71 removing unnecessary log
  • 8eb6e5c renamed test workflow artifiacts name
  • 5d115f8 resolving re-creation of smartcontract token
  • 6e0dc91 sender sharing quorums info with receiver and previous-pledged-quorum info with quorums
  • 790eec2 shifted the update logic of token state hash of tokens in TokensTable inside the TokenReceiver func, to remove the additional update operation
  • 2df83cc smart contract folder renaming error
  • 3225bde test
  • f0849cd tested port-unavailability-fix on MacOs
  • 331a88c tests: added generate swarm key inside tests/test_swarm_key dir to exclude from being added to the Git stagging area
  • a6074b9 tests: added random swarm key generation
  • ef02ead tests: generation of random test swarmkey when tests are run
  • a782594 token count condition fix
  • 0a8efff undo unintentional delete
  • 093646c updated Readme
  • 1666237 updated return error
  • c1c7c0a updating Readme
  • 620cd0b updating minor changes
  • aef69c2 updating readme
  • ef6759d updating test files to add peer details
  • 4429b25 updating test files with addpeerdetails command and removed registerdid