IoTone / TheShellProject

The Shell Project aims to build a viable general purpose blockchain written in Dlang, with attributes of security, ease of deployment, clear specification, ease of use for DAPPs, and multiple implementation interop
1 stars 1 forks source link

Project needs a standard approach for addresses #6

Closed truedat101 closed 3 years ago

truedat101 commented 6 years ago

Transactions and wallets have addresses. We need a standard way to handle addressing.

Please reference details of NEM addressing: https://docs.nem.io/en/address-components

Let's borrow the best parts of this for the time being as an approach. Please define an address struct that handles this format:

The address of an account is a base-32 encoded triplet consisting of:

network byte: is it an address on the testnet or the mainnet?
160-bit hash of the public key
4 byte checksum, for detection of mistyped addresses

NEM's address api is defined here: https://www.nem.ninja/org.nem.core/org/nem/core/model/Address.html

truedat101 commented 6 years ago

The good news is we have a nice reference of both a spec, a white paper, and a set of code that is well documented.

truedat101 commented 6 years ago

Add a unit test for the Address struct.

truedat101 commented 6 years ago

@pedroalvesbatista if you haven't started on this I can work on this.

truedat101 commented 6 years ago

Related to #9 . I think when #9 is done, we just need to take that data, and implement an Address struct or class.

truedat101 commented 6 years ago

Not really sure if we need an Address class, but might be useful for handling basic operations on address.

truedat101 commented 6 years ago

Punt out to proto3

pedroalvesbatista commented 6 years ago

Yeah, for addresses for now, yet, structs and basic ops should be enough. When working with peers and network maybe we need some class.

pedroalvesbatista commented 6 years ago

I added skeleton for functions to handle some basics of address approach. I will start to work more deeply on address while work on the hexdecimal hash generation.

truedat101 commented 6 years ago

Wait so if we can generate an address, isn't this 100% done?

truedat101 commented 6 years ago

I feel comfortable that we have a standard format. This is enforced by KeyPairFactory. Our spec/standard is: https://docs.nem.io/en/address-components

Marking this as done.

truedat101 commented 5 years ago

Actually, leave this open. The entire thing needs a test case. See accountcore.d.

truedat101 commented 4 years ago

Wow, accountcore.d is a mess. No structure and no actual work done.

truedat101 commented 4 years ago

ugg, seems like PB broke the dub.json.

truedat101 commented 4 years ago

A basic test case is done.