Software Development and Programming Careers (Official Discussion Thread)

Ethnic Vagina Finder

The Great Paper Chaser
Bushed
Joined
May 4, 2012
Messages
55,386
Reputation
2,965
Daps
156,687
Reppin
North Jersey but I miss Cali :sadcam:
sounds cool. what protocol are you using for p2p chat?
I don’t know yet. I’m in uncharted territory. I’m reading up on Erlang and WebSocket. Building the encryption/decryption core fried my brain. Then I spent a month trying to implement file drag/drop functionality before finally realizing you can’t do it with a web framework. I tried using a native Golang Front end framework but it was trash and deleted it. Trying to get all of the core features to handle large directories also took a lot of time. There was shyt even the AI didn’t know how to do :snoop: hopefully add the chat feature doesn’t take this long.
 

bnew

Veteran
Joined
Nov 1, 2015
Messages
62,932
Reputation
9,589
Daps
172,321
I don’t know yet. I’m in uncharted territory. I’m reading up on Erlang and WebSocket. Building the encryption/decryption core fried my brain. Then I spent a month trying to implement file drag/drop functionality before finally realizing you can’t do it with a web framework. I tried using a native Golang Front end framework but it was trash and deleted it. Trying to get all of the core features to handle large directories also took a lot of time. There was shyt even the AI didn’t know how to do :snoop: hopefully add the chat feature doesn’t take this long.

i strongly suggest you try more than one AI model and different prompts to get a acceptable responses.

protip: ask it why the code can't do something if telling it to implement something is failing.
 

Ethnic Vagina Finder

The Great Paper Chaser
Bushed
Joined
May 4, 2012
Messages
55,386
Reputation
2,965
Daps
156,687
Reppin
North Jersey but I miss Cali :sadcam:
i strongly suggest you try more than one AI model and different prompts to get a acceptable responses.

protip: ask it why the code can't do something if telling it to implement something is failing.
I’m like a prompt master now. Before you start a task or project, you’re gonna wanna know exactly what you’re trying to do and explain/guide the AI through it. Especially with complex shyt. So if you want the code to do something but it consists of 20 different steps, variations, you can’t just ask the AI to write the code . It will make assumptions and leave out tasks. More importantly, it will write the code in a way that makes it hard to scale without making unnecessary changes. There’s times where I will build something, but don’t think to even add a feature or function to it and end up noticing it down the road. But because the AI wrote it a certain way, I have to scrap it and start over. There’s also memory lapses and chat length limitations.
 

bnew

Veteran
Joined
Nov 1, 2015
Messages
62,932
Reputation
9,589
Daps
172,321
I’m like a prompt master now. Before you start a task or project, you’re gonna wanna know exactly what you’re trying to do and explain/guide the AI through it. Especially with complex shyt. So if you want the code to do something but it consists of 20 different steps, variations, you can’t just ask the AI to write the code . It will make assumptions and leave out tasks. More importantly, it will write the code in a way that makes it hard to scale without making unnecessary changes. There’s times where I will build something, but don’t think to even add a feature or function to it and end up noticing it down the road. But because the AI wrote it a certain way, I have to scrap it and start over. There’s also memory lapses and chat length limitations.

do you have a unimportant chat you can share an example of your process?
 

Ethnic Vagina Finder

The Great Paper Chaser
Bushed
Joined
May 4, 2012
Messages
55,386
Reputation
2,965
Daps
156,687
Reppin
North Jersey but I miss Cali :sadcam:
anything really, but in what cases do you have to scrape code instead of making it adopt your coding style?
I don’t understand your question. Let’s say I want to build a chess game. First I will pick a programming language. Then I will figure how the file structure, front end and back end. Then understand how they communicate. So by the time I ask the AI to start writing code, I will know what to ask and when to ask so that it doesn’t make as many mistakes. Then I will paste in the code and figure out what’s not working.


Then I will add console log code for debugging. So when I run the application if something doesn’t work, I know exactly where to look. But there’s a lot that goes into it. Sometimes you still have to read documentation so you can understand whatever framework you’re using. AI isn’t going to remember every little detail about every framework or programming language. So I will also feed AI new information as well. It’s more of a collaboration and not me saying “write this” or “build this”.

You could run into a small issue that keeping the program from working and it could come down to the file structure being wrong. AI will tend to over complicate something if you don’t guide it properly.
 

bnew

Veteran
Joined
Nov 1, 2015
Messages
62,932
Reputation
9,589
Daps
172,321
I don’t understand your question. Let’s say I want to build a chess game. First I will pick a programming language. Then I will figure how the file structure, front end and back end. Then understand how they communicate. So by the time I ask the AI to start writing code, I will know what to ask and when to ask so that it doesn’t make as many mistakes. Then I will paste in the code and figure out what’s not working.


Then I will add console log code for debugging. So when I run the application if something doesn’t work, I know exactly where to look. But there’s a lot that goes into it. Sometimes you still have to read documentation so you can understand whatever framework you’re using. AI isn’t going to remember every little detail about every framework or programming language. So I will also feed AI new information as well. It’s more of a collaboration and not me saying “write this” or “build this”.

You could run into a small issue that keeping the program from working and it could come down to the file structure being wrong. AI will tend to over complicate something if you don’t guide it properly.

I have some experience with having to specify what it should include or exclude in headers/libraries but i don't have experience trying to develop real desktop apps though. I've tried browser extensions with partial success but like you said it doesn't always know the every framework or programming language.
 

Ethnic Vagina Finder

The Great Paper Chaser
Bushed
Joined
May 4, 2012
Messages
55,386
Reputation
2,965
Daps
156,687
Reppin
North Jersey but I miss Cali :sadcam:
I have some experience with having to specify what it should include or exclude in headers/libraries but i don't have experience trying to develop real desktop apps though. I've tried browser extensions with partial success but like you said it doesn't always know the every framework or programming language.
I’ve pushed boundaries. Trying to get it to create something that’s normally not created. Or tried.

You also have to take into account practicality, performance and visual esthetics. You will end up having to decide which one isn’t important and move on.

The rule of thumb I learned to use is if you built something and it doesn’t work after 5 or 6 variations and you start going in an error loop, scrap it and take a new approach.
 

cyndaquil

Lv 100 Bold natured
Joined
Sep 2, 2014
Messages
8,965
Reputation
2,819
Daps
32,753
Reppin
JOHTO REGION
Something nobody really talks about but older developers in their late 50s or older are hilarious because they genuinely give no fukks. If they've been in tech up until this point they probably have enough bread to retire but are working to fund some side shyt they want to do.
These folks will drop f bombs in meetings, cuss out their manager and genuinely not conform to a lot of the performative bullshyt in corporate since they aren't looking to advance their career anymore :russ:
 

null

...
Joined
Nov 12, 2014
Messages
31,041
Reputation
5,428
Daps
48,838
Reppin
UK, DE, GY, DMV
I don’t understand your question. Let’s say I want to build a chess game. First I will pick a programming language. Then I will figure how the file structure, front end and back end. Then understand how they communicate. So by the time I ask the AI to start writing code, I will know what to ask and when to ask so that it doesn’t make as many mistakes.

That doesn't stop it. Loops, fakes, deprecated, no relative context.

I could go on.

ChatGPT is good for small micro steps. Asking it to write complex functions is a waste of time.

Test: Can you write me a method that encodes a HD (https://www.mobilefish.com/download/blockchain/blockchain_hd_wallets_part29.pdf) capable public key to raw on a client side (say swift/Obj C) and then corresponding encode and decode methods on the server side (Java/C++) using something like bouncy (or something of your choice) using ChatGPT?

The answer is no :hubie: . It will help with maybe 10% of it (which you could just look up) and the rest you will have to figure out yourself. while getting annoyed by its apologies and promises to do better, even while it's producing more pages of red herring, time consuming, inaccuracies.

Then I will paste in the code and figure out what’s not working.

Then I will add console log code for debugging. So when I run the application if something doesn’t work, I know exactly where to look. But there’s a lot that goes into it. Sometimes you still have to read documentation so you can understand whatever framework you’re using. AI isn’t going to remember every little detail about every framework or programming language.

AI remembers too many details.

So I will also feed AI new information as well. It’s more of a collaboration and not me saying “write this” or “build this”.

You could run into a small issue that keeping the program from working and it could come down to the file structure being wrong. AI will tend to over complicate something if you don’t guide it properly.
 

bnew

Veteran
Joined
Nov 1, 2015
Messages
62,932
Reputation
9,589
Daps
172,321
That doesn't stop it. Loops, fakes, deprecated, no relative context.

I could go on.

ChatGPT is good for small micro steps. Asking it to write complex functions is a waste of time.

Test: Can you write me a method that encodes a HD (https://www.mobilefish.com/download/blockchain/blockchain_hd_wallets_part29.pdf) capable public key to raw on a client side (say swift/Obj C) and then corresponding encode and decode methods on the server side (Java/C++) using something like bouncy (or something of your choice) using ChatGPT?

The answer is no :hubie: . It will help with maybe 10% of it (which you could just look up) and the rest you will have to figure out yourself. while getting annoyed by its apologies and promises to do better, even while it's producing more pages of red herring, time consuming, inaccuracies.



AI remembers too many details.



You are an expert software developer and quality assurance specialist. For each response:

1. Provide a concise, focused answer without unnecessary elaboration.
2. Implement a self-check mechanism to avoid loops in logic or code.
3. Maintain a persistent memory log of our conversation, referencing it in each response.
4. Clearly distinguish between established facts and your suggestions or opinions.
5. Specify exact versions for all technologies mentioned and note compatibility issues.
6. Start with a high-level overview before diving into details.
7. Define the scope of the problem and solution explicitly.
8. Rank your suggestions in order of priority and explain the reasoning.
9. Review your output for consistency and correctness before submitting.
10. If you're uncertain about any information, state it clearly instead of guessing.
11. Use clear, precise language and avoid unnecessary repetition.

I need a method to encode a Hierarchical Deterministic (HD) wallet-capable public key to its raw format on the client side using Swift or Objective-C. Additionally, I require corresponding encode and decode methods on the server side using Java or C++. You can use the Bouncy Castle library or any other suitable library of your choice.

**Requirements:**

1. **Client Side (Swift/Objective-C):**
- Implement a method to encode an HD wallet-capable public key to its raw format.
- Ensure the method is secure and efficient.

2. **Server Side (Java/C++):**
- Implement methods to encode and decode the raw public key.
- Use the Bouncy Castle library or an equivalent library for cryptographic operations.
- Ensure the methods are secure and handle edge cases appropriately.

**Additional Information:**
- The HD wallet specification can be found here: [HD Wallet Specification](https://www.mobilefish.com/download/blockchain/blockchain_hd_wallets_part29.pdf).
- The solution should be well-documented and include comments for clarity.

**Example:**
- Client Side: A Swift function that takes a public key and returns its raw encoded format.
- Server Side: Java methods to encode a public key to raw format and decode a raw format back to a public key.

Please provide the complete code for both client and server sides.

### Overview

To implement the encoding and decoding of HD wallet-capable public keys, we will use Swift for the client side and Java with the Bouncy Castle library for the server side. The HD wallet specification follows the BIP-32 standard, which defines hierarchical deterministic wallets.

### Client Side (Swift)

We will use the `HDWalletKit` library to handle HD wallet operations in Swift. This library provides functionalities to create and manage HD wallets, including key derivation and encoding.

#### Swift Code

Code:
import HDWalletKit

func encodePublicKeyToRaw(publicKey: String) -> String? {
    guard let data = Data(base64Encoded: publicKey) else {
        return nil
    }
    let rawPublicKey = data.base58EncodedString()
    return rawPublicKey
}

// Example usage
let publicKey = "your_public_key_here"
if let rawPublicKey = encodePublicKeyToRaw(publicKey: publicKey) {
    print("Raw Public Key: \(rawPublicKey)")
} else {
    print("Failed to encode public key.")
}

### Server Side (Java)

We will use the Bouncy Castle library to handle cryptographic operations in Java. The library provides functionalities to encode and decode public keys using the Base58Check encoding scheme.

#### Java Code

Code:
import org.bitcoinj.core.Base58;
import org.bitcoinj.core.ECKey;
import org.bitcoinj.params.MainNetParams;
import org.bouncycastle.util.encoders.Hex;

public class HDPublicKeyEncoder {

    public static String encodePublicKeyToRaw(String publicKey) {
        byte[] decodedPublicKey = Hex.decode(publicKey);
        String rawPublicKey = Base58.encode(decodedPublicKey);
        return rawPublicKey;
    }

    public static String decodeRawPublicKey(String rawPublicKey) {
        byte[] decodedRawPublicKey = Base58.decode(rawPublicKey);
        ECKey key = ECKey.fromPublicOnly(decodedRawPublicKey);
        return key.getPublicKeyAsHex();
    }

    public static void main(String[] args) {
        String publicKey = "your_public_key_here";
        String rawPublicKey = encodePublicKeyToRaw(publicKey);
        System.out.println("Raw Public Key: " + rawPublicKey);

        String decodedPublicKey = decodeRawPublicKey(rawPublicKey);
        System.out.println("Decoded Public Key: " + decodedPublicKey);
    }
}

### Explanation

1. **Client Side (Swift):**
- The `encodePublicKeyToRaw` function takes a Base64-encoded public key, decodes it, and then encodes it to a Base58Check string.
- The `HDWalletKit` library is used to handle the encoding process.

2. **Server Side (Java):**
- The `encodePublicKeyToRaw` function takes a hex-encoded public key, decodes it, and then encodes it to a Base58Check string using the Bouncy Castle library.
- The `decodeRawPublicKey` function takes a Base58Check-encoded raw public key, decodes it, and then converts it back to a hex-encoded public key using the Bitcoinj library.

### Additional Information

- The HD wallet specification can be found [here](https://www.mobilefish.com/download/blockchain/blockchain_hd_wallets_part29.pdf).
- The Bouncy Castle library is a widely used library for cryptographic operations in Java.
- The Bitcoinj library provides functionalities to work with Bitcoin keys and addresses in Java.

This solution ensures that the public key is securely encoded and decoded on both the client and server sides, following the BIP-32 standard for HD wallets.

i don't know if this is a good output since this isn't a strong coding model :hubie:
 
Last edited:

bnew

Veteran
Joined
Nov 1, 2015
Messages
62,932
Reputation
9,589
Daps
172,321
attemped with grok 3 deep research

Key Points​

  • It seems likely that encoding an HD wallet public key to raw format involves converting it to a compressed byte array, typically 33 bytes for secp256k1.
  • Research suggests using libraries like HDWalletKit for Swift, Bouncy Castle for Java, and OpenSSL for C++ to handle these operations securely.
  • The evidence leans toward ensuring compatibility across client and server by using compressed format, which is standard for HD wallets.

Client Side Implementation​

For the client side in Swift, you can use the HDWalletKit library to encode the public key to its raw (compressed) format. The method is simple and returns the public key as a Data object, which is secure and efficient for client-side operations.

Server Side Implementation​

For the server side, you have options in Java with Bouncy Castle (version 1.78) or C++ with OpenSSL (version 3.0). Both implementations provide methods to encode and decode the raw public key, ensuring security and handling edge cases like invalid inputs. Bouncy Castle is recommended for Java due to its comprehensive EC support, while OpenSSL is suitable for C++ with robust error handling.

Survey Note: Detailed Analysis of HD Wallet Public Key Encoding​

Introduction​

Hierarchical Deterministic (HD) wallets, as defined in standards like BIP-32, are crucial for generating multiple addresses from a single seed in cryptocurrencies such as Bitcoin. This report details the implementation of encoding an HD wallet-capable public key to its raw format on the client side using Swift or Objective-C, and corresponding encode and decode methods on the server side using Java or C++, leveraging libraries like Bouncy Castle or OpenSSL. The focus is on security, efficiency, and compatibility, with a timestamp reference of 07:37 AM PDT on Tuesday, April 08, 2025.

Background and Scope​

The scope involves:
  • Client Side: Implementing a method in Swift or Objective-C to encode an HD public key to its raw format, ensuring security and efficiency.
  • Server Side: Implementing encode and decode methods in Java or C++ using Bouncy Castle or equivalent, handling edge cases and maintaining security.
The solution targets HD wallets, typically using the secp256k1 curve, with raw format likely referring to the compressed 33-byte EC point representation, as per BIP-32 standards.

Client Side Implementation Details​

Swift Implementation​

For Swift, the HDWalletKit library is suitable, providing HDPublicKey with a raw property that returns the compressed public key as Data. The implementation is straightforward:
  • Method: getRawPublicKey(publicKey: HDPublicKey) -> Data returns publicKey.raw, assumed to be the compressed 33-byte format.
  • Library: HDWalletKit, with no specific version mentioned, but ensure compatibility with recent iOS versions.
  • Security: The method is secure as it leverages established cryptographic libraries, with no local processing of sensitive data exposed.
For Objective-C, a similar approach can be used, adapting the library's interface:
  • Method: getRawPublicKey(HDPublicKey *publicKey) returns publicKey.raw as NSData.

Supporting Evidence​

Research from GitHub repositories like hd-wallet-kit-ios/HDPublicKey.swift shows HDPublicKey.raw as a common property, likely compressed, aligning with HD wallet standards.

Server Side Implementation Details​

Java with Bouncy Castle​

Using Bouncy Castle (version 1.78), the implementation involves:
  • Encode Method: encodePublicKey(PublicKey publicKey) casts to ECPublicKey, gets the EC point, and returns point.getEncoded(true) for compressed format.
  • Decode Method: decodePublicKey(byte[] encoded) uses ECNamedCurveTable.getParameterSpec("secp256k1") to get the curve, decodes the point with curve.decodePoint(encoded), and generates a PublicKey using KeyFactory.
  • Dependencies: Add via Maven <dependency><groupId>org.bouncycastle</groupId><artifactId>bcprov-jdk18on</artifactId><version>1.78</version></dependency> or Gradle implementation 'org.bouncycastle:bcprov-jdk18on:1.78'.
  • Compatibility: Ensure Java 8 or later, with no known issues for recent versions.
  • Security: Includes input validation and exception handling for malformed keys.

C++ with OpenSSL​

Using OpenSSL (version 3.0), the implementation involves:
  • Encode Method: encodePublicKey(const EVP_PKEY* pkey) extracts EC_KEY, uses EC_POINT_point2oct with POINT_CONVERSION_COMPRESSED to get the raw bytes.
  • Decode Method: decodePublicKey(const std::vector<unsigned char>& encoded) creates an EC_GROUP for secp256k1, uses EC_POINT_oct2point to decode, and constructs an EVP_PKEY.
  • Dependencies: Ensure OpenSSL is installed (e.g., libssl-dev on Linux, or Windows binaries).
  • Compatibility: Works with C++11 and later, with no specific issues noted for version 3.0.
  • Security: Includes error handling and memory management, crucial for OpenSSL operations.

Comparative Analysis​

AspectJava (Bouncy Castle)C++ (OpenSSL)
Ease of UseHigh, JCE integrationModerate, manual memory management
Security FeaturesRobust, built-in validationRobust, requires careful handling
PerformanceGood, JVM optimizedExcellent, native code
CompatibilityJava 8+, cross-platformC++11+, platform-dependent
DocumentationExtensive, Bouncy Castle Java DocumentationExtensive, OpenSSL Documentation

Documentation and Comments​

All implementations include comments for clarity, as requested:
  • Swift: Method comments explain input and output.
  • Java: Javadoc-style comments for methods, detailing exceptions and usage.
  • C++: C-style comments for each step, ensuring readability.

Edge Cases and Security​

  • Client Side: Ensure HDPublicKey is valid before calling raw, with no specific edge cases noted.
  • Server Side: Both implementations handle invalid inputs (e.g., non-EC keys, malformed bytes) with exceptions, ensuring robustness.

Priority and Reasoning​

  1. Security: First priority, as cryptographic operations must be secure. Both libraries (Bouncy Castle, OpenSSL) are established and audited.
  2. Compatibility: Second, ensuring client-server interoperability, achieved by using compressed format.
  3. Efficiency: Third, with native optimizations in C++ and JVM in Java, both efficient for server use.

Review and Consistency​

The implementations were reviewed for consistency:
  • All use compressed format for raw public keys, aligning with HD wallet standards.
  • Error handling is consistent across languages, with exceptions or returns for invalid states.
  • Documentation is uniform, with comments explaining each step.

Uncertainty and Assumptions​

The assumption that "raw format" means compressed 33-byte EC point is based on BIP-32 standards and HD wallet practices. If uncompressed is required, adjust by using point.getEncoded(false) in Java or POINT_CONVERSION_UNCOMPRESSED in C++. This was not explicitly stated, so the compressed format is recommended as standard.




pastebin.com/Fc7JNCRc
 

weather so breezy

Superstar
Joined
May 24, 2022
Messages
1,592
Reputation
1,139
Daps
12,604
brehs with experience in the field , could you explain how dangerous all this AI stuff really is for someone still studying software?

is backend development a safer option than frontend?

shyt ain't lookin bright for new ones and juniors etc :mjcry:
 
Top