Giter Site home page Giter Site logo

originalmy / originalmy-dapp-addresses Goto Github PK

View Code? Open in Web Editor NEW
9.0 6.0 0.0 17 KB

Public addresses for OriginalMy Dapps and smart-contracts (ETC/ETH)

License: Apache License 2.0

JavaScript 100.00%
ethereum classic blockchain originalmy authenticity addresses signature signing ethereum-classic ethereum-address ethereum-blockchain

originalmy-dapp-addresses's Introduction

OriginalMy Public ETC/ETH Addresses

On 2017-06-16 we moved signing contracts, document authenticity and id repositories smart-contracts to Ethereum Classic because the Ethereum prices, block times and disapearing transactions.

How to load under geth:

loadScript('<path>/contract_addresses.js')
loadScript('<path>/utils/utils.js')

Converting wallets

For saving space purposes, we decode bitcoin addresses from bs58 and store the hex representation. Bitcoin wallets normally uses 34 chars and because of that it cant fit on a bytes32 var.

Methods

Document Authenticity - DocAuth()

storeAuthenticity

docAuth.storeAuthenticity('SHA256')

Stores the authenticity (sha256) for a file

checkAuthenticity

docAuth.checkAuthenticity.call('SHA256')

Check the timestamp for documento authenticity stored

Document signing - DocSign()

newDocument

docSign.newDocument('SHA256', convertedSigners[], convertedWallets[])

Register a document, listing the signers (CPF Id's) with the wallets which will be used for signing

registerSignature

docSign.registerSignature('SHA256', SIGNER_INDEX, SIGNATURE)

Register the signature (created with OriginalMy LibCrypto) for a signer. You can check the SIGNER_INDEX using the method docSign.getSignerBySignerId.

checkCompleted

docSign.checkCompleted.call('SHA256')

Check if a document is already signed by all signers

checkDocSigner

docSign.checkDocSigner.call('SHA256', "0x"+toHex(CPF_ID)) 

Check if the signer already signed a document

checkTimestamp

docSign.checkTimestamp.call('SHA256')

Check the timestamp for a document authenticity stored

countSignatures

docSign.countSignatures.call('SHA256')

Count the total of signatures already registered for a document

countSigners

docSign.countSigners.call('SHA256')

Count the total of signers for a document

getSignerBySignerId

docSign.getSignerBySignerId.call('SHA256', "0x"+toHex(CPF_ID))

Read information for a signer for a document, using their CPF Id.

getSignerBySignerIndex

docSign.getSignerBySignerIndex.call('SHA256', INDEX)

Read information for a signer for a document, using the signer index

getSignerIdByWallet

docSign.getSignerIdByWallet.call('SHA256', "0x"+toHex(walletConverted))

Read information for a signer for a document, using their converted wallet information.

CPF Ids Repository - IdRepo()

newUser

idRepo.newUser(CPF_ID, 'WALLET')

Register a new wallet for a user (CPF Id)

checkUserByWallet

idRepo.checkUserByWallet.call('WALLET')

Returns the user_id (CPF Id) giving the wallet address

getLastWallet

idRepo.idRepo.getLastWallet.call(CPF_ID)

Returns the last wallet registered for a user

getWalletsFromUser

idRepo.getWalletsFromUser.call(CPF_ID)

Returns all wallets already used by an user

isWalletFromUser

idRepo.isWalletFromUser.call(CPF_ID, 'WALLET')

Check if a wallet belongs to an user (bool)

totalUsers

idRepo.totalUsers.call()

Return the # total of users registered

totalWallets

idRepo.totalWallets.call()

Returns the # total of wallets registered

originalmy-dapp-addresses's People

Contributors

eddieoz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.