Skip to content

Instantly share code, notes, and snippets.

@Wollac
Last active April 8, 2018 11:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Wollac/b02cacaee74e54f57b19f84684521c4a to your computer and use it in GitHub Desktop.
Save Wollac/b02cacaee74e54f57b19f84684521c4a to your computer and use it in GitHub Desktop.
Proposed Romeo Guard generic interface for security modules
class Guard {
constructor ({ ...anyArguments }) {
// Do the initialization work
// Arguments depend on the requirements of the specific Guard module.
}
// Returns: string
getSymmetricKey() {
// Returns the key for encrypting/decrypting arbitrary data.
// This is used to store keys/values securely in browser's cache and backups.
}
// Input: int, int
// Returns: string[]
getPages(index, total) {
// Return list of addresses representing ledger-pages
// In the future, additional similar function might be needed for
// other functionality (static addresses, debits, etc.). It will be like a second/hidden "ledger".
}
// Input: int
setActivePage(pageIndex) {
// A convenience function to set the corresponding page for all following calls of getAddress, getSignedTransactions.
// In the future a second parameter e.g. "purpose" could be added that might be needed for
// other functionality (static addresses, debits, etc.). It will be like a second/hidden "ledger".
}
// Input: int, int
// Returns: string[]
async getAddress (index, total) {
// Return list of subsequent addresses for the active page.
// The first returned address corresponds to the provided index.
}
// Input: list of transfer objects {address, value, tag}, list of inputs {address, keyIndex},
// change transaction object {address, keyIndex}
// Returns: string[]
async getSignedTransactions(transfers, inputs, remainder) {
// Returns array that contains the trytes of the new signed bundle ready to be PoWed.
// All keyIndex values are with respect to the current active page.
// See iota.api.prepareTransfers
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment